mirror of
https://github.com/BentoBoxWorld/Limits.git
synced 2024-11-22 10:36:11 +01:00
Entity limiting was happening in BentoBox worlds not specified in config
This commit is contained in:
parent
a730daf6a8
commit
dc4efb2a0c
@ -170,6 +170,9 @@ public class BlockLimitsListener implements Listener {
|
||||
}
|
||||
|
||||
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())) {
|
||||
|
@ -71,7 +71,8 @@ public class EntityLimitListener implements Listener {
|
||||
@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())) {
|
||||
@ -116,7 +117,7 @@ public class EntityLimitListener implements Listener {
|
||||
@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())) {
|
||||
@ -176,6 +177,9 @@ public class EntityLimitListener implements Listener {
|
||||
*/
|
||||
@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 -> {
|
||||
|
Loading…
Reference in New Issue
Block a user