Skip to content

Commit

Permalink
Add special handling for armor stands for jetsminions
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Sep 12, 2020
1 parent 1870a30 commit 33d16d1
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class EntityLimitListener implements Listener {
private static final String MOD_BYPASS = "mod.bypass";
private final Limits addon;
private final List<UUID> justSpawned = new ArrayList<>();
private final boolean jetsMinions;
private static final List<BlockFace> CARDINALS;
static {
List<BlockFace> cardinals = new ArrayList<>();
Expand All @@ -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;
}

/**
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 33d16d1

Please sign in to comment.