Class StructureTemplateManager
java.lang.Object
net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
(package private) static final record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HolderGetter
<Block> private final com.mojang.datafixers.DataFixer
private final Path
private static final org.slf4j.Logger
private static final FileToIdConverter
private ResourceManager
private final List
<StructureTemplateManager.Source> private static final String
private static final String
static final String
private static final String
private final Map
<ResourceLocation, Optional<StructureTemplate>> -
Constructor Summary
ConstructorsConstructorDescriptionStructureTemplateManager
(ResourceManager p_249872_, LevelStorageSource.LevelStorageAccess p_249864_, com.mojang.datafixers.DataFixer p_249868_, HolderGetter<Block> p_256126_) -
Method Summary
Modifier and TypeMethodDescriptioncreateAndValidatePathToGeneratedStructure
(ResourceLocation pLocation, String pExtension) get
(ResourceLocation pId) private void
listFolderContents
(Path pFolder, String pNamespace, String pExtension, Consumer<ResourceLocation> pOutput) private Stream
<ResourceLocation> private Stream
<ResourceLocation> private Stream
<ResourceLocation> private Optional
<StructureTemplate> load
(StructureTemplateManager.InputStreamOpener pInputStream, Consumer<Throwable> pOnError) private Optional
<StructureTemplate> loadFromGenerated
(ResourceLocation p_230432_) private Optional
<StructureTemplate> loadFromResource
(ResourceLocation p_230428_) private Optional
<StructureTemplate> loadFromSnbt
(ResourceLocation pId, Path pPath) private Optional
<StructureTemplate> loadFromTestStructures
(ResourceLocation p_230430_) void
onResourceManagerReload
(ResourceManager pResourceManager) private StructureTemplate
readStructure
(InputStream pStream) readStructure
(CompoundTag pNbt) private String
relativize
(Path pRoot, Path pPath) void
remove
(ResourceLocation pId) boolean
save
(ResourceLocation pId) private Optional
<StructureTemplate> tryLoad
(ResourceLocation p_230426_)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
STRUCTURE_RESOURCE_DIRECTORY_NAME
- See Also:
-
STRUCTURE_GENERATED_DIRECTORY_NAME
- See Also:
-
STRUCTURE_FILE_EXTENSION
- See Also:
-
STRUCTURE_TEXT_FILE_EXTENSION
- See Also:
-
structureRepository
-
fixerUpper
private final com.mojang.datafixers.DataFixer fixerUpper -
resourceManager
-
generatedDir
-
sources
-
blockLookup
-
RESOURCE_LISTER
-
-
Constructor Details
-
StructureTemplateManager
public StructureTemplateManager(ResourceManager p_249872_, LevelStorageSource.LevelStorageAccess p_249864_, com.mojang.datafixers.DataFixer p_249868_, HolderGetter<Block> p_256126_)
-
-
Method Details
-
getOrCreate
-
get
-
listTemplates
-
tryLoad
-
onResourceManagerReload
-
loadFromResource
-
listResources
-
loadFromTestStructures
-
listTestStructures
-
loadFromGenerated
-
listGenerated
-
listFolderContents
private void listFolderContents(Path pFolder, String pNamespace, String pExtension, Consumer<ResourceLocation> pOutput) -
relativize
-
loadFromSnbt
-
load
private Optional<StructureTemplate> load(StructureTemplateManager.InputStreamOpener pInputStream, Consumer<Throwable> pOnError) -
readStructure
- Throws:
IOException
-
readStructure
-
save
-
createAndValidatePathToGeneratedStructure
public Path createAndValidatePathToGeneratedStructure(ResourceLocation pLocation, String pExtension) -
remove
-