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.DataComponentInput

    Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
    Up to 1.21.1

    Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity

    level, remove, worldPosition

    Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    ATTACHMENTS_NBT_KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockEntityTagSubstitution(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    applyImplicitComponents(net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput componentInput)
     
    protected void
    collectImplicitComponents(net.minecraft.core.component.DataComponentMap.Builder componentBuilder)
     
    deserializeReplacement(net.minecraft.nbt.CompoundTag compound, com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> dynamicOps)
     
    Getter for the blueprint path.
    Get the pack name.
    Map<net.minecraft.core.BlockPos,List<String>>
    Gets the map of blockpos and its applied tags.
    @NotNull CapturedBlock
     
    net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos>
    Gets the schematics corner positions, default is anchor Pos
    Gets the schematic name, required to be saved
    net.minecraft.core.BlockPos
    Gets the TE's world position
    net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket
    Gets the update packet, needed for initial placement through schematic paste
    @NotNull net.minecraft.nbt.CompoundTag
    getUpdateTag(net.minecraft.core.HolderLookup.Provider provider)
     
    void
    loadAdditional(@NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider)
     
    void
    removeComponentsFromTag(net.minecraft.nbt.CompoundTag itemStackTag)
     
    void
    saveAdditional(@NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider)
     
    static void
    serializeReplacement(net.minecraft.nbt.CompoundTag compound, com.mojang.serialization.DynamicOps<net.minecraft.nbt.Tag> dynamicOps, CapturedBlock replacement)
     
    void
    Set the blueprint path in the provider.
    void
    setPackName(String packName)
    Set the pack this blueprint belongs to.
    void
    setPositionedTags(Map<net.minecraft.core.BlockPos,List<String>> positionedTags)
    Sets the map of positioned tags.
    void
    setSchematicCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2)
    Sets the schematics corner positions
    void
    Sets the schematic name

    Methods 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, triggerEvent

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

    getData, getExistingData, hasData, removeData, setData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension

    getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
  • Field Details

  • Constructor Details

    • BlockEntityTagSubstitution

      public BlockEntityTagSubstitution(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • getSchematicName

      public String getSchematicName()
      Description copied from interface: IBlueprintDataProviderBE
      Gets the schematic name, required to be saved
      Specified by:
      getSchematicName in interface IBlueprintDataProviderBE
      Returns:
      schematic name
    • setSchematicName

      public void setSchematicName(String name)
      Description copied from interface: IBlueprintDataProviderBE
      Sets the schematic name
      Specified by:
      setSchematicName in interface IBlueprintDataProviderBE
      Parameters:
      name - name to set
    • getPositionedTags

      public Map<net.minecraft.core.BlockPos,List<String>> getPositionedTags()
      Description copied from interface: IBlueprintDataProviderBE
      Gets 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:
      getPositionedTags in interface IBlueprintDataProviderBE
      Returns:
      tagPosMap
    • setPositionedTags

      public void setPositionedTags(Map<net.minecraft.core.BlockPos,List<String>> positionedTags)
      Description copied from interface: IBlueprintDataProviderBE
      Sets the map of positioned tags.
      Specified by:
      setPositionedTags in interface IBlueprintDataProviderBE
      Parameters:
      positionedTags - tag map
    • getSchematicCorners

      public net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> getSchematicCorners()
      Description copied from interface: IBlueprintDataProviderBE
      Gets the schematics corner positions, default is anchor Pos
      Specified by:
      getSchematicCorners in interface IBlueprintDataProviderBE
    • setSchematicCorners

      public void setSchematicCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2)
      Description copied from interface: IBlueprintDataProviderBE
      Sets the schematics corner positions
      Specified by:
      setSchematicCorners in interface IBlueprintDataProviderBE
      Parameters:
      pos1 - first pos
      pos2 - second pos
    • getTilePos

      public net.minecraft.core.BlockPos getTilePos()
      Description copied from interface: IBlueprintDataProviderBE
      Gets the TE's world position
      Specified by:
      getTilePos in interface IBlueprintDataProviderBE
      Returns:
      position
    • getReplacement

      @NotNull public @NotNull CapturedBlock getReplacement()
      Returns:
      the replacement block details
    • loadAdditional

      public void loadAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      loadAdditional in class net.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:
      saveAdditional in class net.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: IBlueprintDataProviderBE
      Gets the update packet, needed for initial placement through schematic paste
      Specified by:
      getUpdatePacket in interface IBlueprintDataProviderBE
      Overrides:
      getUpdatePacket in class net.minecraft.world.level.block.entity.BlockEntity
      Returns:
      client update packet
    • setPackName

      public void setPackName(String packName)
      Description copied from interface: IBlueprintDataProviderBE
      Set the pack this blueprint belongs to.
      Specified by:
      setPackName in interface IBlueprintDataProviderBE
      Parameters:
      packName - the pack.
    • setBlueprintPath

      public void setBlueprintPath(String inPackPath)
      Description copied from interface: IBlueprintDataProviderBE
      Set the blueprint path in the provider.
      Specified by:
      setBlueprintPath in interface IBlueprintDataProviderBE
      Parameters:
      inPackPath - the path where the blueprint of this file was loaded from within a pack.
    • getPackName

      public String getPackName()
      Description copied from interface: IBlueprintDataProviderBE
      Get the pack name.
      Specified by:
      getPackName in interface IBlueprintDataProviderBE
      Returns:
      the pack name.
    • getBlueprintPath

      public String getBlueprintPath()
      Description copied from interface: IBlueprintDataProviderBE
      Getter for the blueprint path.
      Specified by:
      getBlueprintPath in interface IBlueprintDataProviderBE
      Returns:
      the pack name.
    • getUpdateTag

      @NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      getUpdateTag in class net.minecraft.world.level.block.entity.BlockEntity
    • applyImplicitComponents

      protected void applyImplicitComponents(net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput componentInput)
      Overrides:
      applyImplicitComponents in class net.minecraft.world.level.block.entity.BlockEntity
    • collectImplicitComponents

      protected void collectImplicitComponents(net.minecraft.core.component.DataComponentMap.Builder componentBuilder)
      Overrides:
      collectImplicitComponents in class net.minecraft.world.level.block.entity.BlockEntity
    • removeComponentsFromTag

      public void removeComponentsFromTag(net.minecraft.nbt.CompoundTag itemStackTag)
      Overrides:
      removeComponentsFromTag in class net.minecraft.world.level.block.entity.BlockEntity