Class StructureTemplateManager
java.lang.Object
net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static interface
(package private) static final record
-
Field Summary
Modifier 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
ConstructorDescriptionStructureTemplateManager
(ResourceManager p_249872_, LevelStorageSource.LevelStorageAccess p_249864_, com.mojang.datafixers.DataFixer p_249868_, HolderGetter<Block> p_256126_) -
Method Summary
Modifier and TypeMethodDescriptioncreateAndValidatePathToGeneratedStructure
(ResourceLocation p_345333_, String p_345223_) get
(ResourceLocation p_230408_) getOrCreate
(ResourceLocation p_230360_) private void
listFolderContents
(Path p_230395_, String p_230396_, String p_230397_, Consumer<ResourceLocation> p_342318_) private Stream
<ResourceLocation> private Stream
<ResourceLocation> private Stream
<ResourceLocation> private Optional
<StructureTemplate> load
(StructureTemplateManager.InputStreamOpener p_230373_, Consumer<Throwable> p_230374_) private Optional
<StructureTemplate> loadFromGenerated
(ResourceLocation p_230432_) private Optional
<StructureTemplate> loadFromResource
(ResourceLocation p_230428_) private Optional
<StructureTemplate> loadFromSnbt
(ResourceLocation p_230368_, Path p_230369_) private Optional
<StructureTemplate> loadFromTestStructures
(ResourceLocation p_230430_) void
onResourceManagerReload
(ResourceManager p_230371_) private StructureTemplate
readStructure
(InputStream p_230378_) readStructure
(CompoundTag p_230405_) private String
relativize
(Path p_230402_, Path p_230403_) void
remove
(ResourceLocation p_230422_) boolean
save
(ResourceLocation p_230417_) 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 p_230395_, String p_230396_, String p_230397_, Consumer<ResourceLocation> p_342318_) -
relativize
-
loadFromSnbt
-
load
private Optional<StructureTemplate> load(StructureTemplateManager.InputStreamOpener p_230373_, Consumer<Throwable> p_230374_) -
readStructure
- Throws:
IOException
-
readStructure
-
save
-
createAndValidatePathToGeneratedStructure
-
remove
-