apace100 / apoli

MIT License
40 stars 46 forks source link

Add in_tag ItemCondition #194

Closed nightpool closed 11 months ago

nightpool commented 11 months ago

Don't have time to do a full PR for this but feels like a no-brainer:

Registry.register(ApoliRegistries.ITEM_CONDITION, id("in_tag"),
  new ConditionFactory<>(
    id("in_tag"),
    new SerializableData().add("tag", SerializableDataTypes.ITEM_TAG),
    (data, worldStack) -> worldStack.getB().is(data.<TagKey<Item>>get("tag"))
  )
);
nightpool commented 11 months ago

Sorry, I found that ingredient is supposed to do this. I think the naming is kind of confusing—I overlooked it a few times since the ItemCondition docs mentioned the recipe book so I assumed it meant "is an ingredient to some specified recipe". Maybe an alias like matches or similar would make it easier to find?