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 resourceManager, LevelStorageSource.LevelStorageAccess levelStorageAccess, com.mojang.datafixers.DataFixer fixerUpper, HolderGetter<Block> blockLookup) -
Method Summary
Modifier and TypeMethodDescriptioncreateAndValidatePathToGeneratedStructure
(ResourceLocation location, String extension) get
(ResourceLocation id) private void
listFolderContents
(Path folder, String namespace, String extension, Consumer<ResourceLocation> output) private Stream
<ResourceLocation> private Stream
<ResourceLocation> private Stream
<ResourceLocation> private Optional
<StructureTemplate> load
(StructureTemplateManager.InputStreamOpener inputStream, Consumer<Throwable> onError) private Optional
<StructureTemplate> private Optional
<StructureTemplate> private Optional
<StructureTemplate> loadFromSnbt
(ResourceLocation id, Path p_path) private Optional
<StructureTemplate> void
onResourceManagerReload
(ResourceManager resourceManager) private StructureTemplate
readStructure
(InputStream stream) readStructure
(CompoundTag nbt) private String
relativize
(Path root, Path path) void
boolean
save
(ResourceLocation id) private Optional
<StructureTemplate>
-
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 resourceManager, LevelStorageSource.LevelStorageAccess levelStorageAccess, com.mojang.datafixers.DataFixer fixerUpper, HolderGetter<Block> blockLookup)
-
-
Method Details
-
getOrCreate
-
get
-
listTemplates
-
tryLoad
-
onResourceManagerReload
-
loadFromResource
-
listResources
-
loadFromTestStructures
-
listTestStructures
-
loadFromGenerated
-
listGenerated
-
listFolderContents
private void listFolderContents(Path folder, String namespace, String extension, Consumer<ResourceLocation> output) -
relativize
-
loadFromSnbt
-
load
private Optional<StructureTemplate> load(StructureTemplateManager.InputStreamOpener inputStream, Consumer<Throwable> onError) -
readStructure
- Throws:
IOException
-
readStructure
-
save
-
createAndValidatePathToGeneratedStructure
-
remove
-