Class TemplateSource
java.lang.Object
net.minecraft.world.level.levelgen.structure.templatesystem.loader.TemplateSource
- Direct Known Subclasses:
DirectoryTemplateSource, ResourceManagerTemplateSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HolderGetter<Block> private final com.mojang.datafixers.DataFixer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTemplateSource(com.mojang.datafixers.DataFixer fixerUpper, HolderGetter<Block> blockLookup) -
Method Summary
Modifier and TypeMethodDescriptionabstract Stream<Identifier> list()abstract Optional<StructureTemplate> load(Identifier id) protected Optional<StructureTemplate> load(IoSupplier<InputStream> opener, boolean asText, Consumer<Throwable> onError) private static CompoundTagreadStructure(InputStream input) private StructureTemplatereadStructure(CompoundTag tag) private static CompoundTagreadTextStructure(InputStream input)
-
Field Details
-
fixerUpper
private final com.mojang.datafixers.DataFixer fixerUpper -
blockLookup
-
-
Constructor Details
-
TemplateSource
protected TemplateSource(com.mojang.datafixers.DataFixer fixerUpper, HolderGetter<Block> blockLookup)
-
-
Method Details
-
load
-
list
-
load
protected Optional<StructureTemplate> load(IoSupplier<InputStream> opener, boolean asText, Consumer<Throwable> onError) -
readStructure
- Throws:
IOException
-
readTextStructure
private static CompoundTag readTextStructure(InputStream input) throws IOException, com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
IOExceptioncom.mojang.brigadier.exceptions.CommandSyntaxException
-
readStructure
-