Flying entity exemption.

This commit is contained in:
Brianna 2019-06-22 20:10:22 -04:00
parent 18bb91af3e
commit d5e98a98b7
2 changed files with 13 additions and 1 deletions

View File

@ -67,6 +67,7 @@ public class StackingTask extends BukkitRunnable {
&& initalEntity.getMetadata("US_REASON").get(0).asString().equals("SPAWNER")) && initalEntity.getMetadata("US_REASON").get(0).asString().equals("SPAWNER"))
|| Setting.ONLY_STACK_ON_SURFACE.getBoolean() || Setting.ONLY_STACK_ON_SURFACE.getBoolean()
&& !canFly(initalEntity)
&& (!initalEntity.isOnGround() && !initalEntity.getLocation().getBlock().isLiquid())) && (!initalEntity.isOnGround() && !initalEntity.getLocation().getBlock().isLiquid()))
continue; continue;
@ -134,4 +135,15 @@ public class StackingTask extends BukkitRunnable {
removed.clear(); removed.clear();
} }
} }
private boolean canFly(LivingEntity entity) {
switch (entity.getType()) {
case GHAST:
case BLAZE:
case PHANTOM:
return true;
default:
return false;
}
}
} }

View File

@ -93,7 +93,7 @@ public enum Setting {
ONLY_STACK_ON_SURFACE("Entities.Only Stack On Surface", false, ONLY_STACK_ON_SURFACE("Entities.Only Stack On Surface", false,
"Should entities only be stacked if they are touching the ground", "Should entities only be stacked if they are touching the ground",
"or swimming?"), "or swimming? This does not effect flying entities."),
STACK_ITEMS("Items.Enabled",true, STACK_ITEMS("Items.Enabled",true,
"Should items be stacked?"), "Should items be stacked?"),