Fixed bugs with adding entity perm limits.
https://github.com/BentoBoxWorld/Limits/issues/47
This commit is contained in:
parent
fb6f6757d5
commit
789b73d3b3
|
@ -105,7 +105,10 @@ public class LimitPanel {
|
|||
pb.item(pib.build());
|
||||
}
|
||||
// Entity limits
|
||||
addon.getSettings().getLimits().forEach((k,v) -> {
|
||||
Map<EntityType, Integer> map = addon.getSettings().getLimits();
|
||||
// Merge in any permission-based limits
|
||||
ibc.getEntityLimits().forEach(map::put);
|
||||
map.forEach((k,v) -> {
|
||||
PanelItemBuilder pib = new PanelItemBuilder();
|
||||
pib.name(Util.prettifyText(k.toString()));
|
||||
Material m;
|
||||
|
|
|
@ -42,7 +42,6 @@ public class EntityLimitListener implements Listener {
|
|||
if (!addon.getPlugin().getIWM().inWorld(e.getVehicle().getWorld())) {
|
||||
return;
|
||||
}
|
||||
if (addon.getSettings().getLimits().containsKey(e.getVehicle().getType())) {
|
||||
// If someone in that area has the bypass permission, allow the spawning
|
||||
for (Entity entity : Objects.requireNonNull(e.getVehicle().getLocation().getWorld()).getNearbyEntities(e.getVehicle().getLocation(), 5, 5, 5)) {
|
||||
if (entity instanceof Player) {
|
||||
|
@ -70,7 +69,6 @@ public class EntityLimitListener implements Listener {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onCreatureSpawn(final CreatureSpawnEvent e) {
|
||||
|
@ -78,10 +76,6 @@ public class EntityLimitListener implements Listener {
|
|||
if (!addon.getPlugin().getIWM().inWorld(e.getLocation())) {
|
||||
return;
|
||||
}
|
||||
if (!addon.getSettings().getLimits().containsKey(e.getEntityType())) {
|
||||
// Unknown entity limit or unlimited
|
||||
return;
|
||||
}
|
||||
boolean bypass = false;
|
||||
// Check why it was spawned
|
||||
switch (e.getSpawnReason()) {
|
||||
|
|
Loading…
Reference in New Issue