From 33d16d16e2b77aed6816b6802331080de38a6a37 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 12 Sep 2020 07:42:46 -0700 Subject: [PATCH] Add special handling for armor stands for jetsminions https://github.com/BentoBoxWorld/Limits/issues/99 --- .../bentobox/limits/listeners/EntityLimitListener.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/world/bentobox/limits/listeners/EntityLimitListener.java b/src/main/java/world/bentobox/limits/listeners/EntityLimitListener.java index c90eec0..5f21249 100644 --- a/src/main/java/world/bentobox/limits/listeners/EntityLimitListener.java +++ b/src/main/java/world/bentobox/limits/listeners/EntityLimitListener.java @@ -42,6 +42,7 @@ public class EntityLimitListener implements Listener { private static final String MOD_BYPASS = "mod.bypass"; private final Limits addon; private final List justSpawned = new ArrayList<>(); + private final boolean jetsMinions; private static final List CARDINALS; static { List cardinals = new ArrayList<>(); @@ -61,6 +62,8 @@ public class EntityLimitListener implements Listener { public EntityLimitListener(Limits addon) { this.addon = addon; justSpawned.clear(); + // Check for JetsMinions + jetsMinions = Bukkit.getPluginManager().getPlugin("JetsMinions") != null; } /** @@ -143,6 +146,12 @@ public void onCreatureSpawn(final CreatureSpawnEvent e) { break; } // Some checks can be done async, some not + // Special handling for JetsMinions + if (jetsMinions && e.getEntityType().equals(EntityType.ARMOR_STAND)) { + // Check limit sync + checkLimit(e, e.getEntity(), e.getSpawnReason(), bypass, false); + return; + } switch (e.getSpawnReason()) { case BEEHIVE: case BREEDING: