mirror of
https://github.com/BentoBoxWorld/Limits.git
synced 2024-09-27 14:12:57 +02:00
Fix for HangingPlaceEvent error
https://github.com/BentoBoxWorld/Limits/issues/36
This commit is contained in:
parent
03e51fc0f8
commit
078376f184
@ -119,9 +119,8 @@ public class EntityLimitListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onBlock(HangingPlaceEvent e) {
|
public void onBlock(HangingPlaceEvent e) {
|
||||||
Player player = e.getPlayer();
|
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 -> {
|
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
|
// Check if entity can be hung
|
||||||
if (!island.isSpawn() && atLimit(island, bypass, e.getEntity())) {
|
if (!island.isSpawn() && atLimit(island, bypass, e.getEntity())) {
|
||||||
// Not allowed
|
// Not allowed
|
||||||
|
Loading…
Reference in New Issue
Block a user