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.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 static BooleanPropertyEXTENDEDprotected static VoxelShapeEXTENDED_DOWN_SHAPEprotected static VoxelShapeEXTENDED_EAST_SHAPEprotected static VoxelShapeEXTENDED_NORTH_SHAPEprotected static VoxelShapeEXTENDED_SOUTH_SHAPEprotected static VoxelShapeEXTENDED_UP_SHAPEprotected static VoxelShapeEXTENDED_WEST_SHAPEprivate booleanstickyFields inherited from class net.minecraft.block.FacingBlock
FACINGFields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManagerFields 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 voidappendProperties(StateManager.Builder<Block,BlockState> builder)booleancanPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)BlockStategetPlacementState(ItemPlacementContext ctx)booleanhasSidedTransparency(BlockState state)static booleanisMovable(BlockState state, World world, BlockPos pos, Direction direction, boolean canBreak, Direction pistonDir)BlockStatemirror(BlockState state, BlockMirror mirror)private booleanmove(World world, BlockPos pos, Direction dir, boolean retract)voidneighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)voidonBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)voidonPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack)booleanonSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data)BlockStaterotate(BlockState state, BlockRotation rotation)Applies a block rotation to a block state.private booleanshouldExtend(World world, BlockPos pos, Direction pistonFace)private voidtryMove(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, isFaceFullSquare, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getLootTableId, getMaxModelOffset, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, 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:
getOutlineShapein 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:
neighborUpdatein classAbstractBlock
-
onBlockAdded
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)- Overrides:
onBlockAddedin classAbstractBlock
-
getPlacementState
- Overrides:
getPlacementStatein classBlock
-
tryMove
-
shouldExtend
-
onSyncedBlockEvent
- Overrides:
onSyncedBlockEventin classAbstractBlock
-
isMovable
public static boolean isMovable(BlockState state, World world, BlockPos pos, 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:
rotatein classAbstractBlock- Returns:
- the rotated block state
-
mirror
- Overrides:
mirrorin classAbstractBlock
-
appendProperties
- Overrides:
appendPropertiesin classBlock
-
hasSidedTransparency
- Overrides:
hasSidedTransparencyin classAbstractBlock
-