Skip to content

Commit

Permalink
Fix for HangingPlaceEvent error
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Aug 9, 2019
1 parent 03e51fc commit 078376f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@ private boolean checkByPass(Location l) {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlock(HangingPlaceEvent e) {
Player player = e.getPlayer();
boolean bypass = player.isOp() || player.hasPermission(addon.getPlugin().getIWM().getPermissionPrefix(e.getEntity().getWorld()) + "mod.bypass");

addon.getIslands().getIslandAt(e.getEntity().getLocation()).ifPresent(island -> {
boolean bypass = player.isOp() || player.hasPermission(addon.getPlugin().getIWM().getPermissionPrefix(e.getEntity().getWorld()) + "mod.bypass");
// Check if entity can be hung
if (!island.isSpawn() && atLimit(island, bypass, e.getEntity())) {
// Not allowed
Expand Down

0 comments on commit 078376f

Please sign in to comment.