Skip to content

Commit

Permalink
Entity limiting was happening in BentoBox worlds not specified in config
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Feb 22, 2021
1 parent a730daf commit dc4efb2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ public void onTurtleEggBreak(PlayerInteractEvent e) {
}

private void handleBreak(Event e, Block b) {
if (!addon.inGameModeWorld(b.getWorld())) {
return;
}
Material mat = b.getType();
// Check for stackable plants
if (STACKABLE.contains(b.getType())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public EntityLimitListener(Limits addon) {
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onMinecart(VehicleCreateEvent e) {
// Return if not in a known world
if (!addon.getPlugin().getIWM().inWorld(e.getVehicle().getWorld())) {

if (!addon.inGameModeWorld(e.getVehicle().getWorld())) {
return;
}
if (justSpawned.contains(e.getVehicle().getUniqueId())) {
Expand Down Expand Up @@ -116,7 +117,7 @@ public void onMinecart(VehicleCreateEvent e) {
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onCreatureSpawn(final CreatureSpawnEvent e) {
// Return if not in a known world
if (!addon.getPlugin().getIWM().inWorld(e.getLocation())) {
if (!addon.inGameModeWorld(e.getLocation().getWorld())) {
return;
}
if (justSpawned.contains(e.getEntity().getUniqueId())) {
Expand Down Expand Up @@ -176,6 +177,9 @@ private boolean checkByPass(Location l) {
*/
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlock(HangingPlaceEvent e) {
if (!addon.inGameModeWorld(e.getBlock().getWorld())) {
return;
}
Player player = e.getPlayer();
if (player == null) return;
addon.getIslands().getIslandAt(e.getEntity().getLocation()).ifPresent(island -> {
Expand Down

0 comments on commit dc4efb2

Please sign in to comment.