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:
TypedInstance<BlockEntityType<?>>, DebugValueSource, BoundingBoxRenderable, IAttachmentHolder, IBlockEntityExtension
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface BoundingBoxRenderable
BoundingBoxRenderable.Mode, BoundingBoxRenderable.RenderableBoxNested classes/interfaces inherited from interface DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringstatic final Stringprivate static final Stringprivate static final booleanprivate static final floatprivate static final Stringprivate static final Mirrorprivate static final BlockPosprivate static final booleanprivate static final Rotationprivate static final longprivate static final booleanprivate static final booleanprivate static final Vec3iprivate static final booleanprivate booleanprivate floatstatic final intstatic final intprivate Stringprivate Mirrorprivate StructureModeprivate booleanprivate Rotationprivate static final intprivate longprivate booleanprivate booleanprivate booleanprivate @Nullable Identifierprivate BlockPosprivate Vec3iFields inherited from class BlockEntity
level, remove, worldPositionFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Optional<BoundingBox> calculateEnclosingBoundingBox(BlockPos pos, Stream<BlockPos> relatedCorners) voidcreatedBy(LivingEntity creator) static RandomSourcecreateRandom(long seed) booleanfloatgetMode()getRelatedCorners(BlockPos corner1, BlockPos corner2) longgetSeed()booleanbooleanprivate @Nullable StructureTemplategetStructureTemplate(ServerLevel level) getUpdateTag(HolderLookup.Provider registries) booleanbooleanbooleanbooleanisStrict()booleanprotected voidloadAdditional(ValueInput input) booleanloadStructureInfo(ServerLevel level) private voidloadStructureInfo(StructureTemplate structureTemplate) voidplaceStructure(ServerLevel level) private voidplaceStructure(ServerLevel level, StructureTemplate template) booleanprotected voidsaveAdditional(ValueOutput output) booleanbooleansaveStructure(boolean saveToDisk) Saves the template, either updating the local version or writing it to disk.static booleansaveStructure(ServerLevel level, Identifier structureName, BlockPos pos, Vec3i structureSize, boolean ignoreEntities, String author, boolean saveToDisk, List<Block> ignoreBlocks) voidsetIgnoreEntities(boolean ignoreEntities) voidsetIntegrity(float integrity) voidsetMetaData(String metaData) voidvoidsetMode(StructureMode mode) voidsetPowered(boolean powered) voidsetRotation(Rotation rotation) voidsetSeed(long seed) voidsetShowAir(boolean showAir) voidsetShowBoundingBox(boolean showBoundingBox) voidsetStrict(boolean strict) voidsetStructureName(@Nullable String structureName) voidsetStructureName(@Nullable Identifier structureName) voidsetStructurePos(BlockPos structurePos) voidsetStructureSize(Vec3i structureSize) voidprivate voidbooleanMethods inherited from class BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, removeComponentsFromTag, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, syncData, triggerEvent, typeHolderMethods inherited from class AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachmentsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface 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:
-
DEFAULT_AUTHOR
- See Also:
-
DEFAULT_METADATA
- See Also:
-
DEFAULT_POS
-
DEFAULT_SIZE
-
DEFAULT_ROTATION
-
DEFAULT_MIRROR
-
DEFAULT_IGNORE_ENTITIES
private static final boolean DEFAULT_IGNORE_ENTITIES- See Also:
-
DEFAULT_STRICT
private static final boolean DEFAULT_STRICT- See Also:
-
DEFAULT_POWERED
private static final boolean DEFAULT_POWERED- See Also:
-
DEFAULT_SHOW_AIR
private static final boolean DEFAULT_SHOW_AIR- See Also:
-
DEFAULT_SHOW_BOUNDING_BOX
private static final boolean DEFAULT_SHOW_BOUNDING_BOX- See Also:
-
DEFAULT_INTEGRITY
private static final float DEFAULT_INTEGRITY- See Also:
-
DEFAULT_SEED
private static final long DEFAULT_SEED- See Also:
-
structureName
-
author
-
metaData
-
structurePos
-
structureSize
-
mirror
-
rotation
-
mode
-
ignoreEntities
private boolean ignoreEntities -
strict
private boolean strict -
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:
saveAdditionalin classBlockEntity
-
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
updateBlockState
private void updateBlockState() -
getUpdatePacket
- Overrides:
getUpdatePacketin classBlockEntity
-
getUpdateTag
- Overrides:
getUpdateTagin 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() -
isStrict
public boolean isStrict() -
setIgnoreEntities
public void setIgnoreEntities(boolean ignoreEntities) -
setStrict
public void setStrict(boolean strict) -
getIntegrity
public float getIntegrity() -
setIntegrity
public void setIntegrity(float integrity) -
getSeed
public long getSeed() -
setSeed
public void setSeed(long seed) -
detectSize
public boolean detectSize() -
getRelatedCorners
-
calculateEnclosingBoundingBox
private static Optional<BoundingBox> calculateEnclosingBoundingBox(BlockPos pos, Stream<BlockPos> relatedCorners) -
saveStructure
public boolean saveStructure() -
saveStructure
public boolean saveStructure(boolean saveToDisk) Saves the template, either updating the local version or writing it to disk.- Returns:
- true if the template was successfully saved.
-
saveStructure
public static boolean saveStructure(ServerLevel level, Identifier structureName, BlockPos pos, Vec3i structureSize, boolean ignoreEntities, String author, boolean saveToDisk, List<Block> ignoreBlocks) -
createRandom
-
placeStructureIfSameSize
-
loadStructureInfo
-
loadStructureInfo
-
placeStructure
-
getStructureTemplate
-
placeStructure
-
unloadStructure
public void unloadStructure() -
isStructureLoadable
public boolean isStructureLoadable() -
isPowered
public boolean isPowered() -
setPowered
public void setPowered(boolean powered) -
getShowAir
public boolean getShowAir() -
setShowAir
public void setShowAir(boolean showAir) -
getShowBoundingBox
public boolean getShowBoundingBox() -
setShowBoundingBox
public void setShowBoundingBox(boolean showBoundingBox) -
renderMode
- Specified by:
renderModein interfaceBoundingBoxRenderable
-
getRenderableBox
- Specified by:
getRenderableBoxin interfaceBoundingBoxRenderable
-