Package net.minecraft.block
Class AbstractPressurePlateBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.AbstractPressurePlateBlock
- All Implemented Interfaces:
ItemConvertible
- Direct Known Subclasses:
PressurePlateBlock,WeightedPressurePlateBlock
public abstract class AbstractPressurePlateBlock extends Block
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroupNested 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 protected static BoxBOXprotected static VoxelShapeDEFAULT_SHAPEprotected static VoxelShapePRESSED_SHAPEFields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPressurePlateBlock(AbstractBlock.Settings settings) -
Method Summary
Modifier and Type Method Description booleancanMobSpawnInside()booleancanPlaceAt(BlockState state, WorldView world, BlockPos pos)booleanemitsRedstonePower(BlockState state)VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)PistonBehaviorgetPistonBehavior(BlockState state)protected abstract intgetRedstoneOutput(BlockState state)protected abstract intgetRedstoneOutput(World world, BlockPos pos)BlockStategetStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos)Gets the possibly updated block state of this block when a neighboring block is updated.intgetStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)protected intgetTickRate()intgetWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)voidonEntityCollision(BlockState state, World world, BlockPos pos, Entity entity)voidonStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)ifnewStateis different fromstate.protected abstract voidplayDepressSound(WorldAccess world, BlockPos pos)protected abstract voidplayPressSound(WorldAccess world, BlockPos pos)voidscheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random)protected abstract BlockStatesetRedstoneOutput(BlockState state, int rsOut)protected voidupdateNeighbors(World world, BlockPos pos)protected voidupdatePlateState(World world, BlockPos pos, BlockState state, int rsOut)Methods inherited from class net.minecraft.block.Block
addStacksForDisplay, afterBreak, appendProperties, appendTooltip, asBlock, asItem, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getPlacementState, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canReplace, createScreenHandlerFactory, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onProjectileHit, onStacksDropped, onSyncedBlockEvent, onUse, prepare, randomTick, rotate
-
Field Details
-
PRESSED_SHAPE
-
DEFAULT_SHAPE
-
BOX
-
-
Constructor Details
-
AbstractPressurePlateBlock
-
-
Method Details
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShapein classAbstractBlock
-
getTickRate
protected int getTickRate() -
canMobSpawnInside
public boolean canMobSpawnInside()- Overrides:
canMobSpawnInsidein classBlock
-
getStateForNeighborUpdate
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos)Gets the possibly updated block state of this block when a neighboring block is updated.- Overrides:
getStateForNeighborUpdatein classAbstractBlock- Parameters:
state- the state of this blockdirection- the direction from this block to the neighborneighborState- the state of the updated neighbor blockworld- the worldpos- the position of this blockneighborPos- the position of the neighbor block- Returns:
- the new state of this block
-
canPlaceAt
- Overrides:
canPlaceAtin classAbstractBlock
-
scheduledTick
- Overrides:
scheduledTickin classAbstractBlock
-
onEntityCollision
- Overrides:
onEntityCollisionin classAbstractBlock
-
updatePlateState
-
playPressSound
-
playDepressSound
-
onStateReplaced
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)ifnewStateis different fromstate. Vanilla blocks perform removal cleanups here.- Overrides:
onStateReplacedin classAbstractBlock
-
updateNeighbors
-
getWeakRedstonePower
public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)- Overrides:
getWeakRedstonePowerin classAbstractBlock
-
getStrongRedstonePower
public int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)- Overrides:
getStrongRedstonePowerin classAbstractBlock
-
emitsRedstonePower
- Overrides:
emitsRedstonePowerin classAbstractBlock
-
getPistonBehavior
- Overrides:
getPistonBehaviorin classAbstractBlock
-
getRedstoneOutput
-
getRedstoneOutput
-
setRedstoneOutput
-