Package net.minecraft.block
Class PistonBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.FacingBlock
net.minecraft.block.PistonBlock
- All Implemented Interfaces:
ItemConvertible
public class PistonBlock extends FacingBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
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 static BooleanProperty
EXTENDED
protected static VoxelShape
EXTENDED_DOWN_SHAPE
protected static VoxelShape
EXTENDED_EAST_SHAPE
protected static VoxelShape
EXTENDED_NORTH_SHAPE
protected static VoxelShape
EXTENDED_SOUTH_SHAPE
protected static VoxelShape
EXTENDED_UP_SHAPE
protected static VoxelShape
EXTENDED_WEST_SHAPE
private boolean
sticky
Fields inherited from class net.minecraft.block.FacingBlock
FACING
Fields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManager
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 PistonBlock(boolean sticky, AbstractBlock.Settings settings)
-
Method Summary
Modifier and Type Method Description protected void
appendProperties(StateManager.Builder<Block,BlockState> builder)
boolean
canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
VoxelShape
getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
BlockState
getPlacementState(ItemPlacementContext ctx)
boolean
hasSidedTransparency(BlockState state)
static boolean
isMovable(BlockState blockState, World world, BlockPos blockPos, Direction direction, boolean canBreak, Direction pistonDir)
BlockState
mirror(BlockState state, BlockMirror mirror)
private boolean
move(World world, BlockPos pos, Direction dir, boolean retract)
void
neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)
void
onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)
void
onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack)
boolean
onSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data)
BlockState
rotate(BlockState state, BlockRotation rotation)
Applies a block rotation to a block state.private boolean
shouldExtend(World world, BlockPos pos, Direction pistonFace)
private void
tryMove(World world, BlockPos pos, BlockState state)
Methods inherited from class net.minecraft.block.Block
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, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, isSideInvisible, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onUse, prepare, randomTick, scheduledTick
-
Field Details
-
EXTENDED
-
EXTENDED_EAST_SHAPE
-
EXTENDED_WEST_SHAPE
-
EXTENDED_SOUTH_SHAPE
-
EXTENDED_NORTH_SHAPE
-
EXTENDED_UP_SHAPE
-
EXTENDED_DOWN_SHAPE
-
sticky
private final boolean sticky
-
-
Constructor Details
-
PistonBlock
-
-
Method Details
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShape
in classAbstractBlock
-
onPlaced
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) -
neighborUpdate
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)- Overrides:
neighborUpdate
in classAbstractBlock
-
onBlockAdded
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)- Overrides:
onBlockAdded
in classAbstractBlock
-
getPlacementState
- Overrides:
getPlacementState
in classBlock
-
tryMove
-
shouldExtend
-
onSyncedBlockEvent
- Overrides:
onSyncedBlockEvent
in classAbstractBlock
-
isMovable
public static boolean isMovable(BlockState blockState, World world, BlockPos blockPos, Direction direction, boolean canBreak, Direction pistonDir) -
move
-
rotate
Applies a block rotation to a block state.By default, this returns the provided block state.
- Overrides:
rotate
in classAbstractBlock
- Returns:
- the rotated block state
-
mirror
- Overrides:
mirror
in classAbstractBlock
-
appendProperties
- Overrides:
appendProperties
in classBlock
-
hasSidedTransparency
- Overrides:
hasSidedTransparency
in classAbstractBlock
-