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 VoxelShapeBASEprivate DyeColorcolorprotected static VoxelShapeEAST_SHAPEprotected static VoxelShapeLEG_NORTH_EASTprotected static VoxelShapeLEG_NORTH_WESTprotected static VoxelShapeLEG_SOUTH_EASTprotected static VoxelShapeLEG_SOUTH_WESTprotected static VoxelShapeNORTH_SHAPEstatic BooleanPropertyOCCUPIEDstatic EnumProperty<BedPart>PARTprotected static VoxelShapeSOUTH_SHAPEprotected static VoxelShapeWEST_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 voidbounceUp(Entity p_226860_1_)static booleancanSetSpawn(World p_235330_0_)protected voidcreateBlockStateDefinition(StateContainer.Builder<Block,BlockState> p_206840_1_)voidfallOn(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 DirectiongetBedOrientation(IBlockReader p_220174_0_, BlockPos p_220174_1_)static TileEntityMerger.TypegetBlockType(BlockState p_226863_0_)DyeColorgetColor()static DirectiongetConnectedDirection(BlockState p_226862_0_)private static DirectiongetNeighbourDirection(BedPart p_208070_0_, Direction p_208070_1_)PushReactiongetPistonPushReaction(BlockState p_149656_1_)BlockRenderTypegetRenderShape(BlockState p_149645_1_)longgetSeed(BlockState p_209900_1_, BlockPos p_209900_2_)VoxelShapegetShape(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_)BlockStategetStateForPlacement(BlockItemUseContext p_196258_1_)private static booleanisBunkBed(IBlockReader p_242657_0_, BlockPos p_242657_1_)booleanisPathfindable(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_)private booleankickVillagerOutOfBed(World p_226861_1_, BlockPos p_226861_2_)TileEntitynewBlockEntity(IBlockReader p_196283_1_)voidplayerWillDestroy(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_)voidsetPlacedBy(World p_180633_1_, BlockPos p_180633_2_, BlockState p_180633_3_, LivingEntity p_180633_4_, ItemStack p_180633_5_)voidupdateEntityAfterFallOn(IBlockReader p_176216_1_, Entity p_176216_2_)BlockStateupdateShape(BlockState p_196271_1_, Direction p_196271_2_, BlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_)ActionResultTypeuse(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:
usein 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:
updateEntityAfterFallOnin 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:
updateShapein 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:
playerWillDestroyin classBlock
-
getStateForPlacement
@Nullable public BlockState getStateForPlacement(BlockItemUseContext p_196258_1_)
- Overrides:
getStateForPlacementin classBlock
-
getShape
public VoxelShape getShape(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_)
- Overrides:
getShapein 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:
getPistonPushReactionin classAbstractBlock
-
getRenderShape
public BlockRenderType getRenderShape(BlockState p_149645_1_)
- Overrides:
getRenderShapein classAbstractBlock
-
createBlockStateDefinition
protected void createBlockStateDefinition(StateContainer.Builder<Block,BlockState> p_206840_1_)
- Overrides:
createBlockStateDefinitionin classBlock
-
newBlockEntity
public TileEntity newBlockEntity(IBlockReader p_196283_1_)
- Specified by:
newBlockEntityin 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:
setPlacedByin classBlock
-
getColor
public DyeColor getColor()
-
getSeed
public long getSeed(BlockState p_209900_1_, BlockPos p_209900_2_)
- Overrides:
getSeedin classAbstractBlock
-
isPathfindable
public boolean isPathfindable(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_)
- Overrides:
isPathfindablein 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_)
-
-