Package net.minecraft.world.level.block
Class BedBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.HorizontalDirectionalBlock
net.minecraft.world.level.block.BedBlock
- All Implemented Interfaces:
FeatureElement,EntityBlock,ItemLike,IBlockExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.ShapePairKeyNested 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 TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<BedBlock> private final DyeColorstatic final BooleanPropertystatic final EnumProperty<BedPart> private static final Map<Direction, VoxelShape> Fields inherited from class net.minecraft.world.level.block.HorizontalDirectionalBlock
FACINGFields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, 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_SKIP_ALL_SIDEEFFECTS, UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS, UPDATE_SKIP_ON_PLACE, UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE, UPDATE_SUPPRESS_DROPSFields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
descriptionId, drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int[][]private static int[][]bedStandUpOffsets(Direction pFirstDir, Direction pSecondDir) private static int[][]bedSurroundStandUpOffsets(Direction pFirstDir, Direction pSecondDir) private voidstatic booleancanSetSpawn(Level pLevel) com.mojang.serialization.MapCodec<BedBlock> codec()protected voidvoidfallOn(Level pLevel, BlockState pState, BlockPos pPos, Entity pEntity, double pFallDistance) findBunkBedStandUpPosition(EntityType<?> pEntityType, CollisionGetter pCollisionGetter, BlockPos pPos, Direction pStateFacing, Direction pEntityFacing) findStandUpPosition(EntityType<?> pEntityType, CollisionGetter pCollisionGetter, BlockPos pPos, Direction pDirection, float pYRot) findStandUpPositionAtOffset(EntityType<?> pEntityType, CollisionGetter pCollisionGetter, BlockPos pPos, int[][] pOffsets, boolean pSimulate) static DirectiongetBedOrientation(BlockGetter pLevel, BlockPos pPos) getBlockType(BlockState pState) getColor()static DirectiongetConnectedDirection(BlockState pState) private static DirectiongetNeighbourDirection(BedPart pPart, Direction pDirection) Given a bed part and the direction it's facing, find the direction to move to get the other bed partprotected longgetSeed(BlockState pState, BlockPos pPos) Return a random long to be passed to, used for random model rotationsinvalid reference
net.minecraft.client.resources.model.BakedModel#getQuadsprotected VoxelShapegetShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) getStateForPlacement(BlockPlaceContext pContext) private static booleanisBunkBed(BlockGetter pLevel, BlockPos pPos) protected booleanisPathfindable(BlockState pState, PathComputationType pPathComputationType) private booleankickVillagerOutOfBed(Level pLevel, BlockPos pPos) newBlockEntity(BlockPos pPos, BlockState pState) playerWillDestroy(Level pLevel, BlockPos pPos, BlockState pState, Player pPlayer) voidsetPlacedBy(Level pLevel, BlockPos pPos, BlockState pState, LivingEntity pPlacer, ItemStack pStack) Called by BlockItem after this block has been placed.voidupdateEntityMovementAfterFallOn(BlockGetter pLevel, Entity pEntity) protected BlockStateupdateShape(BlockState pState, LevelReader pLevel, ScheduledTickAccess pScheduledTickAccess, BlockPos pPos, Direction pDirection, BlockPos pNeighborPos, BlockState pNeighborState, RandomSource pRandom) protected InteractionResultuseWithoutItem(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, BlockHitResult pHitResult) Methods inherited from class net.minecraft.world.level.block.HorizontalDirectionalBlock
mirror, rotateMethods inherited from class net.minecraft.world.level.block.Block
animateTick, asBlock, asItem, box, boxes, boxZ, boxZ, boxZ, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, column, column, cube, cube, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getShapeForEachState, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, shouldRenderFace, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
affectNeighborsAfterRemoval, attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCloneItemStack, getCollisionShape, getDescriptionId, getDestroyProgress, getDirectSignal, getDrops, getEntityInsideCollisionShape, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getShadeBrightness, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isRandomlyTicking, isSignalSource, neighborChanged, onExplosionHit, onPlace, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, simpleCodec, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, useItemOn, useShapeForLightOcclusionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.block.EntityBlock
getListener, getTickerMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods 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, ignitedByLava, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, playFallSound, playStepSound, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHiding
-
Field Details
-
CODEC
-
PART
-
OCCUPIED
-
SHAPES
-
color
-
-
Constructor Details
-
BedBlock
-
-
Method Details
-
codec
- Specified by:
codecin classHorizontalDirectionalBlock
-
getBedOrientation
-
useWithoutItem
protected InteractionResult useWithoutItem(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, BlockHitResult pHitResult) - Overrides:
useWithoutItemin classBlockBehaviour
-
canSetSpawn
-
kickVillagerOutOfBed
-
fallOn
public void fallOn(Level pLevel, BlockState pState, BlockPos pPos, Entity pEntity, double pFallDistance) -
updateEntityMovementAfterFallOn
- Overrides:
updateEntityMovementAfterFallOnin classBlock
-
bounceUp
-
updateShape
protected BlockState updateShape(BlockState pState, LevelReader pLevel, ScheduledTickAccess pScheduledTickAccess, BlockPos pPos, Direction pDirection, BlockPos pNeighborPos, BlockState pNeighborState, RandomSource pRandom) - Overrides:
updateShapein classBlockBehaviour
-
getNeighbourDirection
Given a bed part and the direction it's facing, find the direction to move to get the other bed part -
playerWillDestroy
- Overrides:
playerWillDestroyin classBlock
-
getStateForPlacement
- Overrides:
getStateForPlacementin classBlock
-
getShape
protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) - Overrides:
getShapein classBlockBehaviour
-
getConnectedDirection
-
getBlockType
-
isBunkBed
-
findStandUpPosition
public static Optional<Vec3> findStandUpPosition(EntityType<?> pEntityType, CollisionGetter pCollisionGetter, BlockPos pPos, Direction pDirection, float pYRot) -
findBunkBedStandUpPosition
private static Optional<Vec3> findBunkBedStandUpPosition(EntityType<?> pEntityType, CollisionGetter pCollisionGetter, BlockPos pPos, Direction pStateFacing, Direction pEntityFacing) -
findStandUpPositionAtOffset
private static Optional<Vec3> findStandUpPositionAtOffset(EntityType<?> pEntityType, CollisionGetter pCollisionGetter, BlockPos pPos, int[][] pOffsets, boolean pSimulate) -
createBlockStateDefinition
- Overrides:
createBlockStateDefinitionin classBlock
-
newBlockEntity
- Specified by:
newBlockEntityin interfaceEntityBlock
-
setPlacedBy
public void setPlacedBy(Level pLevel, BlockPos pPos, BlockState pState, @Nullable LivingEntity pPlacer, ItemStack pStack) Called by BlockItem after this block has been placed.- Overrides:
setPlacedByin classBlock
-
getColor
-
getSeed
Return a random long to be passed to, used for random model rotationsinvalid reference
net.minecraft.client.resources.model.BakedModel#getQuads- Overrides:
getSeedin classBlockBehaviour
-
isPathfindable
- Overrides:
isPathfindablein classBlockBehaviour
-
bedStandUpOffsets
-
bedSurroundStandUpOffsets
-
bedAboveStandUpOffsets
-