mirror of
https://github.com/AlmostReliable/almostunified.git
synced 2024-11-27 01:56:00 -05:00
Compare commits
6 commits
427f5264c7
...
fd4bd6a460
Author | SHA1 | Date | |
---|---|---|---|
|
fd4bd6a460 | ||
|
ebd1db2d37 | ||
|
d3dcf67113 | ||
|
5d76128d1b | ||
|
9769c25a1c | ||
|
84fcb8046d |
5 changed files with 36 additions and 21 deletions
14
CHANGELOG.md
14
CHANGELOG.md
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
The format is based on [Keep a Changelog],
|
|
||||||
and this project adheres to [Semantic Versioning].
|
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
- /
|
|
||||||
|
- 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
|
||||||
|
|
||||||
## [1.2.0] - 2024-10-06
|
## [1.2.0] - 2024-10-06
|
||||||
|
|
||||||
|
@ -32,10 +34,6 @@ and this project adheres to [Semantic Versioning].
|
||||||
|
|
||||||
Initial 1.21.1 port.
|
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 -->
|
<!-- Versions -->
|
||||||
[1.2.0]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.2.0
|
[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
|
[1.1.0]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.1.0
|
||||||
|
|
|
@ -46,12 +46,12 @@ public final class AlmostUnifiedCommon {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onRecipeManagerError(ResourceLocation recipe) {
|
public static void onRecipeManagerError(ResourceLocation recipe) {
|
||||||
assert RUNTIME != null;
|
if (RUNTIME == null) return;
|
||||||
RUNTIME.getDebugHandler().collectRecipeError(recipe);
|
RUNTIME.getDebugHandler().collectRecipeError(recipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onRecipeManagerEnd() {
|
public static void onRecipeManagerEnd() {
|
||||||
assert RUNTIME != null;
|
if (RUNTIME == null) return;
|
||||||
RUNTIME.getDebugHandler().finish();
|
RUNTIME.getDebugHandler().finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,12 +76,7 @@ public final class AlmostUnifiedRuntimeImpl implements AlmostUnifiedRuntime {
|
||||||
var tagConfig = Config.load(TagConfig.NAME, TagConfig.SERIALIZER);
|
var tagConfig = Config.load(TagConfig.NAME, TagConfig.SERIALIZER);
|
||||||
var unificationConfigs = UnificationConfig.safeLoadConfigs();
|
var unificationConfigs = UnificationConfig.safeLoadConfigs();
|
||||||
|
|
||||||
var unificationTags = bakeAndValidateTags(
|
TagReloadHandler.applyCustomTags(tagConfig.getCustomTags(), itemTags);
|
||||||
unificationConfigs,
|
|
||||||
itemTags,
|
|
||||||
placeholderConfig,
|
|
||||||
debugConfig.shouldLogInvalidTags()
|
|
||||||
);
|
|
||||||
|
|
||||||
CustomIngredientUnifierRegistry ingredientUnifierRegistry = new CustomIngredientUnifierRegistryImpl();
|
CustomIngredientUnifierRegistry ingredientUnifierRegistry = new CustomIngredientUnifierRegistryImpl();
|
||||||
PluginManager.instance().registerCustomIngredientUnifiers(ingredientUnifierRegistry);
|
PluginManager.instance().registerCustomIngredientUnifiers(ingredientUnifierRegistry);
|
||||||
|
@ -89,7 +84,13 @@ public final class AlmostUnifiedRuntimeImpl implements AlmostUnifiedRuntime {
|
||||||
PluginManager.instance().registerRecipeUnifiers(recipeUnifierRegistry);
|
PluginManager.instance().registerRecipeUnifiers(recipeUnifierRegistry);
|
||||||
// TODO: add plugin support for registering config defaults
|
// TODO: add plugin support for registering config defaults
|
||||||
|
|
||||||
TagReloadHandler.applyCustomTags(tagConfig.getCustomTags(), itemTags);
|
var unificationTags = bakeAndValidateTags(
|
||||||
|
unificationConfigs,
|
||||||
|
itemTags,
|
||||||
|
placeholderConfig,
|
||||||
|
debugConfig.shouldLogInvalidTags()
|
||||||
|
);
|
||||||
|
|
||||||
TagSubstitutionsImpl tagSubstitutions = TagSubstitutionsImpl.create(
|
TagSubstitutionsImpl tagSubstitutions = TagSubstitutionsImpl.create(
|
||||||
itemTags::has,
|
itemTags::has,
|
||||||
unificationTags::contains,
|
unificationTags::contains,
|
||||||
|
|
|
@ -7,6 +7,7 @@ import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.crafting.Ingredient;
|
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.ModPriorities;
|
||||||
import com.almostreliable.unified.api.unification.StoneVariants;
|
import com.almostreliable.unified.api.unification.StoneVariants;
|
||||||
import com.almostreliable.unified.api.unification.TagSubstitutions;
|
import com.almostreliable.unified.api.unification.TagSubstitutions;
|
||||||
|
@ -117,15 +118,22 @@ public final class UnificationLookupImpl implements UnificationLookup {
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private final Set<UnificationEntry<Item>> createdEntries = new HashSet<>();
|
private final Map<UnificationEntry<Item>, TagKey<Item>> entriesToTags = new HashMap<>();
|
||||||
private final Map<TagKey<Item>, Set<UnificationEntry<Item>>> tagsToEntries = new HashMap<>();
|
private final Map<TagKey<Item>, Set<UnificationEntry<Item>>> tagsToEntries = new HashMap<>();
|
||||||
|
|
||||||
private void put(TagKey<Item> tag, UnificationEntry<Item> entry) {
|
private void put(TagKey<Item> tag, UnificationEntry<Item> entry) {
|
||||||
if (createdEntries.contains(entry)) {
|
if (entriesToTags.containsKey(entry)) {
|
||||||
throw new IllegalStateException("entry " + entry + " already created");
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
createdEntries.add(entry);
|
entriesToTags.put(entry, tag);
|
||||||
tagsToEntries.computeIfAbsent(tag, $ -> new HashSet<>()).add(entry);
|
tagsToEntries.computeIfAbsent(tag, $ -> new HashSet<>()).add(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
Loading…
Reference in a new issue