public class StructureManager extends Object implements SynchronousResourceReloadListener
ResourceReloadListener.Synchronizer| Modifier and Type | Field and Description |
|---|---|
private com.mojang.datafixers.DataFixer |
dataFixer |
private Path |
generatedPath |
private static Logger |
LOGGER |
private MinecraftServer |
server |
private Map<Identifier,Structure> |
structures |
| Constructor and Description |
|---|
StructureManager(MinecraftServer server,
File worldDir,
com.mojang.datafixers.DataFixer dataFixer) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(ResourceManager manager) |
Structure |
createStructure(CompoundTag tag) |
private Path |
getAndCheckStructurePath(Identifier id,
String extension) |
Structure |
getStructure(Identifier identifier) |
Structure |
getStructureOrBlank(Identifier id) |
Path |
getStructurePath(Identifier id,
String extension) |
private Structure |
loadStructureFromFile(Identifier id) |
private Structure |
loadStructureFromResource(Identifier id) |
private Structure |
readStructure(InputStream structureInputStream) |
boolean |
saveStructure(Identifier id) |
void |
unloadStructure(Identifier id) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreloadgetNameprivate static final Logger LOGGER
private final Map<Identifier,Structure> structures
private final com.mojang.datafixers.DataFixer dataFixer
private final MinecraftServer server
private final Path generatedPath
public StructureManager(MinecraftServer server, File worldDir, com.mojang.datafixers.DataFixer dataFixer)
public Structure getStructureOrBlank(Identifier id)
@Nullable public Structure getStructure(Identifier identifier)
public void apply(ResourceManager manager)
apply in interface SynchronousResourceReloadListener@Nullable private Structure loadStructureFromResource(Identifier id)
@Nullable private Structure loadStructureFromFile(Identifier id)
private Structure readStructure(InputStream structureInputStream) throws IOException
IOExceptionpublic Structure createStructure(CompoundTag tag)
public boolean saveStructure(Identifier id)
public Path getStructurePath(Identifier id, String extension)
private Path getAndCheckStructurePath(Identifier id, String extension)
public void unloadStructure(Identifier id)