public class BedBlock extends HorizontalFacingBlock implements BlockEntityProvider
Block.NeighborGroup
AbstractBlock.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 |
FACING
LOGGER, STATE_IDS, stateManager
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Constructor and Description |
---|
BedBlock(DyeColor color,
AbstractBlock.Settings settings) |
mirror, rotate
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
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
public 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 AbstractBlock
public static boolean isOverworld(World world)
public void onLandedUpon(World world, BlockPos pos, Entity entity, float distance)
onLandedUpon
in class Block
public void onEntityLand(BlockView world, Entity entity)
onEntityLand
in class Block
private void bounceEntity(Entity entity)
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
getStateForNeighborUpdate
in class AbstractBlock
private 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 Block
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getOutlineShape
in class AbstractBlock
public 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 AbstractBlock
public BlockRenderType getRenderType(BlockState state)
getRenderType
in class AbstractBlock
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block
public BlockEntity createBlockEntity(BlockView world)
createBlockEntity
in interface BlockEntityProvider
public 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 AbstractBlock
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
canPathfindThrough
in class AbstractBlock
private static int[][] method_30837(Direction direction)