Package net.minecraft.block
Class BedBlock
- java.lang.Object
-
- All Implemented Interfaces:
ITileEntityProvider
,IItemProvider
,IForgeBlock
,IForgeRegistryEntry<Block>
public class BedBlock extends HorizontalBlock implements ITileEntityProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.RenderSideCacheKey
-
Nested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.IExtendedPositionPredicate<A>, AbstractBlock.IPositionPredicate, AbstractBlock.OffsetType, AbstractBlock.Properties
-
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
-
Field Summary
Fields Modifier and Type Field Description protected static VoxelShape
BASE
private DyeColor
color
protected static VoxelShape
EAST_SHAPE
protected static VoxelShape
LEG_NORTH_EAST
protected static VoxelShape
LEG_NORTH_WEST
protected static VoxelShape
LEG_SOUTH_EAST
protected static VoxelShape
LEG_SOUTH_WEST
protected static VoxelShape
NORTH_SHAPE
static BooleanProperty
OCCUPIED
static EnumProperty<BedPart>
PART
protected static VoxelShape
SOUTH_SHAPE
protected static VoxelShape
WEST_SHAPE
-
Fields inherited from class net.minecraft.block.HorizontalBlock
FACING
-
Fields inherited from class net.minecraft.block.Block
BLOCK_STATE_REGISTRY, LOGGER, RANDOM, stateDefinition
-
Fields inherited from class net.minecraft.block.AbstractBlock
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, material, properties, soundType, speedFactor, UPDATE_SHAPE_ORDER
-
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
-
Constructor Summary
Constructors Constructor Description BedBlock(DyeColor p_i48442_1_, AbstractBlock.Properties p_i48442_2_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int[][]
bedAboveStandUpOffsets(Direction p_242655_0_)
private static int[][]
bedStandUpOffsets(Direction p_242656_0_, Direction p_242656_1_)
private static int[][]
bedSurroundStandUpOffsets(Direction p_242658_0_, Direction p_242658_1_)
private void
bounceUp(Entity p_226860_1_)
static boolean
canSetSpawn(World p_235330_0_)
protected void
createBlockStateDefinition(StateContainer.Builder<Block,BlockState> p_206840_1_)
void
fallOn(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_)
private static java.util.Optional<Vector3d>
findBunkBedStandUpPosition(EntityType<?> p_242653_0_, ICollisionReader p_242653_1_, BlockPos p_242653_2_, Direction p_242653_3_, Direction p_242653_4_)
static java.util.Optional<Vector3d>
findStandUpPosition(EntityType<?> p_242652_0_, ICollisionReader p_242652_1_, BlockPos p_242652_2_, float p_242652_3_)
private static java.util.Optional<Vector3d>
findStandUpPositionAtOffset(EntityType<?> p_242654_0_, ICollisionReader p_242654_1_, BlockPos p_242654_2_, int[][] p_242654_3_, boolean p_242654_4_)
static Direction
getBedOrientation(IBlockReader p_220174_0_, BlockPos p_220174_1_)
static TileEntityMerger.Type
getBlockType(BlockState p_226863_0_)
DyeColor
getColor()
static Direction
getConnectedDirection(BlockState p_226862_0_)
private static Direction
getNeighbourDirection(BedPart p_208070_0_, Direction p_208070_1_)
PushReaction
getPistonPushReaction(BlockState p_149656_1_)
BlockRenderType
getRenderShape(BlockState p_149645_1_)
long
getSeed(BlockState p_209900_1_, BlockPos p_209900_2_)
VoxelShape
getShape(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_)
BlockState
getStateForPlacement(BlockItemUseContext p_196258_1_)
private static boolean
isBunkBed(IBlockReader p_242657_0_, BlockPos p_242657_1_)
boolean
isPathfindable(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_)
private boolean
kickVillagerOutOfBed(World p_226861_1_, BlockPos p_226861_2_)
TileEntity
newBlockEntity(IBlockReader p_196283_1_)
void
playerWillDestroy(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_)
void
setPlacedBy(World p_180633_1_, BlockPos p_180633_2_, BlockState p_180633_3_, LivingEntity p_180633_4_, ItemStack p_180633_5_)
void
updateEntityAfterFallOn(IBlockReader p_176216_1_, Entity p_176216_2_)
BlockState
updateShape(BlockState p_196271_1_, Direction p_196271_2_, BlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_)
ActionResultType
use(BlockState p_225533_1_, World p_225533_2_, BlockPos p_225533_3_, PlayerEntity p_225533_4_, Hand p_225533_5_, BlockRayTraceResult p_225533_6_)
-
Methods inherited from class net.minecraft.block.HorizontalBlock
mirror, rotate
-
Methods inherited from class net.minecraft.block.Block
animateTick, appendHoverText, asBlock, asItem, box, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fillItemCategory, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getHarvestLevel, getHarvestTool, getId, getJumpFactor, getName, getSoundType, getSpeedFactor, getStateDefinition, getTags, handleRain, hasDynamicShape, is, is, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerDestroy, popExperience, popResource, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, shouldRenderFace, stateById, stepOn, toString, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded
-
Methods inherited from class net.minecraft.block.AbstractBlock
attack, canBeReplaced, canBeReplaced, canSurvive, defaultMaterialColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMenuProvider, getOcclusionShape, getOffsetType, getShadeBrightness, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isEntityBlock, isSignalSource, neighborChanged, onPlace, onProjectileHit, onRemove, randomTick, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, useShapeForLightOcclusion
-
Methods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlock
addDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, canBeReplacedByLeaves, canBeReplacedByLogs, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, catchFire, collisionExtendsVertically, createTileEntity, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getBedSpawnPosition, getBlock, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFogColor, getLightValue, getPickBlock, getRespawnPosition, getSlipperiness, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasTileEntity, isAir, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isToolEffective, makesOpenTrapdoorAboveClimbable, observedNeighborChange, onBlockExploded, onNeighborChange, onPlantGrow, removedByPlayer, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay
-
-
-
-
Field Detail
-
PART
public static final EnumProperty<BedPart> PART
-
OCCUPIED
public static final BooleanProperty OCCUPIED
-
BASE
protected static final VoxelShape BASE
-
LEG_NORTH_WEST
protected static final VoxelShape LEG_NORTH_WEST
-
LEG_SOUTH_WEST
protected static final VoxelShape LEG_SOUTH_WEST
-
LEG_NORTH_EAST
protected static final VoxelShape LEG_NORTH_EAST
-
LEG_SOUTH_EAST
protected static final VoxelShape LEG_SOUTH_EAST
-
NORTH_SHAPE
protected static final VoxelShape NORTH_SHAPE
-
SOUTH_SHAPE
protected static final VoxelShape SOUTH_SHAPE
-
WEST_SHAPE
protected static final VoxelShape WEST_SHAPE
-
EAST_SHAPE
protected static final VoxelShape EAST_SHAPE
-
color
private final DyeColor color
-
-
Constructor Detail
-
BedBlock
public BedBlock(DyeColor p_i48442_1_, AbstractBlock.Properties p_i48442_2_)
-
-
Method Detail
-
getBedOrientation
@Nullable public static Direction getBedOrientation(IBlockReader p_220174_0_, BlockPos p_220174_1_)
-
use
public ActionResultType use(BlockState p_225533_1_, World p_225533_2_, BlockPos p_225533_3_, PlayerEntity p_225533_4_, Hand p_225533_5_, BlockRayTraceResult p_225533_6_)
- Overrides:
use
in classAbstractBlock
-
canSetSpawn
public static boolean canSetSpawn(World p_235330_0_)
-
fallOn
public void fallOn(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_)
-
updateEntityAfterFallOn
public void updateEntityAfterFallOn(IBlockReader p_176216_1_, Entity p_176216_2_)
- Overrides:
updateEntityAfterFallOn
in classBlock
-
bounceUp
private void bounceUp(Entity p_226860_1_)
-
updateShape
public BlockState updateShape(BlockState p_196271_1_, Direction p_196271_2_, BlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_)
- Overrides:
updateShape
in classAbstractBlock
-
getNeighbourDirection
private static Direction getNeighbourDirection(BedPart p_208070_0_, Direction p_208070_1_)
-
playerWillDestroy
public void playerWillDestroy(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_)
- Overrides:
playerWillDestroy
in classBlock
-
getStateForPlacement
@Nullable public BlockState getStateForPlacement(BlockItemUseContext p_196258_1_)
- Overrides:
getStateForPlacement
in classBlock
-
getShape
public VoxelShape getShape(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_)
- Overrides:
getShape
in classAbstractBlock
-
getConnectedDirection
public static Direction getConnectedDirection(BlockState p_226862_0_)
-
getBlockType
public static TileEntityMerger.Type getBlockType(BlockState p_226863_0_)
-
isBunkBed
private static boolean isBunkBed(IBlockReader p_242657_0_, BlockPos p_242657_1_)
-
findStandUpPosition
public static java.util.Optional<Vector3d> findStandUpPosition(EntityType<?> p_242652_0_, ICollisionReader p_242652_1_, BlockPos p_242652_2_, float p_242652_3_)
-
findBunkBedStandUpPosition
private static java.util.Optional<Vector3d> findBunkBedStandUpPosition(EntityType<?> p_242653_0_, ICollisionReader p_242653_1_, BlockPos p_242653_2_, Direction p_242653_3_, Direction p_242653_4_)
-
findStandUpPositionAtOffset
private static java.util.Optional<Vector3d> findStandUpPositionAtOffset(EntityType<?> p_242654_0_, ICollisionReader p_242654_1_, BlockPos p_242654_2_, int[][] p_242654_3_, boolean p_242654_4_)
-
getPistonPushReaction
public PushReaction getPistonPushReaction(BlockState p_149656_1_)
- Overrides:
getPistonPushReaction
in classAbstractBlock
-
getRenderShape
public BlockRenderType getRenderShape(BlockState p_149645_1_)
- Overrides:
getRenderShape
in classAbstractBlock
-
createBlockStateDefinition
protected void createBlockStateDefinition(StateContainer.Builder<Block,BlockState> p_206840_1_)
- Overrides:
createBlockStateDefinition
in classBlock
-
newBlockEntity
public TileEntity newBlockEntity(IBlockReader p_196283_1_)
- Specified by:
newBlockEntity
in interfaceITileEntityProvider
-
setPlacedBy
public void setPlacedBy(World p_180633_1_, BlockPos p_180633_2_, BlockState p_180633_3_, @Nullable LivingEntity p_180633_4_, ItemStack p_180633_5_)
- Overrides:
setPlacedBy
in classBlock
-
getColor
public DyeColor getColor()
-
getSeed
public long getSeed(BlockState p_209900_1_, BlockPos p_209900_2_)
- Overrides:
getSeed
in classAbstractBlock
-
isPathfindable
public boolean isPathfindable(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_)
- Overrides:
isPathfindable
in classAbstractBlock
-
bedStandUpOffsets
private static int[][] bedStandUpOffsets(Direction p_242656_0_, Direction p_242656_1_)
-
bedSurroundStandUpOffsets
private static int[][] bedSurroundStandUpOffsets(Direction p_242658_0_, Direction p_242658_1_)
-
bedAboveStandUpOffsets
private static int[][] bedAboveStandUpOffsets(Direction p_242655_0_)
-
-