Package net.minecraft.world.level.block
Class MultifaceBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.MultifaceBlock
- All Implemented Interfaces:
FeatureElement
,ItemLike
,IBlockExtension
- Direct Known Subclasses:
GlowLichenBlock
,SculkVeinBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.BlockStatePairKey
Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final float
private final boolean
private final boolean
private final boolean
protected static final Direction[]
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
private static final Map
<Direction, BooleanProperty> private static final Map
<Direction, VoxelShape> private final com.google.common.collect.ImmutableMap
<BlockState, VoxelShape> private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
Fields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, CODEC, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SUPPRESS_DROPS
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDER
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionavailableFaces
(BlockState pState) private static VoxelShape
calculateMultifaceShape
(BlockState p_153959_) static boolean
canAttachTo
(BlockGetter pLevel, Direction pDirection, BlockPos pPos, BlockState pState) protected boolean
canBeReplaced
(BlockState pState, BlockPlaceContext pUseContext) protected boolean
canSurvive
(BlockState pState, LevelReader pLevel, BlockPos pPos) protected abstract com.mojang.serialization.MapCodec
<? extends MultifaceBlock> codec()
protected void
private static BlockState
getDefaultMultifaceState
(StateDefinition<Block, BlockState> pStateDefinition) static BooleanProperty
getFaceProperty
(Direction pDirection) protected VoxelShape
getShape
(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) abstract MultifaceSpreader
getStateForPlacement
(BlockPlaceContext pContext) getStateForPlacement
(BlockState pCurrentState, BlockGetter pLevel, BlockPos pPos, Direction pLookingDirection) protected static boolean
hasAnyFace
(BlockState pState) private static boolean
hasAnyVacantFace
(BlockState pState) static boolean
hasFace
(BlockState pState, Direction pDirection) protected boolean
isFaceSupported
(Direction p_153921_) boolean
isValidStateForPlacement
(BlockGetter pLevel, BlockState pState, BlockPos pPos, Direction pDirection) private boolean
private BlockState
mapDirections
(BlockState pState, Function<Direction, Direction> pDirectionalFunction) protected BlockState
mirror
(BlockState pState, Mirror pMirror) Returns the blockstate with the given mirror of the passed blockstate.static byte
pack
(Collection<Direction> pDirections) private static BlockState
removeFace
(BlockState pState, BooleanProperty pFaceProp) protected BlockState
rotate
(BlockState pState, Rotation pRotation) Returns the blockstate with the given rotation from the passed blockstate.unpack
(byte pPackedDirections) protected BlockState
updateShape
(BlockState pState, Direction pDirection, BlockState pNeighborState, LevelAccessor pLevel, BlockPos pPos, BlockPos pNeighborPos) Update the provided state given the provided neighbor direction and neighbor state, returning a new state.Methods inherited from class net.minecraft.world.level.block.Block
animateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isPathfindable, isRandomlyTicking, isSignalSource, neighborChanged, onExplosionHit, onPlace, onProjectileHit, onRemove, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, simpleCodec, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, useItemOn, useShapeForLightOcclusion, useWithoutItem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, canSustainPlant, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHiding
-
Field Details
-
AABB_OFFSET
private static final float AABB_OFFSET- See Also:
-
UP_AABB
-
DOWN_AABB
-
WEST_AABB
-
EAST_AABB
-
NORTH_AABB
-
SOUTH_AABB
-
PROPERTY_BY_DIRECTION
-
SHAPE_BY_DIRECTION
-
DIRECTIONS
-
shapesCache
-
canRotate
private final boolean canRotate -
canMirrorX
private final boolean canMirrorX -
canMirrorZ
private final boolean canMirrorZ
-
-
Constructor Details
-
MultifaceBlock
-
-
Method Details
-
codec
-
availableFaces
-
unpack
-
pack
-
isFaceSupported
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinition
in classBlock
-
updateShape
protected BlockState updateShape(BlockState pState, Direction pDirection, BlockState pNeighborState, LevelAccessor pLevel, BlockPos pPos, BlockPos pNeighborPos) Update the provided state given the provided neighbor direction and neighbor state, returning a new state. For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately returns its solidified counterpart. Note that this method should ideally consider only the specific direction passed in.- Overrides:
updateShape
in classBlockBehaviour
-
getShape
protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) - Overrides:
getShape
in classBlockBehaviour
-
canSurvive
- Overrides:
canSurvive
in classBlockBehaviour
-
canBeReplaced
- Overrides:
canBeReplaced
in classBlockBehaviour
-
getStateForPlacement
- Overrides:
getStateForPlacement
in classBlock
-
isValidStateForPlacement
public boolean isValidStateForPlacement(BlockGetter pLevel, BlockState pState, BlockPos pPos, Direction pDirection) -
getStateForPlacement
@Nullable public BlockState getStateForPlacement(BlockState pCurrentState, BlockGetter pLevel, BlockPos pPos, Direction pLookingDirection) -
rotate
Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
rotate
in classBlockBehaviour
-
mirror
Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
mirror
in classBlockBehaviour
-
mapDirections
private BlockState mapDirections(BlockState pState, Function<Direction, Direction> pDirectionalFunction) -
hasFace
-
canAttachTo
public static boolean canAttachTo(BlockGetter pLevel, Direction pDirection, BlockPos pPos, BlockState pState) -
isWaterloggable
private boolean isWaterloggable() -
removeFace
-
getFaceProperty
-
getDefaultMultifaceState
private static BlockState getDefaultMultifaceState(StateDefinition<Block, BlockState> pStateDefinition) -
calculateMultifaceShape
-
hasAnyFace
-
hasAnyVacantFace
-
getSpreader
-