Class MetaObject

java.lang.Object
net.risingworld.api.objects.MetaObject

public class MetaObject extends Object
Represents a meta object, which is typically any kind of processing station, e.g a furnace, grinders, cooking station etc.
  • Method Details

    • getID

      public long getID()
      Gets the global, unique ID of the object.
      Returns:
      the unique ID.
    • isValid

      public boolean isValid()
      Checks if this instance is still valid.
      Returns:
      true if the instance is valid, false if not.
    • getWorldPosition

      public Vector3f getWorldPosition()
      Gets the world position of the object.
      Returns:
      the object world position.
    • getChunkPositionX

      public int getChunkPositionX()
      Gets the x offset of the chunk (which contains the object).
      Returns:
      the x chunk offset.
    • getChunkPositionY

      public int getChunkPositionY()
      Gets the y offset of the chunk (which contains the object).
      Returns:
      the y chunk offset.
    • getChunkPositionZ

      public int getChunkPositionZ()
      Gets the z offset of the chunk (which contains the object).
      Returns:
      the z chunk offset.
    • getChunkPosition

      public Vector3i getChunkPosition()
      Gets the chunk position of the meta object.
      Returns:
      the meta object chunk coordinates.
    • getStatus

      public int getStatus()
      Gets the current status of the meta object.
      Returns:
      the meta object status.
    • setStatus

      public void setStatus(int status, boolean updateObject)
      Sets the status of the meta object. Optionally updates the actual object representation as well (recommended).
      Parameters:
      status - the new status.
      updateObject - true if you want to change the actual object representation as well, false if you only want to change the value of the meta object. For example, if you want to turn on a furnace and you set this value to false, the furnace wouldn't turn on, but it would still start smelting items.
    • requiresFuel

      public boolean requiresFuel()
      Gets whether or not this meta object requires fuel for processing (e.g a furnace).
      Returns:
      true if this object requires fuel, false if not.
    • getFuel

      public int getFuel()
      Gets the current fuel value of the meta object (only if it requires fuel).
      Returns:
      the current fuel value of the meta object.
      See Also:
    • setFuel

      public void setFuel(int fuel)
      Sets a new fuel value for the meta object. Only relevant if it requires fuel.
      Parameters:
      fuel - the new fuel value.
      See Also:
    • getRelatedObject

      public ObjectElement getRelatedObject()
      Gets the object element which represents this meta object in the world.
      Returns:
      the actual object representation in the world.