Skip to content

Commit

Permalink
further improve burrow module
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Dec 27, 2023
1 parent cbb52ce commit bd46e8b
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -22,23 +23,23 @@

public class Burrow implements AnarchyExploitFixesModule, Listener {

private final HashSet<Material> 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<Material> 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())
Expand Down Expand Up @@ -153,4 +154,4 @@ private void onPlayerMove(PlayerMoveEvent event) {
}
}
}
}
}

0 comments on commit bd46e8b

Please sign in to comment.