Package net.minecraft.block
Class BedBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.HorizontalFacingBlock
net.minecraft.block.BedBlock
- All Implemented Interfaces:
BlockEntityProvider
,ItemConvertible
public class BedBlock extends HorizontalFacingBlock implements BlockEntityProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroup
Nested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
-
Field Summary
Fields Modifier and Type Field Description private DyeColor
color
protected static VoxelShape
EAST_SHAPE
protected static VoxelShape
LEG_1_SHAPE
protected static VoxelShape
LEG_2_SHAPE
protected static VoxelShape
LEG_3_SHAPE
protected static VoxelShape
LEG_4_SHAPE
protected static VoxelShape
NORTH_SHAPE
static BooleanProperty
OCCUPIED
static EnumProperty<BedPart>
PART
protected static VoxelShape
SOUTH_SHAPE
protected static VoxelShape
TOP_SHAPE
protected static VoxelShape
WEST_SHAPE
Fields inherited from class net.minecraft.block.HorizontalFacingBlock
FACING
Fields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManager
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
-
Constructor Summary
Constructors Constructor Description BedBlock(DyeColor color, AbstractBlock.Settings settings)
-
Method Summary
Methods inherited from class net.minecraft.block.HorizontalFacingBlock
mirror, rotate
Methods inherited from class net.minecraft.block.Block
addStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBroken, onDestroyedByExplosion, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getRaycastShape, getSidesShape, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick, scheduledTick
-
Field Details
-
PART
-
OCCUPIED
-
TOP_SHAPE
-
LEG_1_SHAPE
-
LEG_2_SHAPE
-
LEG_3_SHAPE
-
LEG_4_SHAPE
-
NORTH_SHAPE
-
SOUTH_SHAPE
-
WEST_SHAPE
-
EAST_SHAPE
-
color
-
-
Constructor Details
-
BedBlock
-
-
Method Details
-
getDirection
-
onUse
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)Called when this block is used by a player. This, by default, is bound to using the right mouse button.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
world.isClient()
.If the action result is successful on a logical client, then the action will be sent to the logical server for processing.
- Overrides:
onUse
in classAbstractBlock
- Returns:
- an action result that specifies if using the block was successful.
-
isOverworld
-
isFree
-
onLandedUpon
- Overrides:
onLandedUpon
in classBlock
-
onEntityLand
- Overrides:
onEntityLand
in classBlock
-
bounceEntity
-
getStateForNeighborUpdate
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)- Overrides:
getStateForNeighborUpdate
in classAbstractBlock
-
getDirectionTowardsOtherPart
-
onBreak
-
getPlacementState
- Overrides:
getPlacementState
in classBlock
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShape
in classAbstractBlock
-
getOppositePartDirection
-
getBedPart
-
method_30839
-
findWakeUpPosition
public static Optional<Vec3d> findWakeUpPosition(EntityType<?> type, CollisionView collisionView, BlockPos pos, float float2) -
method_30835
private static Optional<Vec3d> method_30835(EntityType<?> entityType, CollisionView collisionView, BlockPos blockPos, Direction direction, Direction direction2) -
method_30836
private static Optional<Vec3d> method_30836(EntityType<?> entityType, CollisionView collisionView, BlockPos blockPos, int[][] int2, boolean bool) -
getPistonBehavior
- Overrides:
getPistonBehavior
in classAbstractBlock
-
getRenderType
- Overrides:
getRenderType
in classAbstractBlock
-
appendProperties
- Overrides:
appendProperties
in classBlock
-
createBlockEntity
- Specified by:
createBlockEntity
in interfaceBlockEntityProvider
-
onPlaced
public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) -
getColor
-
getRenderingSeed
- Overrides:
getRenderingSeed
in classAbstractBlock
-
method_30838
-
method_30840
-
method_30837
-