Class StructurePieceStore<T extends GlowStructurePiece>

java.lang.Object
net.glowstone.io.structure.StructurePieceStore<T>
Type Parameters:
T - The type of structure piece being stored.
Direct Known Subclasses:
DesertTempleStore, JungleTempleStore, WitchHutStore

public abstract class StructurePieceStore<T extends GlowStructurePiece> extends Object
The base for structure piece store classes.
  • Constructor Details

    • StructurePieceStore

      public StructurePieceStore(Class<T> type, String id)
  • Method Details

    • createStructurePiece

      public abstract T createStructurePiece()
      Create a structure piece of this store's type.

      The load method will be called separately.

      Returns:
      The structure piece.
    • load

      public void load(T structurePiece, CompoundTag compound)
      Load structure piece data of the appropriate type from the given compound tag.
      Parameters:
      structurePiece - The target structure piece.
      compound - The structure piece's tag.
    • save

      public void save(T structurePiece, CompoundTag compound)
      Save information about this structure piece to the given tag.
      Parameters:
      structurePiece - The structure piece to save.
      compound - The target tag.
    • getType

      public Class<T> getType()
    • getId

      public String getId()
    • equals

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

      protected boolean canEqual(Object other)
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object