Class CustomFire

java.lang.Object
dev.lone.itemsadder.api.CustomStack
dev.lone.itemsadder.api.CustomFire

public class CustomFire extends CustomStack
Wrapper for a custom fire item and its placed fire block.
  • Method Details

    • getInstance

      @Nullable public static @Nullable CustomFire getInstance(String namespacedID)
      Gets a clone of the custom fire item declared in the ItemsAdder registry.
      Parameters:
      namespacedID - the custom fire namespaced id.
      Returns:
      the custom fire wrapper, or null if it does not exist.
    • byItemStack

      @Nullable public static @Nullable CustomFire byItemStack(ItemStack itemStack)
      Gets a custom fire wrapper from an item stack.
      Parameters:
      itemStack - the item stack to read.
      Returns:
      the custom fire wrapper, or null if the item is not custom fire.
    • place

      @Nullable public static @Nullable CustomFire place(String namespacedId, Location location)
      Places custom fire in the world.
      Parameters:
      namespacedId - the custom fire namespaced id.
      location - the location where the fire will be placed.
      Returns:
      the placed custom fire wrapper, or null if the item does not exist.
    • byAlreadyPlaced

      @Nullable public static @Nullable CustomFire byAlreadyPlaced(Block block)
      Gets the custom fire wrapper for an already placed fire block.
      Parameters:
      block - the fire block.
      Returns:
      the custom fire wrapper, or null if the block is not custom fire.
    • remove

      public static boolean remove(Location location)
      Removes custom fire at the provided location.
      Parameters:
      location - the custom fire location.
      Returns:
      true when the custom fire data is removed.
    • getAge

      public static int getAge(@NotNull @NotNull Block block)
      Gets the age of a fire block.
      Parameters:
      block - the fire block.
      Returns:
      the fire age.
      Throws:
      ClassCastException - if the block is not fire.
    • setAge

      public static void setAge(@NotNull @NotNull Block block, int age)
      Sets the age of a fire block.
      Parameters:
      block - the fire block.
      age - the new fire age.
      Throws:
      ClassCastException - if the block is not fire.
    • getLocation

      @Nullable public @Nullable Location getLocation()
      Gets the placed fire location.
      Returns:
      the fire location, or null if this wrapper is not placed.
    • isPlaced

      public boolean isPlaced()
      Checks if this wrapper is associated with a placed block.
      Returns:
      true if this custom fire is placed.
    • place

      public CustomFire place(Location location)
      Places this custom fire in the world.
      Parameters:
      location - the location where the fire will be placed.
      Returns:
      this wrapper.
    • remove

      public boolean remove()
      Removes this custom fire from the world.
      Returns:
      true if the custom fire was removed.
    • getAge

      public int getAge()
      Gets the age of this placed custom fire.
      Returns:
      the fire age.
    • setAge

      public void setAge(int age)
      Sets the age of this placed custom fire.
      Parameters:
      age - the new fire age.