Interface IBlueprintDataProviderBE
- All Known Implementing Classes:
BlockEntityTagSubstitution
public interface IBlueprintDataProviderBE
Interface for TE's which hold schematic specific data. They need to write and read the data to nbt to save it!
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidRemoves a tag from the dataGetter for the blueprint path.default net.minecraft.util.Tuple<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos> Gets world positionsGet the pack name.Gets the map of blockpos and its applied tags.default net.minecraft.core.BlockPosgetRealWorldPos(net.minecraft.core.BlockPos relativePos) Converts a relative pos to its real world posnet.minecraft.util.Tuple<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos> Gets the schematics corner positions, default is anchor PosGets the schematic name, required to be savednet.minecraft.core.BlockPosGets the TE's world positionnet.minecraft.network.protocol.game.ClientboundBlockEntityDataPacketGets the update packet, needed for initial placement through schematic pasteGets the tag name to positions mapGets the tag pos map with real world coordsdefault voidreadSchematicDataFromNBT(net.minecraft.nbt.CompoundTag originalCompound) Default read schematic data from nbtreadTagPosMapFrom(net.minecraft.nbt.CompoundTag compoundNBT) Reads the tagPosmap from nbtdefault voidRemoves a tag from the datavoidsetBlueprintPath(String filePath) Set the blueprint path in the provider.voidsetPackName(String packName) Set the pack this blueprint belongs to.voidsetPositionedTags(Map<net.minecraft.core.BlockPos, List<String>> positionedTags) Sets the map of positioned tags.voidsetSchematicCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2) Sets the schematics corner positionsvoidsetSchematicName(String name) Sets the schematic namestatic voidwriteMapToCompound(net.minecraft.nbt.CompoundTag compoundNBT, Map<net.minecraft.core.BlockPos, List<String>> tagPosMap) Writes the given tag pos map to nbtdefault voidwriteSchematicDataToNBT(net.minecraft.nbt.CompoundTag originalCompound) Default write to nbt
-
Field Details
-
TAG_SCHEMATIC_NAME
- See Also:
-
TAG_CORNER_ONE
- See Also:
-
TAG_CORNER_TWO
- See Also:
-
TAG_TAG_POS
- See Also:
-
TAG_TAG_NAME
- See Also:
-
TAG_TAG_NAME_LIST
- See Also:
-
TAG_POS_TAG_MAP
- See Also:
-
TAG_BLUEPRINTDATA
- See Also:
-
TAG_PATH
- See Also:
-
TAG_PACK
- See Also:
-
-
Method Details
-
getSchematicName
String getSchematicName()Gets the schematic name, required to be saved- Returns:
- schematic name
-
setSchematicName
Sets the schematic name- Parameters:
name- name to set
-
getPositionedTags
Gets the map of blockpos and its applied tags. Positions are relative to the anchorpos, use pos + anchor bos to obtain real world coords.- Returns:
- tagPosMap
-
setPositionedTags
Sets the map of positioned tags.- Parameters:
positionedTags- tag map
-
getSchematicCorners
net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> getSchematicCorners()Gets the schematics corner positions, default is anchor Pos -
getInWorldCorners
default net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> getInWorldCorners()Gets world positions -
setSchematicCorners
void setSchematicCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2) Sets the schematics corner positions- Parameters:
pos1- first pospos2- second pos
-
writeSchematicDataToNBT
default void writeSchematicDataToNBT(net.minecraft.nbt.CompoundTag originalCompound) Default write to nbt -
writeMapToCompound
static void writeMapToCompound(net.minecraft.nbt.CompoundTag compoundNBT, Map<net.minecraft.core.BlockPos, List<String>> tagPosMap) Writes the given tag pos map to nbt- Parameters:
compoundNBT- compound to write totagPosMap- map to write
-
readSchematicDataFromNBT
default void readSchematicDataFromNBT(net.minecraft.nbt.CompoundTag originalCompound) Default read schematic data from nbt -
readTagPosMapFrom
static Map<net.minecraft.core.BlockPos,List<String>> readTagPosMapFrom(net.minecraft.nbt.CompoundTag compoundNBT) Reads the tagPosmap from nbt- Parameters:
compoundNBT- compound to read from- Returns:
- map of positions and tags
-
removeTag
Removes a tag from the data- Parameters:
tag- to remove
-
addTag
Removes a tag from the data- Parameters:
tag- to remove
-
getWorldTagPosMap
Gets the tag pos map with real world coords- Returns:
- the tag pos map with current world coords
-
getWorldTagNamePosMap
Gets the tag name to positions map- Returns:
- the tag pos map with current world coords
-
getRealWorldPos
default net.minecraft.core.BlockPos getRealWorldPos(net.minecraft.core.BlockPos relativePos) Converts a relative pos to its real world pos- Parameters:
relativePos-- Returns:
-
getTilePos
net.minecraft.core.BlockPos getTilePos()Gets the TE's world position- Returns:
- position
-
getUpdatePacket
net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()Gets the update packet, needed for initial placement through schematic paste- Returns:
- client update packet
-
setBlueprintPath
Set the blueprint path in the provider.- Parameters:
filePath- the path where the blueprint of this file was loaded from within a pack.
-
setPackName
Set the pack this blueprint belongs to.- Parameters:
packName- the pack.
-
getPackName
String getPackName()Get the pack name.- Returns:
- the pack name.
-
getBlueprintPath
String getBlueprintPath()Getter for the blueprint path.- Returns:
- the pack name.
-