java.lang.Object
me.gamercoder215.starcosmetics.api.cosmetics.structure.Structure
All Implemented Interfaces:
Cloneable

public abstract class Structure extends Object implements Cloneable
Represents a StarCosmetics Structure
  • Field Details

    • DEFAULT_REMOVAL_TIME

      public static final long DEFAULT_REMOVAL_TIME
      Represents the default removal time, in ticks, of a Structure (30 seconds).
      See Also:
  • Method Details

    • getMaterials

      @NotNull public abstract @NotNull Map<StructurePoint,Material> getMaterials()
      Fetches a Map of StructurePoints to Materials that the Structure will place.
      Returns:
      StructurePoint to Material Blueprint Map
    • getInfo

      @NotNull public final @NotNull StructureInfo getInfo()
      Fetches the Structure's Structure Info.
      Returns:
      Structure Info
    • place

      public abstract void place(@NotNull @NotNull Location center) throws IllegalArgumentException, IllegalStateException
      Places this Structure WITHOUT automatically removing it.
      Parameters:
      center - Center of Structure
      Throws:
      IllegalArgumentException - if center is null
      IllegalStateException - if this instance has already been placed
    • getRarity

      public abstract Rarity getRarity()
      Fetches the rarity of this Structure.
      Returns:
      Structure Rarity
    • placeAndRemove

      public abstract void placeAndRemove(@NotNull @NotNull Location center, long delay) throws IllegalArgumentException, IllegalStateException
      Places this Structure.
      Parameters:
      center - Center of Structure
      delay - Delay, in ticks, to remove this Structure
      Throws:
      IllegalArgumentException - if delay is negative or center is null
      IllegalStateException - if this instance has already been placed and not removed
    • getPointsPlaced

      @NotNull public abstract @NotNull Set<StructurePoint> getPointsPlaced()

      Fetches all of the points of this Structure that have been placed.

      If the structure hasn't been placed, this set will be empty. This is to ensure nothing that was previously there doesn't get removed.

      Returns:
      All Structure Points
    • getLocalizedName

      @NotNull public @NotNull String getLocalizedName()
      Fetches the localized name of this Structure.
      Returns:
      Localized Name
    • clone

      public Structure clone()
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object