diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-09-11 00:09:29 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-09-11 00:09:29 +0800 |
| commit | b76420e3bd81886593587c295284b33e57b29cdf (patch) | |
| tree | 7fb384f50d8a0ffdea5c2ddc2b5b01c54ce40f2e /RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java | |
| parent | 87825fc51483fc0f735e5e4e3a435c2862e0495a (diff) | |
| download | RoughlyEnoughItems-b76420e3bd81886593587c295284b33e57b29cdf.tar.gz RoughlyEnoughItems-b76420e3bd81886593587c295284b33e57b29cdf.tar.bz2 RoughlyEnoughItems-b76420e3bd81886593587c295284b33e57b29cdf.zip | |
1.16.3 and remove the assumption that fabric tags are categorizing the tools.
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java')
| -rw-r--r-- | RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java b/RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java index c5198bce1..793052a28 100644 --- a/RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java +++ b/RoughlyEnoughItems-default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java @@ -359,23 +359,35 @@ public class DefaultPlugin implements REIPluginV0, BuiltinPlugin { recipeHelper.registerWorkingStations(SMITHING, EntryStack.create(Items.SMITHING_TABLE)); recipeHelper.registerWorkingStations(BEACON, EntryStack.create(Items.BEACON)); recipeHelper.registerWorkingStations(BEACON_PAYMENT, EntryStack.create(Items.BEACON)); - Tag<Item> axes = Minecraft.getInstance().getConnection().getTags().getItems().getTag(new ResourceLocation("fabric", "axes")); - if (axes != null) { - for (Item item : axes.getValues()) { + Set<Item> axes = Sets.newHashSet(), hoes = Sets.newHashSet(), shovels = Sets.newHashSet(); + EntryRegistry.getInstance().getEntryStacks().filter(stack -> stack.getType() == EntryStack.Type.ITEM).map(EntryStack::getItem).forEach(item -> { + if (item instanceof AxeItem && axes.add(item)) { recipeHelper.registerWorkingStations(STRIPPING, EntryStack.create(item)); } - } - Tag<Item> hoes = Minecraft.getInstance().getConnection().getTags().getItems().getTag(new ResourceLocation("fabric", "hoes")); - if (hoes != null) { - for (Item item : hoes.getValues()) { + if (item instanceof HoeItem && hoes.add(item)) { recipeHelper.registerWorkingStations(TILLING, EntryStack.create(item)); } - } - Tag<Item> shovels = Minecraft.getInstance().getConnection().getTags().getItems().getTag(new ResourceLocation("fabric", "shovels")); - if (shovels != null) { - for (Item item : shovels.getValues()) { + if (item instanceof ShovelItem && shovels.add(item)) { recipeHelper.registerWorkingStations(PATHING, EntryStack.create(item)); } + }); + Tag<Item> axesTag = Minecraft.getInstance().getConnection().getTags().getItems().getTag(new ResourceLocation("c", "axes")); + if (axesTag != null) { + for (Item item : axesTag.getValues()) { + if (axes.add(item)) recipeHelper.registerWorkingStations(STRIPPING, EntryStack.create(item)); + } + } + Tag<Item> hoesTag = Minecraft.getInstance().getConnection().getTags().getItems().getTag(new ResourceLocation("c", "hoes")); + if (hoesTag != null) { + for (Item item : hoesTag.getValues()) { + if (hoes.add(item)) recipeHelper.registerWorkingStations(TILLING, EntryStack.create(item)); + } + } + Tag<Item> shovelsTag = Minecraft.getInstance().getConnection().getTags().getItems().getTag(new ResourceLocation("c", "shovels")); + if (shovelsTag != null) { + for (Item item : shovelsTag.getValues()) { + if (shovels.add(item)) recipeHelper.registerWorkingStations(PATHING, EntryStack.create(item)); + } } recipeHelper.removeAutoCraftButton(FUEL); recipeHelper.removeAutoCraftButton(COMPOSTING); |
