public class BedBlock extends HorizontalFacingBlock implements BlockEntityProvider
Block.NeighborGroupAbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>| Modifier and Type | Field and 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 |
FACINGLOGGER, STATE_IDS, stateManagercollidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier| Constructor and Description |
|---|
BedBlock(DyeColor color,
AbstractBlock.Settings settings) |
mirror, rotateaddStacksForDisplay, 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, toStringcalcBlockBreakingDelta, 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, scheduledTickpublic static final EnumProperty<BedPart> PART
public static final BooleanProperty OCCUPIED
protected static final VoxelShape TOP_SHAPE
protected static final VoxelShape LEG_1_SHAPE
protected static final VoxelShape LEG_2_SHAPE
protected static final VoxelShape LEG_3_SHAPE
protected static final VoxelShape LEG_4_SHAPE
protected static final VoxelShape NORTH_SHAPE
protected static final VoxelShape SOUTH_SHAPE
protected static final VoxelShape WEST_SHAPE
protected static final VoxelShape EAST_SHAPE
private final DyeColor color
public BedBlock(DyeColor color, AbstractBlock.Settings settings)
@Environment(value=CLIENT) @Nullable public static Direction getDirection(BlockView world, BlockPos pos)
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)
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.
onUse in class AbstractBlockpublic static boolean isOverworld(World world)
public void onLandedUpon(World world, BlockPos pos, Entity entity, float distance)
onLandedUpon in class Blockpublic void onEntityLand(BlockView world, Entity entity)
onEntityLand in class Blockprivate void bounceEntity(Entity entity)
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
getStateForNeighborUpdate in class AbstractBlockprivate static Direction getDirectionTowardsOtherPart(BedPart part, Direction direction)
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player)
@Nullable public BlockState getPlacementState(ItemPlacementContext ctx)
getPlacementState in class Blockpublic VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getOutlineShape in class AbstractBlockpublic static Direction getOppositePartDirection(BlockState state)
@Environment(value=CLIENT) public static DoubleBlockProperties.Type getBedPart(BlockState state)
public static Optional<Vec3d> findWakeUpPosition(EntityType<?> type, CollisionView collisionView, BlockPos pos, float float2)
private static Optional<Vec3d> method_30835(EntityType<?> entityType, CollisionView collisionView, BlockPos blockPos, Direction direction, Direction direction2)
private static Optional<Vec3d> method_30836(EntityType<?> entityType, CollisionView collisionView, BlockPos blockPos, int[][] int2, boolean bool)
public PistonBehavior getPistonBehavior(BlockState state)
getPistonBehavior in class AbstractBlockpublic BlockRenderType getRenderType(BlockState state)
getRenderType in class AbstractBlockprotected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties in class Blockpublic BlockEntity createBlockEntity(BlockView world)
createBlockEntity in interface BlockEntityProviderpublic void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack)
@Environment(value=CLIENT) public DyeColor getColor()
@Environment(value=CLIENT) public long getRenderingSeed(BlockState state, BlockPos pos)
getRenderingSeed in class AbstractBlockpublic boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
canPathfindThrough in class AbstractBlockprivate static int[][] method_30837(Direction direction)