Compare commits

..

1 commit

Author SHA1 Message Date
James Mitchell
427f5264c7
Merge 8dd052c9ca into 254055b9b3 2024-10-09 00:07:12 +00:00
5 changed files with 21 additions and 36 deletions

View file

@ -2,13 +2,11 @@
All notable changes to this project will be documented in this file.
## Unreleased
The format is based on [Keep a Changelog],
and this project adheres to [Semantic Versioning].
- added better logging for cases where items are assigned to multiple unification tags
- added Turkish translation ([#102](https://github.com/AlmostReliable/almostunified/pull/102))
- fixed crash when runtime isn't loaded ([#101](https://github.com/AlmostReliable/almostunified/issues/101))
- fixed newly created custom tags not being considered for unification
- fixed runtime not being available when items are assigned to multiple unification tags
## Unreleased
- /
## [1.2.0] - 2024-10-06
@ -34,6 +32,10 @@ All notable changes to this project will be documented in this file.
Initial 1.21.1 port.
<!-- Links -->
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html
<!-- Versions -->
[1.2.0]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.2.0
[1.1.0]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.1.0

View file

@ -46,12 +46,12 @@ public final class AlmostUnifiedCommon {
}
public static void onRecipeManagerError(ResourceLocation recipe) {
if (RUNTIME == null) return;
assert RUNTIME != null;
RUNTIME.getDebugHandler().collectRecipeError(recipe);
}
public static void onRecipeManagerEnd() {
if (RUNTIME == null) return;
assert RUNTIME != null;
RUNTIME.getDebugHandler().finish();
}
}

View file

@ -76,14 +76,6 @@ public final class AlmostUnifiedRuntimeImpl implements AlmostUnifiedRuntime {
var tagConfig = Config.load(TagConfig.NAME, TagConfig.SERIALIZER);
var unificationConfigs = UnificationConfig.safeLoadConfigs();
TagReloadHandler.applyCustomTags(tagConfig.getCustomTags(), itemTags);
CustomIngredientUnifierRegistry ingredientUnifierRegistry = new CustomIngredientUnifierRegistryImpl();
PluginManager.instance().registerCustomIngredientUnifiers(ingredientUnifierRegistry);
RecipeUnifierRegistry recipeUnifierRegistry = new RecipeUnifierRegistryImpl();
PluginManager.instance().registerRecipeUnifiers(recipeUnifierRegistry);
// TODO: add plugin support for registering config defaults
var unificationTags = bakeAndValidateTags(
unificationConfigs,
itemTags,
@ -91,6 +83,13 @@ public final class AlmostUnifiedRuntimeImpl implements AlmostUnifiedRuntime {
debugConfig.shouldLogInvalidTags()
);
CustomIngredientUnifierRegistry ingredientUnifierRegistry = new CustomIngredientUnifierRegistryImpl();
PluginManager.instance().registerCustomIngredientUnifiers(ingredientUnifierRegistry);
RecipeUnifierRegistry recipeUnifierRegistry = new RecipeUnifierRegistryImpl();
PluginManager.instance().registerRecipeUnifiers(recipeUnifierRegistry);
// TODO: add plugin support for registering config defaults
TagReloadHandler.applyCustomTags(tagConfig.getCustomTags(), itemTags);
TagSubstitutionsImpl tagSubstitutions = TagSubstitutionsImpl.create(
itemTags::has,
unificationTags::contains,

View file

@ -7,7 +7,6 @@ import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import com.almostreliable.unified.AlmostUnifiedCommon;
import com.almostreliable.unified.api.unification.ModPriorities;
import com.almostreliable.unified.api.unification.StoneVariants;
import com.almostreliable.unified.api.unification.TagSubstitutions;
@ -118,22 +117,15 @@ public final class UnificationLookupImpl implements UnificationLookup {
public static class Builder {
private final Map<UnificationEntry<Item>, TagKey<Item>> entriesToTags = new HashMap<>();
private final Set<UnificationEntry<Item>> createdEntries = new HashSet<>();
private final Map<TagKey<Item>, Set<UnificationEntry<Item>>> tagsToEntries = new HashMap<>();
private void put(TagKey<Item> tag, UnificationEntry<Item> entry) {
if (entriesToTags.containsKey(entry)) {
var boundTag = entriesToTags.get(entry);
AlmostUnifiedCommon.LOGGER.error(
"Unification entry for item '{}' with tag '#{}' is already part of tag '#{}'.",
entry.id(),
tag.location(),
boundTag.location()
);
return;
if (createdEntries.contains(entry)) {
throw new IllegalStateException("entry " + entry + " already created");
}
entriesToTags.put(entry, tag);
createdEntries.add(entry);
tagsToEntries.computeIfAbsent(tag, $ -> new HashSet<>()).add(entry);
}

View file

@ -1,8 +0,0 @@
{
"almostunified.description": "Almost Unified tarafından değiştirildi!",
"almostunified.warning": "Tarif sorunlarını orijinal sahibine bildirmeyin.",
"almostunified.unified": "Birleştirilmiş",
"almostunified.duplicate": "Kopyaları Vardı",
"almostunified.yes": "Evet",
"almostunified.no": "Hayır"
}