fix stone strata detection not being applied to ingredients

fixes #22
This commit is contained in:
Relentless 2022-11-21 14:41:55 +01:00
parent 9e0c36bf7b
commit 3558ed2c30
No known key found for this signature in database
GPG key ID: 759D97B8C6F25265
2 changed files with 8 additions and 0 deletions

View file

@ -83,7 +83,11 @@ public class RecipeContextImpl implements RecipeContext {
if (object.get(RecipeConstants.ITEM) instanceof JsonPrimitive primitive) { if (object.get(RecipeConstants.ITEM) instanceof JsonPrimitive primitive) {
ResourceLocation item = ResourceLocation.tryParse(primitive.getAsString()); ResourceLocation item = ResourceLocation.tryParse(primitive.getAsString());
UnifyTag<Item> tag = getPreferredTagForItem(item); UnifyTag<Item> tag = getPreferredTagForItem(item);
if (tag != null) { if (tag != null) {
// avoid replacing input items with tags in case the stone strata matters
if (replacementMap.getStoneStrataHandler().isStoneStrataTag(tag)) return;
object.remove(RecipeConstants.ITEM); object.remove(RecipeConstants.ITEM);
object.add(RecipeConstants.TAG, new JsonPrimitive(tag.location().toString())); object.add(RecipeConstants.TAG, new JsonPrimitive(tag.location().toString()));
} }

View file

@ -103,4 +103,8 @@ public class ReplacementMap {
} }
return null; return null;
} }
public StoneStrataHandler getStoneStrataHandler() {
return stoneStrataHandler;
}
} }