public class PistonBlock extends FacingBlock
Block.NeighborGroup
AbstractBlock.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 |
FACING
LOGGER, STATE_IDS, stateManager
collidable, 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, toString
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
public 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 AbstractBlock
public 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 AbstractBlock
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)
onBlockAdded
in class AbstractBlock
public BlockState getPlacementState(ItemPlacementContext ctx)
getPlacementState
in class Block
private void tryMove(World world, BlockPos pos, BlockState state)
public boolean onSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data)
onSyncedBlockEvent
in class AbstractBlock
public 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 AbstractBlock
public BlockState mirror(BlockState state, BlockMirror mirror)
mirror
in class AbstractBlock
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block
public boolean hasSidedTransparency(BlockState state)
hasSidedTransparency
in class AbstractBlock
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
canPathfindThrough
in class AbstractBlock