Removes unneeded exploit protection code for skulls (#1810)

This no longer seems to be required with 1.17.1

https://github.com/BentoBoxWorld/BSkyBlock/issues/430
This commit is contained in:
tastybento 2021-07-24 12:27:35 -07:00 committed by GitHub
parent 21fed6ebfe
commit 9b1d61659b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@ package world.bentobox.bentobox.listeners.flags.protection;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.entity.AbstractArrow;
import org.bukkit.entity.ArmorStand;
@ -20,7 +19,6 @@ import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.vehicle.VehicleDamageEvent;
import org.bukkit.util.BlockIterator;
import world.bentobox.bentobox.api.flags.FlagListener;
import world.bentobox.bentobox.lists.Flags;
@ -68,21 +66,6 @@ public class BreakBlocksListener extends FlagListener {
if (!e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
return;
}
// Look along player's sight line to see if any blocks are skulls
try {
BlockIterator iterator = new BlockIterator(e.getPlayer(), 10);
while (iterator.hasNext()) {
Block lastBlock = iterator.next();
if (lastBlock.getType().toString().endsWith("_SKULL") || (lastBlock.getType().toString().endsWith("_HEAD") && !lastBlock.getType().equals(Material.PISTON_HEAD))) {
checkIsland(e, e.getPlayer(), lastBlock.getLocation(), Flags.BREAK_BLOCKS);
return;
}
}
} catch (Exception ignored) {
// We can ignore this exception
}
switch (e.getClickedBlock().getType()) {
case CAKE:
checkIsland(e, e.getPlayer(), e.getClickedBlock().getLocation(), Flags.BREAK_BLOCKS);