Class StructureStore<T extends GlowStructure>

java.lang.Object
net.glowstone.io.structure.StructureStore<T>
Type Parameters:
T - The type of structure being stored.
Direct Known Subclasses:
TempleStore

public abstract class StructureStore<T extends GlowStructure> extends Object
The base for structure store classes.
  • Constructor Details

    • StructureStore

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

    • createStructure

      public abstract T createStructure(GlowWorld world, int chunkX, int chunkZ)
      Create a structure of this store's type in the given world. The load method will be called separately.
      Parameters:
      world - The target world.
      chunkX - The structure chunk X.
      chunkZ - The structure chunk Z.
      Returns:
      The structure.
    • createNewStructure

      public abstract T createNewStructure(GlowWorld world, Random random, int chunkX, int chunkZ)
      Create a new structure of this store's type in the given world. The load method will be called separately.
      Parameters:
      world - The target world.
      random - The seeded random.
      chunkX - The structure chunk X.
      chunkZ - The structure chunk Z.
      Returns:
      The new structure.
    • load

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

      public void save(T structure, CompoundTag compound)
      Save information about this structure to the given tag.
      Parameters:
      structure - The structure 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