current block breaknig method does not allow for control over not breaking blocks tool is not effective for

This commit is contained in:
2026-09-27 22:07:02 +02:00
parent 542b95caff
commit bd4d4bb80b
@@ -25,7 +25,6 @@ public class TunnellingEnchant implements EnchantioEnchant {
public static final Key AFFECTED_BLOCKS_KEY = Key.key("enchantio", "affected_by_tunnelling"); public static final Key AFFECTED_BLOCKS_KEY = Key.key("enchantio", "affected_by_tunnelling");
private final int anvilCost, weight, maxLevel, blocksPerLevel; private final int anvilCost, weight, maxLevel, blocksPerLevel;
private final boolean canBreakToolIncompatibleBlocks;
private final EnchantmentRegistryEntry.EnchantmentCost minimumCost; private final EnchantmentRegistryEntry.EnchantmentCost minimumCost;
private final EnchantmentRegistryEntry.EnchantmentCost maximumCost; private final EnchantmentRegistryEntry.EnchantmentCost maximumCost;
private final Set<TagEntry<ItemType>> supportedItemTags = new HashSet<>(); private final Set<TagEntry<ItemType>> supportedItemTags = new HashSet<>();
@@ -41,8 +40,7 @@ public class TunnellingEnchant implements EnchantioEnchant {
Collection<TagEntry<ItemType>> supportedItemTags, Collection<TagEntry<ItemType>> supportedItemTags,
Map<Key, Set<TagEntry<BlockType>>> affectedBlockTags, Map<Key, Set<TagEntry<BlockType>>> affectedBlockTags,
int maxLevel, int maxLevel,
int blocksPerLevel, int blocksPerLevel
boolean canBreakToolIncompatibleBlocks
) { ) {
this.anvilCost = anvilCost; this.anvilCost = anvilCost;
this.weight = weight; this.weight = weight;
@@ -50,7 +48,6 @@ public class TunnellingEnchant implements EnchantioEnchant {
this.maximumCost = maximumCost; this.maximumCost = maximumCost;
this.maxLevel = maxLevel; this.maxLevel = maxLevel;
this.blocksPerLevel = blocksPerLevel; this.blocksPerLevel = blocksPerLevel;
this.canBreakToolIncompatibleBlocks = canBreakToolIncompatibleBlocks;
this.supportedItemTags.addAll(supportedItemTags); this.supportedItemTags.addAll(supportedItemTags);
this.enchantTagKeys.addAll(enchantTagKeys); this.enchantTagKeys.addAll(enchantTagKeys);
this.affectedBlockTags.putAll(affectedBlockTags); this.affectedBlockTags.putAll(affectedBlockTags);
@@ -115,10 +112,6 @@ public class TunnellingEnchant implements EnchantioEnchant {
return blocksPerLevel; return blocksPerLevel;
} }
public boolean canBreakToolIncompatibleBlocks() {
return canBreakToolIncompatibleBlocks;
}
public static TunnellingEnchant create(ConfigurationSection configurationSection) { public static TunnellingEnchant create(ConfigurationSection configurationSection) {
TunnellingEnchant tunnellingEnchant = new TunnellingEnchant( TunnellingEnchant tunnellingEnchant = new TunnellingEnchant(
EnchantioConfig.getInt(configurationSection, "anvilCost", 1), EnchantioConfig.getInt(configurationSection, "anvilCost", 1),
@@ -161,8 +154,7 @@ public class TunnellingEnchant implements EnchantioEnchant {
)) ))
), ),
EnchantioConfig.getInt(configurationSection, "maxLevel", 1), EnchantioConfig.getInt(configurationSection, "maxLevel", 1),
EnchantioConfig.getInt(configurationSection, "blocksPerLevel", 1), EnchantioConfig.getInt(configurationSection, "blocksPerLevel", 1)
EnchantioConfig.getBoolean(configurationSection, "canBreakToolIncompatibleBlocks", false)
); );
if (EnchantioConfig.getBoolean(configurationSection, "enabled", true)) { if (EnchantioConfig.getBoolean(configurationSection, "enabled", true)) {