mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-10 10:28:21 +01:00
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:
parent
21fed6ebfe
commit
9b1d61659b
@ -2,7 +2,6 @@ package world.bentobox.bentobox.listeners.flags.protection;
|
|||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.entity.AbstractArrow;
|
import org.bukkit.entity.AbstractArrow;
|
||||||
import org.bukkit.entity.ArmorStand;
|
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.hanging.HangingBreakByEntityEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||||
import org.bukkit.util.BlockIterator;
|
|
||||||
|
|
||||||
import world.bentobox.bentobox.api.flags.FlagListener;
|
import world.bentobox.bentobox.api.flags.FlagListener;
|
||||||
import world.bentobox.bentobox.lists.Flags;
|
import world.bentobox.bentobox.lists.Flags;
|
||||||
@ -68,21 +66,6 @@ public class BreakBlocksListener extends FlagListener {
|
|||||||
if (!e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
|
if (!e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
|
||||||
return;
|
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()) {
|
switch (e.getClickedBlock().getType()) {
|
||||||
case CAKE:
|
case CAKE:
|
||||||
checkIsland(e, e.getPlayer(), e.getClickedBlock().getLocation(), Flags.BREAK_BLOCKS);
|
checkIsland(e, e.getPlayer(), e.getClickedBlock().getLocation(), Flags.BREAK_BLOCKS);
|
||||||
|
Loading…
Reference in New Issue
Block a user