Merge branch 'develop' of https://github.com/BentoBoxWorld/Limits.git into develop

This commit is contained in:
tastybento 2019-08-11 12:41:01 -07:00
commit 62ce0cebae
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,6 @@
# Limits # Limits
[![Build Status](https://ci.codemc.org/buildStatus/icon?job=BentoBoxWorld/Limits)](https://ci.codemc.org/job/BentoBoxWorld/job/Limits/)
Add-on for BentoBox to limit island blocks and entities in GameModes like BSkyBlock and AcidIsland. This add-on will work Add-on for BentoBox to limit island blocks and entities in GameModes like BSkyBlock and AcidIsland. This add-on will work
in any game mode world. in any game mode world.

View File

@ -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