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 com.mojang.datafixers.DataFixer
private final Path
private static final org.slf4j.Logger
private ResourceManager
private final List<StructureTemplateManager.Source>
private static final String
private static final String
private static final String
private final Map<ResourceLocation,
Optional<StructureTemplate>> private static final String
-
Constructor Summary
ConstructorDescriptionStructureTemplateManager
(ResourceManager p_230352_, LevelStorageSource.LevelStorageAccess p_230353_, com.mojang.datafixers.DataFixer p_230354_) -
Method Summary
Modifier and TypeMethodDescriptionprivate static Path
createAndValidatePathToStructure
(Path p_230412_, ResourceLocation p_230413_, String p_230414_) static Path
createPathToStructure
(Path p_230391_, ResourceLocation p_230392_, String p_230393_) get
(ResourceLocation p_230408_) getOrCreate
(ResourceLocation p_230360_) getPathToGeneratedStructure
(ResourceLocation p_230362_, String p_230363_) private Stream<ResourceLocation>
listFolderContents
(Path p_230395_, String p_230396_, String p_230397_) private Stream<ResourceLocation>
private Stream<ResourceLocation>
listGeneratedInNamespace
(Path p_230389_) 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_DIRECTORY_NAME
- See Also:
-
TEST_STRUCTURES_DIR
- 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
-
-
Constructor Details
-
StructureTemplateManager
public StructureTemplateManager(ResourceManager p_230352_, LevelStorageSource.LevelStorageAccess p_230353_, com.mojang.datafixers.DataFixer p_230354_)
-
-
Method Details
-
getOrCreate
-
get
-
listTemplates
-
tryLoad
-
onResourceManagerReload
-
loadFromResource
-
listResources
-
loadFromTestStructures
-
listTestStructures
-
loadFromGenerated
-
listGenerated
-
listGeneratedInNamespace
-
listFolderContents
private Stream<ResourceLocation> listFolderContents(Path p_230395_, String p_230396_, String p_230397_) -
relativize
-
loadFromSnbt
-
load
private Optional<StructureTemplate> load(StructureTemplateManager.InputStreamOpener p_230373_, Consumer<Throwable> p_230374_) -
readStructure
- Throws:
IOException
-
readStructure
-
save
-
getPathToGeneratedStructure
-
createPathToStructure
public static Path createPathToStructure(Path p_230391_, ResourceLocation p_230392_, String p_230393_) -
createAndValidatePathToStructure
private static Path createAndValidatePathToStructure(Path p_230412_, ResourceLocation p_230413_, String p_230414_) -
remove
-