Class EntityObject

java.lang.Object
com.saicone.rtag.entity.EntityObject

public class EntityObject extends Object
Class to invoke Entity methods across versions.
  • Method Details

    • isMinecraftEntity

      public static boolean isMinecraftEntity(Object object)
      Check if the provided object is instance of Minecraft Entity.
      Parameters:
      object - the object to check.
      Returns:
      true if the object is an instance of Minecraft Entity.
    • isCraftEntity

      public static boolean isCraftEntity(Object object)
      Check if the provided object is instance of CraftEntity.
      Parameters:
      object - the object to check.
      Returns:
      true if the object is an instance of CraftEntity.
    • getEntity

      public static Entity getEntity(Object entity) throws IllegalArgumentException
      Get provided Minecraft Entity as Bukkit Entity.
      Parameters:
      entity - Entity to convert.
      Returns:
      A Bukkit Entity.
      Throws:
      IllegalArgumentException - if entity is not a Minecraft Entity.
    • getHandle

      public static Object getHandle(Entity entity)
      Get provided Bukkit Entity as Minecraft Entity.
      Parameters:
      entity - Entity to convert.
      Returns:
      A Minecraft Entity.
    • save

      public static Object save(Object entity)
      Save current NBTTagCompound into new one entity.
      Parameters:
      entity - Entity instance.
      Returns:
      A NBTTagCompound that represent the tile.
    • load

      public static void load(Object entity, Object tag)
      Load NBTTagCompound into entity.
      Parameters:
      entity - Entity instance.
      tag - The NBTTagCompound to load.