Search in sources :

Example 1 with EntityAirChangeEvent

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();
}
Also used : EntityAirChangeEvent(org.bukkit.event.entity.EntityAirChangeEvent)

Aggregations

EntityAirChangeEvent (org.bukkit.event.entity.EntityAirChangeEvent)1