diff --git a/Xplat/src/generated/resources/.cache/bfa01a6ca2555c100103725bf5c9e6da285f29c3 b/Xplat/src/generated/resources/.cache/bfa01a6ca2555c100103725bf5c9e6da285f29c3 index e8db96fb66..5132fcce37 100644 --- a/Xplat/src/generated/resources/.cache/bfa01a6ca2555c100103725bf5c9e6da285f29c3 +++ b/Xplat/src/generated/resources/.cache/bfa01a6ca2555c100103725bf5c9e6da285f29c3 @@ -14,6 +14,7 @@ fd641d7d435b45d25d316ea4c8e3d56876c5be98 data/botania/tags/blocks/glimmering_dre 8e451b134ff39f5e8b63661051926f2790fefd7c data/botania/tags/blocks/glimmering_livingwood_logs.json c9a0fa2b480198219c3eaf0a6232213c6a8fed16 data/botania/tags/blocks/horn_of_the_canopy_breakable.json 5b7ef7e84e647b2340b20105a638d804a739b213 data/botania/tags/blocks/horn_of_the_covering_breakable.json +7d84bfb33c08ac8a946d43d59675844ff8efa5a1 data/botania/tags/blocks/horn_of_the_wild_breakable.json 8a23702b05296c8af5014d6aa6e9265ded85c7d9 data/botania/tags/blocks/laputa_immobile.json bbb827430199d1a6f3b27fc25e2df941f22dc660 data/botania/tags/blocks/livingwood_logs.json 687fe87bd07caccd697ec50eee72fa5b48d3fd37 data/botania/tags/blocks/magnet_ring_blacklist.json diff --git a/Xplat/src/generated/resources/data/botania/tags/blocks/horn_of_the_wild_breakable.json b/Xplat/src/generated/resources/data/botania/tags/blocks/horn_of_the_wild_breakable.json new file mode 100644 index 0000000000..4f9583cd97 --- /dev/null +++ b/Xplat/src/generated/resources/data/botania/tags/blocks/horn_of_the_wild_breakable.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:moss_carpet" + ] +} \ No newline at end of file diff --git a/Xplat/src/main/java/vazkii/botania/common/item/HornItem.java b/Xplat/src/main/java/vazkii/botania/common/item/HornItem.java index 435e71d1c6..630243e2a9 100644 --- a/Xplat/src/main/java/vazkii/botania/common/item/HornItem.java +++ b/Xplat/src/main/java/vazkii/botania/common/item/HornItem.java @@ -78,23 +78,14 @@ private static boolean canHarvest(Level level, ItemStack stack, BlockPos pos, HornHarvestable harvestable = XplatAbstractions.INSTANCE.findHornHarvestable(level, pos, state, be); if (harvestable != null) { return harvestable.canHornHarvest(level, pos, stack, type, user); - } else { - switch (type) { - default: - case WILD: - return state.getBlock() instanceof BushBlock && !state.is(BotaniaTags.Blocks.SPECIAL_FLOWERS); - case CANOPY: { - if (state.getBlock() instanceof LeavesBlock - && state.getValue(LeavesBlock.PERSISTENT)) { - return false; - } - - return state.is(BotaniaTags.Blocks.HORN_OF_THE_CANOPY_BREAKABLE); - } - case COVERING: - return state.is(BotaniaTags.Blocks.HORN_OF_THE_COVERING_BREAKABLE); - } } + return switch (type) { + default -> state.getBlock() instanceof BushBlock && !state.is(BotaniaTags.Blocks.SPECIAL_FLOWERS) + || state.is(BotaniaTags.Blocks.HORN_OF_THE_WILD_BREAKABLE); + case CANOPY -> state.is(BotaniaTags.Blocks.HORN_OF_THE_CANOPY_BREAKABLE) + && !(state.getBlock() instanceof LeavesBlock && state.getValue(LeavesBlock.PERSISTENT)); + case COVERING -> state.is(BotaniaTags.Blocks.HORN_OF_THE_COVERING_BREAKABLE); + }; } public static void breakGrass(Level world, ItemStack stack, BlockPos srcPos, @Nullable LivingEntity user) { diff --git a/Xplat/src/main/java/vazkii/botania/common/lib/BotaniaTags.java b/Xplat/src/main/java/vazkii/botania/common/lib/BotaniaTags.java index 1ca5b32146..0ca18abd17 100644 --- a/Xplat/src/main/java/vazkii/botania/common/lib/BotaniaTags.java +++ b/Xplat/src/main/java/vazkii/botania/common/lib/BotaniaTags.java @@ -216,6 +216,12 @@ public static class Blocks { */ public static final TagKey WEIGHT_LENS_WHITELIST = tag("weight_lens_whitelist"); + /** + * Blocks in this tag can be broken by the Horn of the Wild, + * in addition to any {@code BushBlock}s that are not part of the {@link #SPECIAL_FLOWERS} tag. + */ + public static final TagKey HORN_OF_THE_WILD_BREAKABLE = tag("horn_of_the_wild_breakable"); + /** * Blocks in this tag can be broken by the Horn of the Canopy */ diff --git a/Xplat/src/main/java/vazkii/botania/data/BlockTagProvider.java b/Xplat/src/main/java/vazkii/botania/data/BlockTagProvider.java index d4bede260e..976e86544a 100644 --- a/Xplat/src/main/java/vazkii/botania/data/BlockTagProvider.java +++ b/Xplat/src/main/java/vazkii/botania/data/BlockTagProvider.java @@ -200,6 +200,8 @@ protected void addTags(HolderLookup.Provider provider) { BotaniaBlocks.biomeCobblestoneFungal, BotaniaBlocks.biomeCobblestoneFungalSlab, BotaniaBlocks.biomeCobblestoneFungalStairs, BotaniaBlocks.biomeCobblestoneFungalWall, BotaniaBlocks.biomeChiseledBrickFungal, fungalAltar); + tag(BotaniaTags.Blocks.HORN_OF_THE_WILD_BREAKABLE).add(Blocks.MOSS_CARPET); + tag(BlockTags.LEAVES); tag(BotaniaTags.Blocks.HORN_OF_THE_CANOPY_BREAKABLE).addTag(BlockTags.LEAVES);