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, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class BlockEntityTagSubstitution extends net.minecraft.world.level.block.entity.BlockEntity implements IBlueprintDataProviderBE
The block entity for BlockTagSubstitution
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Storage for information about the replacement block, if any.

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

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

    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
    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.
     
    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
     
    void
    load(@NotNull net.minecraft.nbt.CompoundTag compound)
     
    void
    onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet)
     
    void
    saveAdditional(@NotNull net.minecraft.nbt.CompoundTag compound)
     
    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, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onlyOpCanSetNbt, removeData, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setData, setLevel, setRemoved, triggerEvent

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

    areAttachmentsCompatible, deserializeAttachments, getData, 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, hasData, removeData, setData

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

    deserializeNBT, getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onLoad, requestModelDataUpdate, serializeNBT
  • 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 BlockEntityTagSubstitution.ReplacementBlock getReplacement()
      Returns:
      the replacement block details
    • load

      public void load(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Overrides:
      load in class net.minecraft.world.level.block.entity.BlockEntity
    • saveAdditional

      public void saveAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • 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()
      Overrides:
      getUpdateTag in class net.minecraft.world.level.block.entity.BlockEntity
    • onDataPacket

      public void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet)
      Specified by:
      onDataPacket in interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension