Skip to content

Commit

Permalink
Removes unneeded exploit protection code for skulls
Browse files Browse the repository at this point in the history
This no longer seems to be required with 1.17.1

https://github.com/BentoBoxWorld/BSkyBlock/issues/430
  • Loading branch information
tastybento committed Jul 24, 2021
1 parent 21fed6e commit 84978c6
Showing 1 changed file with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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;
Expand All @@ -20,7 +19,6 @@
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;
Expand Down Expand Up @@ -68,21 +66,6 @@ public void onPlayerInteract(final PlayerInteractEvent e) {
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);
Expand Down

0 comments on commit 84978c6

Please sign in to comment.