Interface IHasBoundingBlocks
- All Known Implementing Classes:
SolarCompressorBlockEntity
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Implement for Block Entities tied to Blocks that extend
AbstractPNCBlockWithBoundingBlocks-
Method Summary
Modifier and TypeMethodDescriptionGets theBoundingBlockEntityDatalinked to the implementing block entity which stores all the data relevant to bounding blocks for the block entitydefault booleanReturns if all bounding blocks have been placed
Called incanSurvive()to ensure the main block survival isn't considered until after all bounding blocks have been placeddefault booleanReturns if all bounding blocks have been removed Called inonRemove()to check if bounding blocks need to be removed when the main block is removed, preventing redundant removal of bounding blocksdefault net.minecraft.world.level.block.entity.BlockEntitygetMain(net.minecraft.world.level.block.entity.BlockEntity blockEntity) Finds the main block entity for the passed block entitydefault booleanReturns if the main block is locked from being automatically removed
Called inonRemove()when any bounding blocks are removed.default net.minecraft.core.Vec3iReturns the offset of the calling block entity from the main block entity
An offset of 0,0,0 means the calling block entity is the main block entitydefault booleanisBounding(net.minecraft.world.level.block.entity.BlockEntity blockEntity) Returns if passed block entity is a bounding block entitydefault voidsetBoundingPlaced(boolean boundingPlaced) Sets if all bounding blocks have been placed
Set to true after placing all bounding blocks inplaceBoundingBlocks()default voidsetBoundingRemoved(boolean boundingRemoved) Sets if all bounding blocks have been removed
Set to true after removing all bounding blocks inremoveBoundingBlocks()default voidsetMainBlockRemovalLock(boolean mainBlockRemovalLock) Sets if the main block is locked from being automatically removed
Set inremoveBoundingBlocks()andsetRotation()to true at the start of the methods, and then to false at the end of the methods.default voidsetOffsetFromMain(net.minecraft.core.Vec3i offsetFromMain) Sets the offset of the calling block entity from the main block entity
An offset of 0,0,0 means the calling block entity is the main block entity
-
Method Details
-
getBoundingBlockEntityData
Gets theBoundingBlockEntityDatalinked to the implementing block entity which stores all the data relevant to bounding blocks for the block entity- Returns:
- the
BoundingBlockEntityDatalinked to the implementing block entity
-
getOffsetFromMain
@Nonnull default net.minecraft.core.Vec3i getOffsetFromMain()Returns the offset of the calling block entity from the main block entity
An offset of 0,0,0 means the calling block entity is the main block entity- Returns:
- the offset of the calling block entity from the main block entity
-
setOffsetFromMain
default void setOffsetFromMain(@Nonnull net.minecraft.core.Vec3i offsetFromMain) Sets the offset of the calling block entity from the main block entity
An offset of 0,0,0 means the calling block entity is the main block entity- Parameters:
offsetFromMain- the offset of the calling block entity from the main block entity
-
getBoundingPlaced
default boolean getBoundingPlaced()Returns if all bounding blocks have been placed
Called incanSurvive()to ensure the main block survival isn't considered until after all bounding blocks have been placed- Returns:
- if all bounding blocks have been placed
-
setBoundingPlaced
default void setBoundingPlaced(boolean boundingPlaced) Sets if all bounding blocks have been placed
Set to true after placing all bounding blocks inplaceBoundingBlocks()- Parameters:
boundingPlaced- if all bounding blocks have been placed
-
getBoundingRemoved
default boolean getBoundingRemoved()Returns if all bounding blocks have been removed Called inonRemove()to check if bounding blocks need to be removed when the main block is removed, preventing redundant removal of bounding blocks- Returns:
- if all bounding blocks have been removed
-
setBoundingRemoved
default void setBoundingRemoved(boolean boundingRemoved) Sets if all bounding blocks have been removed
Set to true after removing all bounding blocks inremoveBoundingBlocks()- Parameters:
boundingRemoved- if all bounding blocks have been removed
-
getMainBlockRemovalLock
default boolean getMainBlockRemovalLock()Returns if the main block is locked from being automatically removed
Called inonRemove()when any bounding blocks are removed.- Returns:
- if the main block is locked from being automatically removed
-
setMainBlockRemovalLock
default void setMainBlockRemovalLock(boolean mainBlockRemovalLock) Sets if the main block is locked from being automatically removed
Set inremoveBoundingBlocks()andsetRotation()to true at the start of the methods, and then to false at the end of the methods.- Parameters:
mainBlockRemovalLock- if the main block is locked from being automatically removed
-
isBounding
default boolean isBounding(net.minecraft.world.level.block.entity.BlockEntity blockEntity) Returns if passed block entity is a bounding block entity- Parameters:
blockEntity- block entity to check if a bounding block entity- Returns:
- if passed block entity is a bounding block entity
-
getMain
default net.minecraft.world.level.block.entity.BlockEntity getMain(net.minecraft.world.level.block.entity.BlockEntity blockEntity) Finds the main block entity for the passed block entity- Parameters:
blockEntity- block entity to find the main block entity of- Returns:
- the main block entity of the passed block entity
-