Package net.minecraft.block
Class Block
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
- All Implemented Interfaces:
ItemConvertible
- Direct Known Subclasses:
AbstractFireBlock
,AbstractPlantPartBlock
,AbstractPressurePlateBlock
,AbstractRailBlock
,AirBlock
,BambooBlock
,BambooSaplingBlock
,BarrierBlock
,BlockWithEntity
,BubbleColumnBlock
,CactusBlock
,CakeBlock
,CarpetBlock
,CartographyTableBlock
,CauldronBlock
,ChorusFlowerBlock
,CobwebBlock
,ComposterBlock
,ConnectingBlock
,CoralBlockBlock
,CoralParentBlock
,CraftingTableBlock
,CryingObsidianBlock
,DoorBlock
,EndPortalFrameBlock
,FacingBlock
,FallingBlock
,FarmlandBlock
,FlowerPotBlock
,FluidBlock
,GourdBlock
,GrassPathBlock
,HorizontalConnectingBlock
,HorizontalFacingBlock
,InfestedBlock
,JigsawBlock
,LadderBlock
,LanternBlock
,LeavesBlock
,MagmaBlock
,MushroomBlock
,NetherPortalBlock
,NetherrackBlock
,NoteBlock
,NyliumBlock
,OreBlock
,PillarBlock
,PlantBlock
,RedstoneBlock
,RedstoneLampBlock
,RedstoneOreBlock
,RedstoneWireBlock
,RespawnAnchorBlock
,ScaffoldingBlock
,SlabBlock
,SnowBlock
,SnowyBlock
,SoulSandBlock
,SpongeBlock
,StairsBlock
,StonecutterBlock
,StructureVoidBlock
,SugarCaneBlock
,TargetBlock
,TntBlock
,TorchBlock
,TransparentBlock
,TripwireBlock
,TripwireHookBlock
,TurtleEggBlock
,VineBlock
,WallBlock
,WetSpongeBlock
public class Block extends AbstractBlock implements ItemConvertible
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Block.NeighborGroup
Nested 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 Item
cachedItem
private BlockState
defaultState
private static ThreadLocal<Object2ByteLinkedOpenHashMap<Block.NeighborGroup>>
FACE_CULL_MAP
private static LoadingCache<VoxelShape,Boolean>
FULL_CUBE_SHAPE_CACHE
protected static Logger
LOGGER
static IdList<BlockState>
STATE_IDS
protected StateManager<Block,BlockState>
stateManager
private String
translationKey
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
-
Constructor Summary
Constructors Constructor Description Block(AbstractBlock.Settings settings)
-
Method Summary
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getOutlineShape, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, onUse, prepare, randomTick, rotate, scheduledTick
-
Field Details
-
LOGGER
-
STATE_IDS
-
FULL_CUBE_SHAPE_CACHE
-
FACE_CULL_MAP
-
stateManager
-
defaultState
-
translationKey
-
cachedItem
-
-
Constructor Details
-
Block
-
-
Method Details
-
getRawIdFromState
-
getStateFromRawId
-
getBlockFromItem
-
pushEntitiesUpBeforeBlockChange
public static BlockState pushEntitiesUpBeforeBlockChange(BlockState from, BlockState to, World world, BlockPos pos) -
createCuboidShape
public static VoxelShape createCuboidShape(double xMin, double yMin, double zMin, double xMax, double yMax, double zMax) -
isIn
-
is
-
postProcessState
-
replace
public static void replace(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags)Replaces thestate
with thenewState
at thepos
.If the two state objects are identical, this method does nothing.
If the new state is air, breaks the block at the position instead.
- Parameters:
state
- the existing block statenewState
- the new block stateworld
- the worldpos
- the position of the replaced block stateflags
- the bitwise flags forModifiableWorld.setBlockState(BlockPos, BlockState, int, int)
-
replace
public static void replace(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth)Replaces thestate
with thenewState
at thepos
.If the two state objects are identical, this method does nothing.
If the new state is air, breaks the block at the position instead.
- Parameters:
state
- the existing block statenewState
- the new block stateworld
- the worldpos
- the position of the replaced block stateflags
- the bitwise flags forModifiableWorld.setBlockState(BlockPos, BlockState, int, int)
maxUpdateDepth
- the limit for the cascading block updates
-
cannotConnect
-
hasRandomTicks
-
shouldDrawSide
@Environment(CLIENT) public static boolean shouldDrawSide(BlockState state, BlockView world, BlockPos pos, Direction facing) -
hasTopRim
-
sideCoversSmallSquare
-
isFaceFullSquare
-
isShapeFullCube
-
isTranslucent
-
randomDisplayTick
@Environment(CLIENT) public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) -
onBroken
-
getDroppedStacks
public static List<ItemStack> getDroppedStacks(BlockState state, ServerWorld world, BlockPos pos, @Nullable BlockEntity blockEntity) -
getDroppedStacks
public static List<ItemStack> getDroppedStacks(BlockState state, ServerWorld world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack stack) -
dropStacks
-
dropStacks
public static void dropStacks(BlockState state, WorldAccess world, BlockPos pos, @Nullable BlockEntity blockEntity) -
dropStacks
public static void dropStacks(BlockState state, World world, BlockPos pos, @Nullable BlockEntity blockEntity, Entity entity, ItemStack stack) -
dropStack
-
dropExperience
-
getBlastResistance
public float getBlastResistance() -
onDestroyedByExplosion
Called when this block is destroyed by an explosion. -
onSteppedOn
Called when an entity steps on this block. -
getPlacementState
-
afterBreak
public void afterBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) -
onPlaced
public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) -
canMobSpawnInside
public boolean canMobSpawnInside() -
getName
-
getTranslationKey
-
onLandedUpon
-
onEntityLand
-
getPickStack
@Environment(CLIENT) public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) -
addStacksForDisplay
-
getSlipperiness
public float getSlipperiness() -
getVelocityMultiplier
public float getVelocityMultiplier() -
getJumpVelocityMultiplier
public float getJumpVelocityMultiplier() -
onBreak
-
rainTick
-
shouldDropItemsOnExplosion
-
appendProperties
-
getStateManager
-
setDefaultState
-
getDefaultState
-
getSoundGroup
-
asItem
Description copied from interface:ItemConvertible
Gets this object in its item form.- Specified by:
asItem
in interfaceItemConvertible
- Specified by:
asItem
in classAbstractBlock
-
hasDynamicBounds
public boolean hasDynamicBounds() -
toString
-
appendTooltip
-
asBlock
- Specified by:
asBlock
in classAbstractBlock
-