Package net.glowstone.io.structure
Class StructureStorage
java.lang.Object
net.glowstone.io.structure.StructureStorage
The class responsible for mapping structure types to their storage methods and reading and
writing structure data using those storage methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<StructureStore<?>>
Returns all known structure stores.static GlowStructure
loadStructure
(GlowWorld world, CompoundTag compound) Load a structure in the given world from the given data tag.static StructureStore<GlowStructure>
saveStructure
(GlowStructure structure, CompoundTag compound) Save a structure data to the given compound tag.
-
Method Details
-
getStructureStores
Returns all known structure stores.- Returns:
- A collection containing all structure stores.
-
loadStructure
Load a structure in the given world from the given data tag.- Parameters:
world
- The target world.compound
- The tag to load from.- Returns:
- The newly constructed structure.
- Throws:
IllegalArgumentException
- if there is an error in the data.
-
saveStructure
public static StructureStore<GlowStructure> saveStructure(GlowStructure structure, CompoundTag compound) Save a structure data to the given compound tag.- Parameters:
structure
- The structure to save.compound
- The target tag.- Returns:
- The structure store for the saved structure.
-