diff --git a/gradle.properties b/gradle.properties index 052f271..ef4b196 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G loader_version=0.8.8+build.202 # Mod Properties - mod_version = 1.16.1.1 + mod_version = 1.16.1.2 maven_group = de.jottyfan.minecraft archives_base_name = quickiefabric diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeable.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeable.java index 5936d04..d086768 100644 --- a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeable.java +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeable.java @@ -17,28 +17,27 @@ import net.minecraft.block.Blocks; * */ public interface ToolRangeable { - public static final Set SHOVEL_EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.GRAVEL, Blocks.SAND, - Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.CLAY, Blocks.FARMLAND, Blocks.GRASS_PATH, Blocks.RED_SAND, Blocks.SOUL_SAND }); + public static final Set SHOVEL_EFFECTIVE_ON = Sets + .newHashSet(new Block[] { Blocks.GRAVEL, Blocks.SAND, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.CLAY, Blocks.FARMLAND, Blocks.GRASS_PATH, Blocks.RED_SAND, Blocks.SOUL_SAND }); - public static final List> AXE_EFFECTIVE_ON = Lists.newArrayList( - Arrays.asList(Blocks.ACACIA_LOG, Blocks.STRIPPED_ACACIA_LOG, Blocks.ACACIA_WOOD, Blocks.STRIPPED_ACACIA_WOOD), + public static final List> AXE_EFFECTIVE_ON = Lists.newArrayList(Arrays.asList(Blocks.ACACIA_LOG, Blocks.STRIPPED_ACACIA_LOG, Blocks.ACACIA_WOOD, Blocks.STRIPPED_ACACIA_WOOD), Arrays.asList(Blocks.BIRCH_LOG, Blocks.STRIPPED_BIRCH_LOG, Blocks.BIRCH_WOOD, Blocks.STRIPPED_BIRCH_WOOD), - Arrays.asList(Blocks.DARK_OAK_LOG, Blocks.STRIPPED_DARK_OAK_LOG, Blocks.DARK_OAK_WOOD, - Blocks.STRIPPED_DARK_OAK_WOOD), + Arrays.asList(Blocks.DARK_OAK_LOG, Blocks.STRIPPED_DARK_OAK_LOG, Blocks.DARK_OAK_WOOD, Blocks.STRIPPED_DARK_OAK_WOOD), Arrays.asList(Blocks.JUNGLE_LOG, Blocks.STRIPPED_JUNGLE_LOG, Blocks.JUNGLE_WOOD, Blocks.STRIPPED_JUNGLE_WOOD), Arrays.asList(Blocks.OAK_LOG, Blocks.STRIPPED_OAK_LOG, Blocks.OAK_WOOD, Blocks.STRIPPED_OAK_WOOD), - Arrays.asList(Blocks.SPRUCE_LOG, Blocks.STRIPPED_SPRUCE_LOG, Blocks.SPRUCE_WOOD, Blocks.STRIPPED_SPRUCE_WOOD), - Arrays.asList(Blocks.ACACIA_PLANKS), Arrays.asList(Blocks.BIRCH_PLANKS), Arrays.asList(Blocks.DARK_OAK_PLANKS), - Arrays.asList(Blocks.JUNGLE_PLANKS), Arrays.asList(Blocks.OAK_PLANKS), Arrays.asList(Blocks.SPRUCE_PLANKS), - Arrays.asList(Blocks.ACACIA_SLAB), Arrays.asList(Blocks.BIRCH_SLAB), Arrays.asList(Blocks.DARK_OAK_SLAB), - Arrays.asList(Blocks.JUNGLE_SLAB), Arrays.asList(Blocks.OAK_SLAB), Arrays.asList(Blocks.SPRUCE_SLAB), - Arrays.asList(Blocks.ACACIA_STAIRS), Arrays.asList(Blocks.BIRCH_STAIRS), Arrays.asList(Blocks.DARK_OAK_STAIRS), - Arrays.asList(Blocks.JUNGLE_STAIRS), Arrays.asList(Blocks.OAK_STAIRS), Arrays.asList(Blocks.SPRUCE_STAIRS), - Arrays.asList(Blocks.POTTED_BROWN_MUSHROOM, Blocks.BROWN_MUSHROOM_BLOCK, Blocks.BROWN_MUSHROOM, - Blocks.MUSHROOM_STEM), + Arrays.asList(Blocks.SPRUCE_LOG, Blocks.STRIPPED_SPRUCE_LOG, Blocks.SPRUCE_WOOD, Blocks.STRIPPED_SPRUCE_WOOD), Arrays.asList(Blocks.ACACIA_PLANKS), Arrays.asList(Blocks.BIRCH_PLANKS), + Arrays.asList(Blocks.DARK_OAK_PLANKS), Arrays.asList(Blocks.JUNGLE_PLANKS), Arrays.asList(Blocks.OAK_PLANKS), Arrays.asList(Blocks.SPRUCE_PLANKS), Arrays.asList(Blocks.ACACIA_SLAB), + Arrays.asList(Blocks.BIRCH_SLAB), Arrays.asList(Blocks.DARK_OAK_SLAB), Arrays.asList(Blocks.JUNGLE_SLAB), Arrays.asList(Blocks.OAK_SLAB), Arrays.asList(Blocks.SPRUCE_SLAB), + Arrays.asList(Blocks.ACACIA_STAIRS), Arrays.asList(Blocks.BIRCH_STAIRS), Arrays.asList(Blocks.DARK_OAK_STAIRS), Arrays.asList(Blocks.JUNGLE_STAIRS), Arrays.asList(Blocks.OAK_STAIRS), + Arrays.asList(Blocks.SPRUCE_STAIRS), Arrays.asList(Blocks.POTTED_BROWN_MUSHROOM, Blocks.BROWN_MUSHROOM_BLOCK, Blocks.BROWN_MUSHROOM, Blocks.MUSHROOM_STEM), Arrays.asList(Blocks.POTTED_RED_MUSHROOM, Blocks.RED_MUSHROOM_BLOCK, Blocks.RED_MUSHROOM, Blocks.MUSHROOM_STEM)); - - public static final Set PICKAXE_EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.GLOWSTONE}); + + public static final List AXE_EFFECTIVE_ON_EXTERNAL = Lists.newArrayList("terrestia:redwood", "terrestia:hemlock", "terrestia:rubber", "terrestia:cypress", "terrestia:willow", + "terrestia:japanese_maple", "terrestia:rainbow_eucalyptus", "terrestia:sakura", "terrestia:yucca_palm", "byg:aspen_log", "byg:baobab_log", "byg:blue_enchanted_log", "byg:cherry_log", + "byg:cika_log", "byg:cypress_log", "byg:ebony_log", "byg:fir_log", "byg:green_enchanted_log", "byg:holly_log", "byg:jacaranda_log", "byg:mahogany_log", "byg:mangrove_log", "byg:maple_log", + "byg:palo_verde_log", "byg:pine_log", "byg:rainbow_eucalyptus_log", "byg:redwood_log", "byg:skyris_log", "byg:willow_log", "byg:witch_hazel_log", "byg:zelkova_log"); + + public static final Set PICKAXE_EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.GLOWSTONE }); /** * @return range of blocks to be harvested @@ -46,8 +45,7 @@ public interface ToolRangeable { public HarvestRange getRange(); /** - * check if this block state is one that affects the neighbor blocks to break - * also if they are from the same type + * check if this block state is one that affects the neighbor blocks to break also if they are from the same type * * @param blockState * the block state of the current block diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java index 7cca2ec..4bbb588 100644 --- a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java @@ -2,11 +2,15 @@ package de.jottyfan.minecraft.quickiefabric.tools; import java.util.List; +import com.google.common.collect.Lists; + import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.AxeItem; import net.minecraft.item.ItemStack; import net.minecraft.item.ToolMaterial; +import net.minecraft.util.Identifier; +import net.minecraft.util.registry.Registry; /** * @@ -41,6 +45,13 @@ public class ToolRangeableAxe extends AxeItem implements ToolRangeable { return blockList; } } + for (String externalBlockName : AXE_EFFECTIVE_ON_EXTERNAL) { + Identifier id = new Identifier(externalBlockName); + Block registeredBlock = Registry.BLOCK.get(id); // may be null if mods are not available + if (registeredBlock != null && registeredBlock.equals(block)) { + return Lists.newArrayList(block); + } + } return null; } }