use of org.bukkit.event.entity.EntityAirChangeEvent in project Glowstone by GlowstoneMC.
the class GlowLivingEntity method setRemainingAir.
@Override
public void setRemainingAir(int ticks) {
ticks = Math.min(ticks, maximumAir);
if (ticks == remainingAir) {
return;
}
EntityAirChangeEvent event = EventFactory.getInstance().callEvent(new EntityAirChangeEvent(this, remainingAir));
if (event.isCancelled()) {
return;
}
remainingAir = event.getAmount();
}
Aggregations