mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-09-27 14:12:59 +02:00
Flying entity exemption.
This commit is contained in:
parent
18bb91af3e
commit
d5e98a98b7
@ -67,6 +67,7 @@ public class StackingTask extends BukkitRunnable {
|
||||
&& initalEntity.getMetadata("US_REASON").get(0).asString().equals("SPAWNER"))
|
||||
|
||||
|| Setting.ONLY_STACK_ON_SURFACE.getBoolean()
|
||||
&& !canFly(initalEntity)
|
||||
&& (!initalEntity.isOnGround() && !initalEntity.getLocation().getBlock().isLiquid()))
|
||||
continue;
|
||||
|
||||
@ -134,4 +135,15 @@ public class StackingTask extends BukkitRunnable {
|
||||
removed.clear();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canFly(LivingEntity entity) {
|
||||
switch (entity.getType()) {
|
||||
case GHAST:
|
||||
case BLAZE:
|
||||
case PHANTOM:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public enum Setting {
|
||||
|
||||
ONLY_STACK_ON_SURFACE("Entities.Only Stack On Surface", false,
|
||||
"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,
|
||||
"Should items be stacked?"),
|
||||
|
Loading…
Reference in New Issue
Block a user