Class StructureBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.StructureBlockEntity
- All Implemented Interfaces:
IAttachmentHolder
,IBlockEntityExtension
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.ComponentHelper, BlockEntity.DataComponentInput
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
static final String
private boolean
private float
static final int
static final int
private String
private Mirror
private StructureMode
private boolean
private Rotation
private static final int
private long
private boolean
private boolean
private ResourceLocation
private BlockPos
private Vec3i
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 -
Method Summary
Modifier and TypeMethodDescriptionprivate static Optional
<BoundingBox> calculateEnclosingBoundingBox
(BlockPos pPos, Stream<BlockPos> pRelatedCorners) void
createdBy
(LivingEntity pAuthor) static RandomSource
createRandom
(long pSeed) boolean
float
getMode()
getRelatedCorners
(BlockPos pMinPos, BlockPos pMaxPos) long
getSeed()
boolean
boolean
private StructureTemplate
getStructureTemplate
(ServerLevel pLevel) getUpdateTag
(HolderLookup.Provider pRegistries) boolean
boolean
boolean
boolean
protected void
loadAdditional
(CompoundTag pTag, HolderLookup.Provider pRegistries) boolean
loadStructureInfo
(ServerLevel pLevel) private void
loadStructureInfo
(StructureTemplate pStructureTemplate) void
placeStructure
(ServerLevel pLevel) private void
placeStructure
(ServerLevel pLevel, StructureTemplate pStructureTemplate) boolean
placeStructureIfSameSize
(ServerLevel pLevel) protected void
saveAdditional
(CompoundTag pTag, HolderLookup.Provider pRegistries) boolean
boolean
saveStructure
(boolean pWriteToDisk) Saves the template, either updating the local version or writing it to disk.void
setIgnoreEntities
(boolean pIgnoreEntities) void
setIntegrity
(float pIntegrity) void
setMetaData
(String pMetaData) void
void
setMode
(StructureMode pMode) void
setPowered
(boolean pPowered) void
setRotation
(Rotation pRotation) void
setSeed
(long pSeed) void
setShowAir
(boolean pShowAir) void
setShowBoundingBox
(boolean pShowBoundingBox) void
setStructureName
(String pStructureName) void
setStructureName
(ResourceLocation pStructureName) void
setStructurePos
(BlockPos pStructurePos) void
setStructureSize
(Vec3i pStructureSize) void
private void
boolean
Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, 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, getExistingDataOrNull, 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, getExistingData, getExistingDataOrNull, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
-
Field Details
-
SCAN_CORNER_BLOCKS_RANGE
private static final int SCAN_CORNER_BLOCKS_RANGE- See Also:
-
MAX_OFFSET_PER_AXIS
public static final int MAX_OFFSET_PER_AXIS- See Also:
-
MAX_SIZE_PER_AXIS
public static final int MAX_SIZE_PER_AXIS- See Also:
-
AUTHOR_TAG
- See Also:
-
structureName
-
author
-
metaData
-
structurePos
-
structureSize
-
mirror
-
rotation
-
mode
-
ignoreEntities
private boolean ignoreEntities -
powered
private boolean powered -
showAir
private boolean showAir -
showBoundingBox
private boolean showBoundingBox -
integrity
private float integrity -
seed
private long seed
-
-
Constructor Details
-
StructureBlockEntity
-
-
Method Details
-
saveAdditional
- Overrides:
saveAdditional
in classBlockEntity
-
loadAdditional
- Overrides:
loadAdditional
in classBlockEntity
-
updateBlockState
private void updateBlockState() -
getUpdatePacket
- Overrides:
getUpdatePacket
in classBlockEntity
-
getUpdateTag
- Overrides:
getUpdateTag
in classBlockEntity
-
usedBy
-
getStructureName
-
hasStructureName
public boolean hasStructureName() -
setStructureName
-
setStructureName
-
createdBy
-
getStructurePos
-
setStructurePos
-
getStructureSize
-
setStructureSize
-
getMirror
-
setMirror
-
getRotation
-
setRotation
-
getMetaData
-
setMetaData
-
getMode
-
setMode
-
isIgnoreEntities
public boolean isIgnoreEntities() -
setIgnoreEntities
public void setIgnoreEntities(boolean pIgnoreEntities) -
getIntegrity
public float getIntegrity() -
setIntegrity
public void setIntegrity(float pIntegrity) -
getSeed
public long getSeed() -
setSeed
public void setSeed(long pSeed) -
detectSize
public boolean detectSize() -
getRelatedCorners
-
calculateEnclosingBoundingBox
private static Optional<BoundingBox> calculateEnclosingBoundingBox(BlockPos pPos, Stream<BlockPos> pRelatedCorners) -
saveStructure
public boolean saveStructure() -
saveStructure
public boolean saveStructure(boolean pWriteToDisk) Saves the template, either updating the local version or writing it to disk.- Returns:
- true if the template was successfully saved.
-
createRandom
-
placeStructureIfSameSize
-
loadStructureInfo
-
loadStructureInfo
-
placeStructure
-
getStructureTemplate
-
placeStructure
-
unloadStructure
public void unloadStructure() -
isStructureLoadable
public boolean isStructureLoadable() -
isPowered
public boolean isPowered() -
setPowered
public void setPowered(boolean pPowered) -
getShowAir
public boolean getShowAir() -
setShowAir
public void setShowAir(boolean pShowAir) -
getShowBoundingBox
public boolean getShowBoundingBox() -
setShowBoundingBox
public void setShowBoundingBox(boolean pShowBoundingBox)
-