Class CompassBuilder

java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.CompassBuilder

public class CompassBuilder extends ItemBuilder
The CompassBuilder class extends ItemBuilder to provide additional functionality for modifying CompassMeta of an ItemStack. This class allows setting and retrieving lodestone locations and tracking status.
  • Constructor Details

    • CompassBuilder

      public CompassBuilder()
      Constructs a CompassBuilder with a new compass item.
    • CompassBuilder

      public CompassBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Constructs a CompassBuilder using an existing ItemStack.
      Parameters:
      itemStack - the item stack to modify
      Throws:
      IllegalArgumentException - if the item's meta is not an instance of CompassMeta
  • Method Details

    • setLodestone

      public CompassBuilder setLodestone(@NotNull @NotNull org.bukkit.Location lodestone)
      Sets the lodestone location for the compass.
      Parameters:
      lodestone - the lodestone location to set
      Returns:
      this CompassBuilder instance for method chaining
    • getLodestone

      public org.bukkit.Location getLodestone()
      Gets the lodestone location of the compass.
      Returns:
      the lodestone location, or null if none is set
    • hasLodestone

      public boolean hasLodestone()
      Checks if the compass has a lodestone location set.
      Returns:
      true if a lodestone is set, false otherwise
    • setLodestoneTracked

      public CompassBuilder setLodestoneTracked(boolean tracked)
      Sets whether the compass is tracking a lodestone.
      Parameters:
      tracked - true if the compass should track a lodestone, false otherwise
      Returns:
      this CompassBuilder instance for method chaining
    • isLodestoneTracked

      public boolean isLodestoneTracked()
      Checks if the compass is tracking a lodestone.
      Returns:
      true if the compass is tracking a lodestone, false otherwise