diff --git a/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/combat/Burrow.java b/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/combat/Burrow.java index 808fe611d..25c135cee 100755 --- a/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/combat/Burrow.java +++ b/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/combat/Burrow.java @@ -1,6 +1,7 @@ package me.moomoo.anarchyexploitfixes.modules.combat; import com.cryptomorin.xseries.XMaterial; +import com.cryptomorin.xseries.XTag; import me.moomoo.anarchyexploitfixes.AnarchyExploitFixes; import me.moomoo.anarchyexploitfixes.config.Config; import me.moomoo.anarchyexploitfixes.modules.AnarchyExploitFixesModule; @@ -22,23 +23,23 @@ public class Burrow implements AnarchyExploitFixesModule, Listener { + private final HashSet ANVILS, SINK_IN_BLOCKS, SLAB_LIKE; + private final Material AIR, SAND, GRAVEL, DIRT, ENCHANTING_TABLE, ENDER_CHEST, BEDROCK, BEACON; private final double damageWhenMovingInBurrow; private final boolean shouldTeleportUp, preventIfBlockAboveBurrow, breakAnvilInsteadOfTP, allowSlabs; - private final HashSet SINK_IN_BLOCKS, ANVILS, SLAB_LIKE; - private final Material AIR, SAND, GRAVEL, DIRT, ENCHANTING_TABLE, ENDER_CHEST, BEDROCK, BEACON; public Burrow() { shouldEnable(); + // Anvils + this.ANVILS = XTag.ANVIL.getValues().stream() + .filter(XMaterial::isSupported) + .map(XMaterial::parseMaterial) + .collect(Collectors.toCollection(HashSet::new)); // Blocks that the player gets lowered into slightly when walking on them this.SINK_IN_BLOCKS = new HashSet<>(3); this.SINK_IN_BLOCKS.add(XMaterial.SOUL_SAND.parseMaterial()); this.SINK_IN_BLOCKS.add(XMaterial.FARMLAND.parseMaterial()); this.SINK_IN_BLOCKS.add(XMaterial.MUD.parseMaterial()); - // Anvils - this.ANVILS = new HashSet<>(3); - this.ANVILS.add(XMaterial.ANVIL.parseMaterial()); - this.ANVILS.add(XMaterial.CHIPPED_ANVIL.parseMaterial()); - this.ANVILS.add(XMaterial.DAMAGED_ANVIL.parseMaterial()); // All slabs and slab-like blocks this.SLAB_LIKE = new HashSet<>(); this.SLAB_LIKE.addAll(Arrays.stream(XMaterial.values()) @@ -153,4 +154,4 @@ private void onPlayerMove(PlayerMoveEvent event) { } } } -} +} \ No newline at end of file