Class AirSaver

java.lang.Object
com.pixelmonmod.pixelmon.api.util.AirSaver

public class AirSaver extends Object
Static utility class for managing air supply for entities to prevent them from drowning.
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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 of
      air - 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)