Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ public final boolean matchesOrEquivalent(Ingredient fromRepair, Ingredient fromC
}
return transformedJsonString.equals(fromCrafting.toJson().toString());
}
@Comment("Print error messages? (default: false)")
public boolean pronounceUnloadedError = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
public class IngredientMixin {
@Unique
private boolean isFootgun() {
boolean pronounceUnloadedError = TinkerersSmithing.CONFIG.pronounceUnloadedError;
Ingredient self = (Ingredient) (Object) this;
if (Arrays.stream(self.entries).anyMatch(e -> e instanceof Ingredient.TagEntry) && (Registries.ITEM.getEntryList(ItemTags.PLANKS).isEmpty() || Registries.ITEM.getEntryList(ItemTags.PLANKS).get().size() == 0)) {
TinkerersSmithing.LOGGER.error("[Tinkerer's Smithing] Cowardly refusing to access an unloaded tag ingredient: {}", self.toJson().toString(), new IllegalStateException("A tag ingredient was accessed before tags are loaded - This can break recipes! Report this to the mod in the trace below."));
return true;
}
if (Arrays.stream(self.entries).anyMatch(e -> e instanceof Ingredient.TagEntry) && (Registries.ITEM.getEntryList(ItemTags.PLANKS).isEmpty() || Registries.ITEM.getEntryList(ItemTags.PLANKS).get().size() == 0)) {
if (pronounceUnloadedError) {
TinkerersSmithing.LOGGER.error("[Tinkerer's Smithing] Cowardly refusing to access an unloaded tag ingredient: {}", self.toJson().toString(), new IllegalStateException("A tag ingredient was accessed before tags are loaded - This can break recipes! Report this to the mod in the trace below."));
}
return true;
}
return false;
}

Expand Down