Class PistonBlock
- All Implemented Interfaces:
ItemConvertible,ToggleableFeature
- Mappings:
Namespace Name official dbrintermediary net/minecraft/class_2665named net/minecraft/block/PistonBlock
-
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.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BooleanPropertyprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapestatic final intstatic final intstatic final intstatic final floatprivate final booleanFields inherited from class net.minecraft.block.FacingBlock
FACINGFields inherited from class net.minecraft.block.Block
field_31022, field_31023, field_31024, field_31025, field_31035, FORCE_STATE, MOVED, NO_REDRAW, NOTIFY_ALL, NOTIFY_LISTENERS, NOTIFY_NEIGHBORS, REDRAW_ON_MAIN_THREAD, SKIP_DROPS, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableId, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, velocityMultiplierFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendProperties(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.booleancanPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) Returns if an entity using navigation typetypecan navigate through this block.getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) booleanhasSidedTransparency(BlockState state) Returns whether the block's transparency depends on the side of the block, like slabs.static booleanisMovable(BlockState state, World world, BlockPos pos, Direction direction, boolean canBreak, Direction pistonDir) mirror(BlockState state, BlockMirror mirror) Returnsstatemirrored bymirror.private booleanvoidneighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) Called when a neighboring block is updated.voidonBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) Called server-side on the new block when the block state is changed.voidonPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.booleanonSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data) Handles the block event, which is an event specific to a block with an integer ID and data.rotate(BlockState state, BlockRotation rotation) Returnsstaterotated byrotation.private booleanshouldExtend(RedstoneView world, BlockPos pos, Direction pistonFace) private voidtryMove(World world, BlockPos pos, BlockState state) Methods inherited from class net.minecraft.block.Block
afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropExperienceWhenMined, dropStack, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getRegistryEntry, getShapesForStates, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getStateWithProperties, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, isFaceFullSquare, isShapeFullCube, isTransparent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getHardness, getLootTableId, getMaxHorizontalModelOffset, getOpacity, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVerticalModelOffsetMultiplier, getWeakRedstonePower, hasComparatorOutput, isCullingShapeFullCube, isShapeFullCube, isSideInvisible, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onUse, prepare, randomTick, scheduledTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
EXTENDED
- Mappings:
Namespace Name Mixin selector official bLdbr;b:Ldcp;intermediary field_12191Lnet/minecraft/class_2665;field_12191:Lnet/minecraft/class_2746;named EXTENDEDLnet/minecraft/block/PistonBlock;EXTENDED:Lnet/minecraft/state/property/BooleanProperty;
-
field_31373
public static final int field_31373- See Also:
- Mappings:
Namespace Name Mixin selector official cLdbr;c:Iintermediary field_31373Lnet/minecraft/class_2665;field_31373:Inamed field_31373Lnet/minecraft/block/PistonBlock;field_31373:I
-
field_31374
public static final int field_31374- See Also:
- Mappings:
Namespace Name Mixin selector official dLdbr;d:Iintermediary field_31374Lnet/minecraft/class_2665;field_31374:Inamed field_31374Lnet/minecraft/block/PistonBlock;field_31374:I
-
field_31375
public static final int field_31375- See Also:
- Mappings:
Namespace Name Mixin selector official eLdbr;e:Iintermediary field_31375Lnet/minecraft/class_2665;field_31375:Inamed field_31375Lnet/minecraft/block/PistonBlock;field_31375:I
-
field_31376
public static final float field_31376- See Also:
- Mappings:
Namespace Name Mixin selector official fLdbr;f:Fintermediary field_31376Lnet/minecraft/class_2665;field_31376:Fnamed field_31376Lnet/minecraft/block/PistonBlock;field_31376:F
-
EXTENDED_EAST_SHAPE
- Mappings:
Namespace Name Mixin selector official gLdbr;g:Leet;intermediary field_12188Lnet/minecraft/class_2665;field_12188:Lnet/minecraft/class_265;named EXTENDED_EAST_SHAPELnet/minecraft/block/PistonBlock;EXTENDED_EAST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
EXTENDED_WEST_SHAPE
- Mappings:
Namespace Name Mixin selector official hLdbr;h:Leet;intermediary field_12184Lnet/minecraft/class_2665;field_12184:Lnet/minecraft/class_265;named EXTENDED_WEST_SHAPELnet/minecraft/block/PistonBlock;EXTENDED_WEST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
EXTENDED_SOUTH_SHAPE
- Mappings:
Namespace Name Mixin selector official iLdbr;i:Leet;intermediary field_12186Lnet/minecraft/class_2665;field_12186:Lnet/minecraft/class_265;named EXTENDED_SOUTH_SHAPELnet/minecraft/block/PistonBlock;EXTENDED_SOUTH_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
EXTENDED_NORTH_SHAPE
- Mappings:
Namespace Name Mixin selector official jLdbr;j:Leet;intermediary field_12189Lnet/minecraft/class_2665;field_12189:Lnet/minecraft/class_265;named EXTENDED_NORTH_SHAPELnet/minecraft/block/PistonBlock;EXTENDED_NORTH_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
EXTENDED_UP_SHAPE
- Mappings:
Namespace Name Mixin selector official kLdbr;k:Leet;intermediary field_12185Lnet/minecraft/class_2665;field_12185:Lnet/minecraft/class_265;named EXTENDED_UP_SHAPELnet/minecraft/block/PistonBlock;EXTENDED_UP_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
EXTENDED_DOWN_SHAPE
- Mappings:
Namespace Name Mixin selector official lLdbr;l:Leet;intermediary field_12190Lnet/minecraft/class_2665;field_12190:Lnet/minecraft/class_265;named EXTENDED_DOWN_SHAPELnet/minecraft/block/PistonBlock;EXTENDED_DOWN_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
sticky
private final boolean sticky- Mappings:
Namespace Name Mixin selector official mLdbr;m:Zintermediary field_12187Lnet/minecraft/class_2665;field_12187:Znamed stickyLnet/minecraft/block/PistonBlock;sticky:Z
-
-
Constructor Details
-
PistonBlock
- Mappings:
Namespace Name Mixin selector official <init>Ldbr;<init>(ZLdbx$d;)Vintermediary <init>Lnet/minecraft/class_2665;<init>(ZLnet/minecraft/class_4970$class_2251;)Vnamed <init>Lnet/minecraft/block/PistonBlock;<init>(ZLnet/minecraft/block/AbstractBlock$Settings;)V
-
-
Method Details
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) - Overrides:
getOutlineShapein classAbstractBlock- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lclq;Lgu;Leef;)Leet;intermediary method_9530Lnet/minecraft/class_4970;method_9530(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_3726;)Lnet/minecraft/class_265;named getOutlineShapeLnet/minecraft/block/AbstractBlock;getOutlineShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;
-
onPlaced
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.Tall or wide blocks (such as doors or beds) should override this to place the other half of the block. Blocks with block entities can use this to copy the data from the item stack, such as the custom name.
This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient.- Overrides:
onPlacedin classBlock- See Also:
- Mappings:
Namespace Name Mixin selector official aLcpl;a(Lcmk;Lgu;Ldby;Lbfx;Lcfx;)Vintermediary method_9567Lnet/minecraft/class_2248;method_9567(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;)Vnamed onPlacedLnet/minecraft/block/Block;onPlaced(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;)V
-
neighborUpdate
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) Called when a neighboring block is updated. This method should be overridden to perform an action with a side effect, most notably an activation of a redstone component. This can also be used to perform an action changing block states of other blocks, such asSpongeBlockwhich absorbs water.To replace the state of the block itself, override
AbstractBlock.getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos)instead.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient.- Overrides:
neighborUpdatein classAbstractBlock- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcmk;Lgu;Lcpl;Lgu;Z)Vintermediary method_9612Lnet/minecraft/class_4970;method_9612(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;Lnet/minecraft/class_2338;Z)Vnamed neighborUpdateLnet/minecraft/block/AbstractBlock;neighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;Z)V
-
onBlockAdded
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) Called server-side on the new block when the block state is changed. This includes block placement. When overriding this method,AbstractBlock.getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos)orAbstractBlock.neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean)should also be overridden. The method is used in the following cases:- When activating a redstone component on placement (used along with
AbstractBlock.neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean) - When resetting a position-dependent state (see
TargetBlock) - When converting a block on placement (see
WetSpongeBlock) - When fire lights a portal
- Overrides:
onBlockAddedin classAbstractBlock- See Also:
- Mappings:
Namespace Name Mixin selector official bLdbx;b(Ldby;Lcmk;Lgu;Ldby;Z)Vintermediary method_9615Lnet/minecraft/class_4970;method_9615(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)Vnamed onBlockAddedLnet/minecraft/block/AbstractBlock;onBlockAdded(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V
- When activating a redstone component on placement (used along with
-
getPlacementState
- Overrides:
getPlacementStatein classBlock- Mappings:
Namespace Name Mixin selector official aLcpl;a(Lcif;)Ldby;intermediary method_9605Lnet/minecraft/class_2248;method_9605(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;named getPlacementStateLnet/minecraft/block/Block;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;
-
tryMove
- Mappings:
Namespace Name Mixin selector official aLdbr;a(Lcmk;Lgu;Ldby;)Vintermediary method_11483Lnet/minecraft/class_2665;method_11483(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vnamed tryMoveLnet/minecraft/block/PistonBlock;tryMove(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
-
shouldExtend
- Mappings:
Namespace Name Mixin selector official aLdbr;a(Lcna;Lgu;Lha;)Zintermediary method_11482Lnet/minecraft/class_2665;method_11482(Lnet/minecraft/class_8235;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Znamed shouldExtendLnet/minecraft/block/PistonBlock;shouldExtend(Lnet/minecraft/world/RedstoneView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Z
-
onSyncedBlockEvent
Handles the block event, which is an event specific to a block with an integer ID and data.- Overrides:
onSyncedBlockEventin classAbstractBlock- Returns:
- whether the event was handled successfully
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcmk;Lgu;II)Zintermediary method_9592Lnet/minecraft/class_4970;method_9592(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;II)Znamed onSyncedBlockEventLnet/minecraft/block/AbstractBlock;onSyncedBlockEvent(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;II)Z
-
isMovable
public static boolean isMovable(BlockState state, World world, BlockPos pos, Direction direction, boolean canBreak, Direction pistonDir) - Mappings:
Namespace Name Mixin selector official aLdbr;a(Ldby;Lcmk;Lgu;Lha;ZLha;)Zintermediary method_11484Lnet/minecraft/class_2665;method_11484(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;ZLnet/minecraft/class_2350;)Znamed isMovableLnet/minecraft/block/PistonBlock;isMovable(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;ZLnet/minecraft/util/math/Direction;)Z
-
move
- Mappings:
Namespace Name Mixin selector official aLdbr;a(Lcmk;Lgu;Lha;Z)Zintermediary method_11481Lnet/minecraft/class_2665;method_11481(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;Z)Znamed moveLnet/minecraft/block/PistonBlock;move(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Z)Z
-
rotate
Returnsstaterotated byrotation.By default, this returns the provided block state.
- Overrides:
rotatein classAbstractBlock- Returns:
staterotated byrotation- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcvw;)Ldby;intermediary method_9598Lnet/minecraft/class_4970;method_9598(Lnet/minecraft/class_2680;Lnet/minecraft/class_2470;)Lnet/minecraft/class_2680;named rotateLnet/minecraft/block/AbstractBlock;rotate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockRotation;)Lnet/minecraft/block/BlockState;
-
mirror
Returnsstatemirrored bymirror.By default, this returns the provided block state.
- Overrides:
mirrorin classAbstractBlock- Returns:
statemirrored bymirror- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcuf;)Ldby;intermediary method_9569Lnet/minecraft/class_4970;method_9569(Lnet/minecraft/class_2680;Lnet/minecraft/class_2415;)Lnet/minecraft/class_2680;named mirrorLnet/minecraft/block/AbstractBlock;mirror(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockMirror;)Lnet/minecraft/block/BlockState;
-
appendProperties
Appends block state properties to this block. To use this, override and callStateManager.Builder.add(net.minecraft.state.property.Property<?>[])inside the method. SeePropertiesfor the list of pre-defined properties.- Overrides:
appendPropertiesin classBlock- Mappings:
Namespace Name Mixin selector official aLcpl;a(Ldbz$a;)Vintermediary method_9515Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)Vnamed appendPropertiesLnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V
-
hasSidedTransparency
Returns whether the block's transparency depends on the side of the block, like slabs.- Overrides:
hasSidedTransparencyin classAbstractBlock- Returns:
- whether the block's transparency depends on the side of the block, like slabs
- Mappings:
Namespace Name Mixin selector official g_Ldbx;g_(Ldby;)Zintermediary method_9526Lnet/minecraft/class_4970;method_9526(Lnet/minecraft/class_2680;)Znamed hasSidedTransparencyLnet/minecraft/block/AbstractBlock;hasSidedTransparency(Lnet/minecraft/block/BlockState;)Z
-