public class PistonBlock extends FacingBlock
Block.NeighborGroupAbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>| Modifier and Type | Field and 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 |
FACINGLOGGER, STATE_IDS, stateManagercollidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier| Constructor and Description |
|---|
PistonBlock(boolean sticky,
AbstractBlock.Settings settings) |
| Modifier and Type | Method and 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) |
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, toStringcalcBlockBreakingDelta, 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, scheduledTickpublic static final BooleanProperty EXTENDED
protected static final VoxelShape EXTENDED_EAST_SHAPE
protected static final VoxelShape EXTENDED_WEST_SHAPE
protected static final VoxelShape EXTENDED_SOUTH_SHAPE
protected static final VoxelShape EXTENDED_NORTH_SHAPE
protected static final VoxelShape EXTENDED_UP_SHAPE
protected static final VoxelShape EXTENDED_DOWN_SHAPE
private final boolean sticky
public PistonBlock(boolean sticky,
AbstractBlock.Settings settings)
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getOutlineShape in class AbstractBlockpublic void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack)
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)
neighborUpdate in class AbstractBlockpublic void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)
onBlockAdded in class AbstractBlockpublic BlockState getPlacementState(ItemPlacementContext ctx)
getPlacementState in class Blockprivate void tryMove(World world, BlockPos pos, BlockState state)
public boolean onSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data)
onSyncedBlockEvent in class AbstractBlockpublic static boolean isMovable(BlockState blockState, World world, BlockPos blockPos, Direction direction, boolean canBreak, Direction pistonDir)
public BlockState rotate(BlockState state, BlockRotation rotation)
By default, this returns the provided block state.
rotate in class AbstractBlockpublic BlockState mirror(BlockState state, BlockMirror mirror)
mirror in class AbstractBlockprotected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties in class Blockpublic boolean hasSidedTransparency(BlockState state)
hasSidedTransparency in class AbstractBlockpublic boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
canPathfindThrough in class AbstractBlock