Updated block breaking

This commit is contained in:
Auxilor 2022-03-15 13:09:22 +00:00
parent dc66408d3d
commit cd91978a63
3 changed files with 4 additions and 10 deletions

View File

@ -2,7 +2,6 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.core.integrations.anticheat.AnticheatManager;
import com.willfp.eco.core.integrations.antigrief.AntigriefManager;
import com.willfp.eco.util.BlockUtils;
import com.willfp.eco.util.VectorUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
@ -64,7 +63,7 @@ public class Drill extends EcoEnchant {
continue;
}
BlockUtils.breakBlock(player, block1);
player.breakBlock(block1);
block1.removeMetadata("block-ignore", this.getPlugin());
}

View File

@ -2,9 +2,9 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.spell;
import com.willfp.eco.core.integrations.anticheat.AnticheatManager;
import com.willfp.eco.core.integrations.antigrief.AntigriefManager;
import com.willfp.eco.util.BlockUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.itemtypes.Spell;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import org.bukkit.Particle;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
@ -72,11 +72,7 @@ public class Dynamite extends Spell {
}
}
toBreak.forEach((block1 -> {
block1.setMetadata("block-ignore", this.getPlugin().getMetadataValueFactory().create(true));
BlockUtils.breakBlock(player, block1);
block1.removeMetadata("block-ignore", this.getPlugin());
}));
EnchantmentUtils.rehandleBreaking(player, toBreak, this.getPlugin());
AnticheatManager.unexemptPlayer(player);

View File

@ -3,7 +3,6 @@ package com.willfp.ecoenchants.enchantments.util;
import com.willfp.eco.core.EcoPlugin;
import com.willfp.eco.core.integrations.placeholder.PlaceholderManager;
import com.willfp.eco.core.placeholder.PlayerPlaceholder;
import com.willfp.eco.util.BlockUtils;
import com.willfp.eco.util.NumberUtils;
import com.willfp.eco.util.StringUtils;
import com.willfp.ecoenchants.EcoEnchantsPlugin;
@ -185,7 +184,7 @@ public class EnchantmentUtils {
@NotNull final EcoPlugin plugin) {
for (Block block : toBreak) {
block.setMetadata("block-ignore", plugin.getMetadataValueFactory().create(true));
BlockUtils.breakBlock(player, block);
player.breakBlock(block);
block.removeMetadata("block-ignore", plugin);
}
}