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.NeighborGroupNested 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 DyeColorcolorprotected static VoxelShapeEAST_SHAPEprotected static VoxelShapeLEG_1_SHAPEprotected static VoxelShapeLEG_2_SHAPEprotected static VoxelShapeLEG_3_SHAPEprotected static VoxelShapeLEG_4_SHAPEprotected static VoxelShapeNORTH_SHAPEstatic BooleanPropertyOCCUPIEDstatic EnumProperty<BedPart>PARTprotected static VoxelShapeSOUTH_SHAPEprotected static VoxelShapeTOP_SHAPEprotected static VoxelShapeWEST_SHAPEFields inherited from class net.minecraft.block.HorizontalFacingBlock
FACINGFields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManagerFields 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, rotateMethods 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, isFaceFullSquare, isShapeFullCube, isTranslucent, onBroken, onDestroyedByExplosion, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getLootTableId, getMaxModelOffset, getOffsetType, getOpacity, getRaycastShape, getSidesShape, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasComparatorOutput, hasSidedTransparency, isSideInvisible, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick, scheduledTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.block.BlockEntityProvider
getGameEventListener, getTicker
-
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:
onUsein classAbstractBlock- Returns:
- an action result that specifies if using the block was successful.
-
isOverworld
-
isFree
-
onLandedUpon
- Overrides:
onLandedUponin classBlock
-
onEntityLand
- Overrides:
onEntityLandin classBlock
-
bounceEntity
-
getStateForNeighborUpdate
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)- Overrides:
getStateForNeighborUpdatein classAbstractBlock
-
getDirectionTowardsOtherPart
-
onBreak
-
getPlacementState
- Overrides:
getPlacementStatein classBlock
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShapein classAbstractBlock
-
getOppositePartDirection
-
getBedPart
-
isBed
-
findWakeUpPosition
public static Optional<Vec3d> findWakeUpPosition(EntityType<?> type, CollisionView world, 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:
getPistonBehaviorin classAbstractBlock
-
getRenderType
- Overrides:
getRenderTypein classAbstractBlock
-
appendProperties
- Overrides:
appendPropertiesin classBlock
-
createBlockEntity
- Specified by:
createBlockEntityin interfaceBlockEntityProvider
-
onPlaced
public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) -
getColor
-
getRenderingSeed
- Overrides:
getRenderingSeedin classAbstractBlock
-
method_30838
-
method_30840
-
method_30837
-