Class AirSaver
java.lang.Object
com.pixelmonmod.pixelmon.api.util.AirSaver
Static utility class for managing air supply for entities
to prevent them from drowning.
To use this class, call
To use this class, call
lock(LivingEntity)
when you want to lock the air supply
at the current level, and unlock(LivingEntity)
when you want to unlock it.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
lock
(net.minecraft.world.entity.LivingEntity entity) Locks the air supply of the entity to the current level.static void
lock
(net.minecraft.world.entity.LivingEntity entity, int air) Locks the air supply of the entity to the specified level.static void
onQuit
(net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent event) static void
onTick
(net.minecraftforge.event.TickEvent.ServerTickEvent event) static void
unlock
(net.minecraft.world.entity.LivingEntity entity) Unlocks the air supply of the entity.
-
Constructor Details
-
AirSaver
public AirSaver()
-
-
Method Details
-
lock
public static void lock(net.minecraft.world.entity.LivingEntity entity) Locks the air supply of the entity to the current level.- Parameters:
entity
- The entity to lock the air supply of
-
lock
public static void lock(net.minecraft.world.entity.LivingEntity entity, int air) Locks the air supply of the entity to the specified level.- Parameters:
entity
- The entity to lock the air supply ofair
- The air level to lock the entity's air supply to
-
unlock
public static void unlock(net.minecraft.world.entity.LivingEntity entity) Unlocks the air supply of the entity.- Parameters:
entity
- The entity to unlock the air supply of
-
onTick
public static void onTick(net.minecraftforge.event.TickEvent.ServerTickEvent event) -
onQuit
public static void onQuit(net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent event)
-