From b76420e3bd81886593587c295284b33e57b29cdf Mon Sep 17 00:00:00 2001 From: shedaniel Date: Fri, 11 Sep 2020 00:09:29 +0800 Subject: 1.16.3 and remove the assumption that fabric tags are categorizing the tools. Signed-off-by: shedaniel --- .../me/shedaniel/rei/plugin/DefaultPlugin.java | 34 +++++++++++++++------- build.gradle | 1 + gradle.properties | 7 ++--- 3 files changed, 27 insertions(+), 15 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 axes = Minecraft.getInstance().getConnection().getTags().getItems().getTag(new ResourceLocation("fabric", "axes")); - if (axes != null) { - for (Item item : axes.getValues()) { + Set 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 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 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 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 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 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); diff --git a/build.gradle b/build.gradle index c605ab16b..204bcd54f 100755 --- a/build.gradle +++ b/build.gradle @@ -284,6 +284,7 @@ curseforge { changelog = releaseChangelog addGameVersion "1.16-Snapshot" addGameVersion "1.16.2" + addGameVersion "1.16.3" addGameVersion "Java 8" addGameVersion "Fabric" relations { diff --git a/gradle.properties b/gradle.properties index 65f2199d0..6f601b200 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,7 @@ org.gradle.jvmargs=-Xmx3G -mod_version=5.4.1 -supported_version=1.16.2 -minecraft_version=1.16.2-rc1 -yarn_version=1.16.2-rc1+build.4+legacy.20w09a+build.8 +mod_version=5.4.2 +supported_version=1.16.2/3 +minecraft_version=1.16.3 fabricloader_version=0.9.1+build.205 cloth_client_events_v0_version=1.4.5 cloth_config_version=4.8.1 -- cgit