From 08ff8dd80eb645fab90379d980b04b194ad259e7 Mon Sep 17 00:00:00 2001 From: TheRealWormbo Date: Tue, 23 Jan 2024 00:39:52 +0100 Subject: [PATCH] Remove mod priority configuration option for Orechid outputs (was never ported to Fabric and didn't work on Forge anyway; mod pack authors should customize the Orechid via data pack recipes) --- .../java/vazkii/botania/forge/ForgeBotaniaConfig.java | 9 --------- .../common/crafting/TagExcludingStateIngredient.java | 10 ---------- .../botania/common/crafting/TagStateIngredient.java | 6 +++--- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/Forge/src/main/java/vazkii/botania/forge/ForgeBotaniaConfig.java b/Forge/src/main/java/vazkii/botania/forge/ForgeBotaniaConfig.java index 38ceacfcbb..2bf73a4edd 100644 --- a/Forge/src/main/java/vazkii/botania/forge/ForgeBotaniaConfig.java +++ b/Forge/src/main/java/vazkii/botania/forge/ForgeBotaniaConfig.java @@ -227,8 +227,6 @@ private static class Common implements BotaniaConfig.ConfigAccess { public final ForgeConfigSpec.BooleanValue gogSpawnWithLexicon; public final ForgeConfigSpec.IntValue gogIslandScaleMultiplier; - public final ForgeConfigSpec.ConfigValue> orechidPriorityMods; - public final ForgeConfigSpec.ConfigValue> rannuncarpusItemBlacklist; public final ForgeConfigSpec.ConfigValue> rannuncarpusModBlacklist; @@ -288,13 +286,6 @@ public Common(ForgeConfigSpec.Builder builder) { By default, the scale is 8, putting each island on points separated by 2048 blocks. Values below 4 (1024 block spacing) are not recommended due to Nether portal collisions.""") .defineInRange("gardenOfGlass.islandScaleMultiplier", 8, 1, 512); - orechidPriorityMods = builder - .comment(""" - List of modids to prioritize when choosing a random ore from the tag. - By default, the chosen ore is randomly picked from all ores in the ore's tag. - Ores from mods present on this list will be picked over mods listed lower or not listed at all. - Applying changes at runtime requires /reload afterwards.""") - .defineList("orechidPriorityMods", Collections.emptyList(), o -> o instanceof String s && ResourceLocation.tryParse(s + ":test") != null); rannuncarpusItemBlacklist = builder .comment("List of item registry names that will be ignored by rannuncarpuses when placing blocks.") .defineList("rannuncarpus.itemBlacklist", Collections.emptyList(), o -> o instanceof String s && ResourceLocation.tryParse(s) != null); diff --git a/Xplat/src/main/java/vazkii/botania/common/crafting/TagExcludingStateIngredient.java b/Xplat/src/main/java/vazkii/botania/common/crafting/TagExcludingStateIngredient.java index 6a50a5a863..1a7b6469b9 100644 --- a/Xplat/src/main/java/vazkii/botania/common/crafting/TagExcludingStateIngredient.java +++ b/Xplat/src/main/java/vazkii/botania/common/crafting/TagExcludingStateIngredient.java @@ -12,7 +12,6 @@ import com.google.gson.JsonObject; import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.RandomSource; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; @@ -41,15 +40,6 @@ public boolean test(BlockState state) { return isNotExcluded(state); } - @Override - public BlockState pick(RandomSource random) { - List blocks = getBlocks(); - if (blocks.isEmpty()) { - return null; - } - return blocks.get(random.nextInt(blocks.size())).defaultBlockState(); - } - private boolean isNotExcluded(BlockState state) { for (StateIngredient exclude : excludes) { if (exclude.test(state)) { diff --git a/Xplat/src/main/java/vazkii/botania/common/crafting/TagStateIngredient.java b/Xplat/src/main/java/vazkii/botania/common/crafting/TagStateIngredient.java index 53e63d4a0b..d35acb45e2 100644 --- a/Xplat/src/main/java/vazkii/botania/common/crafting/TagStateIngredient.java +++ b/Xplat/src/main/java/vazkii/botania/common/crafting/TagStateIngredient.java @@ -49,11 +49,11 @@ public boolean test(BlockState state) { @Override public BlockState pick(RandomSource random) { - var values = resolve().toList(); - if (values.isEmpty()) { + var blocks = getBlocks(); + if (blocks.isEmpty()) { return null; } - return values.get(random.nextInt(values.size())).defaultBlockState(); + return blocks.get(random.nextInt(blocks.size())).defaultBlockState(); } @Override