Class BlockEntityTagSubstitution
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
com.ldtteam.structurize.blockentities.BlockEntityTagSubstitution
- All Implemented Interfaces:
IBlueprintDataProviderBE,net.neoforged.neoforge.attachment.IAttachmentHolder,net.neoforged.neoforge.common.extensions.IBlockEntityExtension
public class BlockEntityTagSubstitution
extends net.minecraft.world.level.block.entity.BlockEntity
implements IBlueprintDataProviderBE
The block entity for BlockTagSubstitution
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BlockEntity.DataComponentInputNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsField -
Field Summary
FieldsFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
TAG_BLUEPRINTDATA, TAG_CORNER_ONE, TAG_CORNER_TWO, TAG_PACK, TAG_PATH, TAG_POS_TAG_MAP, TAG_SCHEMATIC_NAME, TAG_TAG_NAME, TAG_TAG_NAME_LIST, TAG_TAG_POS -
Constructor Summary
ConstructorsConstructorDescriptionBlockEntityTagSubstitution(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyImplicitComponents(net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput componentInput) protected voidcollectImplicitComponents(net.minecraft.core.component.DataComponentMap.Builder componentBuilder) static CapturedBlockdeserializeReplacement(net.minecraft.nbt.CompoundTag compound, com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> dynamicOps) Getter for the blueprint path.Get the pack name.Gets the map of blockpos and its applied tags.@NotNull CapturedBlocknet.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 paste@NotNull net.minecraft.nbt.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider provider) voidloadAdditional(@NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) voidremoveComponentsFromTag(net.minecraft.nbt.CompoundTag itemStackTag) voidsaveAdditional(@NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) static voidserializeReplacement(net.minecraft.nbt.CompoundTag compound, com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> dynamicOps, CapturedBlock replacement) voidsetBlueprintPath(String inPackPath) 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 nameMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEventMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdateMethods inherited from interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
addTag, getInWorldCorners, getRealWorldPos, getWorldTagNamePosMap, getWorldTagPosMap, readSchematicDataFromNBT, removeTag, writeSchematicDataToNBT
-
Field Details
-
CAPTURED_BLOCK_TAG
- See Also:
-
CAPTURED_BLOCK_TAG_OLD
Up to 1.21.1- See Also:
-
-
Constructor Details
-
BlockEntityTagSubstitution
public BlockEntityTagSubstitution(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
getSchematicName
Description copied from interface:IBlueprintDataProviderBEGets the schematic name, required to be saved- Specified by:
getSchematicNamein interfaceIBlueprintDataProviderBE- Returns:
- schematic name
-
setSchematicName
Description copied from interface:IBlueprintDataProviderBESets the schematic name- Specified by:
setSchematicNamein interfaceIBlueprintDataProviderBE- Parameters:
name- name to set
-
getPositionedTags
Description copied from interface:IBlueprintDataProviderBEGets the map of blockpos and its applied tags. Positions are relative to the anchorpos, use pos + anchor bos to obtain real world coords.- Specified by:
getPositionedTagsin interfaceIBlueprintDataProviderBE- Returns:
- tagPosMap
-
setPositionedTags
Description copied from interface:IBlueprintDataProviderBESets the map of positioned tags.- Specified by:
setPositionedTagsin interfaceIBlueprintDataProviderBE- Parameters:
positionedTags- tag map
-
getSchematicCorners
public net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> getSchematicCorners()Description copied from interface:IBlueprintDataProviderBEGets the schematics corner positions, default is anchor Pos- Specified by:
getSchematicCornersin interfaceIBlueprintDataProviderBE
-
setSchematicCorners
public void setSchematicCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2) Description copied from interface:IBlueprintDataProviderBESets the schematics corner positions- Specified by:
setSchematicCornersin interfaceIBlueprintDataProviderBE- Parameters:
pos1- first pospos2- second pos
-
getTilePos
public net.minecraft.core.BlockPos getTilePos()Description copied from interface:IBlueprintDataProviderBEGets the TE's world position- Specified by:
getTilePosin interfaceIBlueprintDataProviderBE- Returns:
- position
-
getReplacement
- Returns:
- the replacement block details
-
loadAdditional
public void loadAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) - Overrides:
loadAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
deserializeReplacement
public static CapturedBlock deserializeReplacement(net.minecraft.nbt.CompoundTag compound, com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> dynamicOps) -
saveAdditional
public void saveAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
serializeReplacement
public static void serializeReplacement(net.minecraft.nbt.CompoundTag compound, com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> dynamicOps, CapturedBlock replacement) -
getUpdatePacket
public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()Description copied from interface:IBlueprintDataProviderBEGets the update packet, needed for initial placement through schematic paste- Specified by:
getUpdatePacketin interfaceIBlueprintDataProviderBE- Overrides:
getUpdatePacketin classnet.minecraft.world.level.block.entity.BlockEntity- Returns:
- client update packet
-
setPackName
Description copied from interface:IBlueprintDataProviderBESet the pack this blueprint belongs to.- Specified by:
setPackNamein interfaceIBlueprintDataProviderBE- Parameters:
packName- the pack.
-
setBlueprintPath
Description copied from interface:IBlueprintDataProviderBESet the blueprint path in the provider.- Specified by:
setBlueprintPathin interfaceIBlueprintDataProviderBE- Parameters:
inPackPath- the path where the blueprint of this file was loaded from within a pack.
-
getPackName
Description copied from interface:IBlueprintDataProviderBEGet the pack name.- Specified by:
getPackNamein interfaceIBlueprintDataProviderBE- Returns:
- the pack name.
-
getBlueprintPath
Description copied from interface:IBlueprintDataProviderBEGetter for the blueprint path.- Specified by:
getBlueprintPathin interfaceIBlueprintDataProviderBE- Returns:
- the pack name.
-
getUpdateTag
@NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider provider) - Overrides:
getUpdateTagin classnet.minecraft.world.level.block.entity.BlockEntity
-
applyImplicitComponents
protected void applyImplicitComponents(net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput componentInput) - Overrides:
applyImplicitComponentsin classnet.minecraft.world.level.block.entity.BlockEntity
-
collectImplicitComponents
protected void collectImplicitComponents(net.minecraft.core.component.DataComponentMap.Builder componentBuilder) - Overrides:
collectImplicitComponentsin classnet.minecraft.world.level.block.entity.BlockEntity
-
removeComponentsFromTag
public void removeComponentsFromTag(net.minecraft.nbt.CompoundTag itemStackTag) - Overrides:
removeComponentsFromTagin classnet.minecraft.world.level.block.entity.BlockEntity
-