Class PistonBlock
- All Implemented Interfaces:
- ItemConvertible,- ToggleableFeature
- Mappings:
- Namespace - Name - named - net/minecraft/block/PistonBlock- intermediary - net/minecraft/class_2665- official - dwr
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraft.block.AbstractBlockAbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<PistonBlock> static 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.FacingBlockFACINGFields inherited from class net.minecraft.block.Blockfield_31023, field_31024, field_31025, field_31035, FORCE_STATE, MOVED, NO_REDRAW, NOTIFY_ALL, NOTIFY_ALL_AND_REDRAW, NOTIFY_LISTENERS, NOTIFY_NEIGHBORS, REDRAW_ON_MAIN_THREAD, SKIP_DROPS, SKIP_REDSTONE_WIRE_STATE_REPLACEMENT, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlockcollidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableKey, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, translationKey, velocityMultiplierFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeatureFEATURE_ENABLED_REGISTRY_KEYS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidappendProperties(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.protected booleancanPathfindThrough(BlockState state, NavigationType type) Returns if an entity using navigation typetypecan navigate through this block.com.mojang.serialization.MapCodec<PistonBlock> getCodec()protected VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) protected 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) protected BlockStatemirror(BlockState state, BlockMirror mirror) Returnsstatemirrored bymirror.private booleanprotected voidneighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, @Nullable WireOrientation wireOrientation, boolean notify) Called when a neighboring block is updated.protected 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.protected 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.protected BlockStaterotate(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.BlockafterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropExperienceWhenMined, dropStack, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getRawIdFromState, getRegistryEntry, getShapesForStates, getSlipperiness, getStateFromRawId, getStateManager, getStateWithProperties, getVelocityMultiplier, hasDynamicBounds, hasTopRim, isFaceFullSquare, isShapeFullCube, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toStringMethods inherited from class net.minecraft.block.AbstractBlockcalcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createCodec, createScreenHandlerFactory, createSettingsCodec, emitsRedstonePower, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getHardness, getInsideCollisionShape, getLootTableKey, getMaxHorizontalModelOffset, getOpacity, getPickStack, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSettings, getSidesShape, getSoundGroup, getStateForNeighborUpdate, getStrongRedstonePower, getTranslationKey, getVerticalModelOffsetMultiplier, getWeakRedstonePower, hasComparatorOutput, hasRandomTicks, isShapeFullCube, isSideInvisible, isTransparent, onBlockBreakStart, onEntityCollision, onExploded, onProjectileHit, onStacksDropped, onStateReplaced, onUse, onUseWithItem, prepare, randomTick, scheduledTickMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeatureisEnabled
- 
Field Details- 
CODEC- Mappings:
- Namespace - Name - Mixin selector - named - CODEC- Lnet/minecraft/block/PistonBlock;CODEC:Lcom/mojang/serialization/MapCodec;- intermediary - field_46530- Lnet/minecraft/class_2665;field_46530:Lcom/mojang/serialization/MapCodec;- official - b- Ldwr;b:Lcom/mojang/serialization/MapCodec;
 
- 
EXTENDED- Mappings:
- Namespace - Name - Mixin selector - named - EXTENDED- Lnet/minecraft/block/PistonBlock;EXTENDED:Lnet/minecraft/state/property/BooleanProperty;- intermediary - field_12191- Lnet/minecraft/class_2665;field_12191:Lnet/minecraft/class_2746;- official - c- Ldwr;c:Ldxp;
 
- 
field_31373public static final int field_31373- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - field_31373- Lnet/minecraft/block/PistonBlock;field_31373:I- intermediary - field_31373- Lnet/minecraft/class_2665;field_31373:I- official - d- Ldwr;d:I
 
- 
field_31374public static final int field_31374- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - field_31374- Lnet/minecraft/block/PistonBlock;field_31374:I- intermediary - field_31374- Lnet/minecraft/class_2665;field_31374:I- official - e- Ldwr;e:I
 
- 
field_31375public static final int field_31375- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - field_31375- Lnet/minecraft/block/PistonBlock;field_31375:I- intermediary - field_31375- Lnet/minecraft/class_2665;field_31375:I- official - f- Ldwr;f:I
 
- 
field_31376public static final float field_31376- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - field_31376- Lnet/minecraft/block/PistonBlock;field_31376:F- intermediary - field_31376- Lnet/minecraft/class_2665;field_31376:F- official - g- Ldwr;g:F
 
- 
EXTENDED_EAST_SHAPE- Mappings:
- Namespace - Name - Mixin selector - named - EXTENDED_EAST_SHAPE- Lnet/minecraft/block/PistonBlock;EXTENDED_EAST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;- intermediary - field_12188- Lnet/minecraft/class_2665;field_12188:Lnet/minecraft/class_265;- official - h- Ldwr;h:Lfbv;
 
- 
EXTENDED_WEST_SHAPE- Mappings:
- Namespace - Name - Mixin selector - named - EXTENDED_WEST_SHAPE- Lnet/minecraft/block/PistonBlock;EXTENDED_WEST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;- intermediary - field_12184- Lnet/minecraft/class_2665;field_12184:Lnet/minecraft/class_265;- official - i- Ldwr;i:Lfbv;
 
- 
EXTENDED_SOUTH_SHAPE- Mappings:
- Namespace - Name - Mixin selector - named - EXTENDED_SOUTH_SHAPE- Lnet/minecraft/block/PistonBlock;EXTENDED_SOUTH_SHAPE:Lnet/minecraft/util/shape/VoxelShape;- intermediary - field_12186- Lnet/minecraft/class_2665;field_12186:Lnet/minecraft/class_265;- official - j- Ldwr;j:Lfbv;
 
- 
EXTENDED_NORTH_SHAPE- Mappings:
- Namespace - Name - Mixin selector - named - EXTENDED_NORTH_SHAPE- Lnet/minecraft/block/PistonBlock;EXTENDED_NORTH_SHAPE:Lnet/minecraft/util/shape/VoxelShape;- intermediary - field_12189- Lnet/minecraft/class_2665;field_12189:Lnet/minecraft/class_265;- official - k- Ldwr;k:Lfbv;
 
- 
EXTENDED_UP_SHAPE- Mappings:
- Namespace - Name - Mixin selector - named - EXTENDED_UP_SHAPE- Lnet/minecraft/block/PistonBlock;EXTENDED_UP_SHAPE:Lnet/minecraft/util/shape/VoxelShape;- intermediary - field_12185- Lnet/minecraft/class_2665;field_12185:Lnet/minecraft/class_265;- official - l- Ldwr;l:Lfbv;
 
- 
EXTENDED_DOWN_SHAPE- Mappings:
- Namespace - Name - Mixin selector - named - EXTENDED_DOWN_SHAPE- Lnet/minecraft/block/PistonBlock;EXTENDED_DOWN_SHAPE:Lnet/minecraft/util/shape/VoxelShape;- intermediary - field_12190- Lnet/minecraft/class_2665;field_12190:Lnet/minecraft/class_265;- official - m- Ldwr;m:Lfbv;
 
- 
stickyprivate final boolean sticky- Mappings:
- Namespace - Name - Mixin selector - named - sticky- Lnet/minecraft/block/PistonBlock;sticky:Z- intermediary - field_12187- Lnet/minecraft/class_2665;field_12187:Z- official - n- Ldwr;n:Z
 
 
- 
- 
Constructor Details- 
PistonBlock- Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/block/PistonBlock;<init>(ZLnet/minecraft/block/AbstractBlock$Settings;)V- intermediary - <init>- Lnet/minecraft/class_2665;<init>(ZLnet/minecraft/class_4970$class_2251;)V- official - <init>- Ldwr;<init>(ZLdwx$d;)V
 
 
- 
- 
Method Details- 
getCodec- Specified by:
- getCodecin class- FacingBlock
- Mappings:
- Namespace - Name - Mixin selector - named - getCodec- Lnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;- intermediary - method_53969- Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;- official - a- Ldwx;a()Lcom/mojang/serialization/MapCodec;
 
- 
getOutlineShapeprotected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) - Overrides:
- getOutlineShapein class- AbstractBlock
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - getOutlineShape- Lnet/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;- intermediary - method_9530- Lnet/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;- official - a- Ldwx;a(Ldwy;Ldfo;Lji;Lfbg;)Lfbv;
 
- 
onPlacedpublic 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 class- Block
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - onPlaced- Lnet/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- intermediary - method_9567- Lnet/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;)V- official - a- Ldjn;a(Ldgj;Lji;Ldwy;Lbvi;Lcwq;)V
 
- 
neighborUpdateprotected void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, @Nullable @Nullable WireOrientation wireOrientation, 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.world.WorldView, net.minecraft.world.tick.ScheduledTickView, net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, net.minecraft.util.math.random.Random)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 class- AbstractBlock
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - neighborUpdate- Lnet/minecraft/block/AbstractBlock;neighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;Lnet/minecraft/world/block/WireOrientation;Z)V- intermediary - method_9612- Lnet/minecraft/class_4970;method_9612(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;Lnet/minecraft/class_9904;Z)V- official - a- Ldwx;a(Ldwy;Ldgj;Lji;Ldjn;Leui;Z)V
 
- 
onBlockAddedprotected 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.world.WorldView, net.minecraft.world.tick.ScheduledTickView, net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, net.minecraft.util.math.random.Random)orneighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.world.block.WireOrientation, boolean)should also be overridden. The method is used in the following cases:- When activating a redstone component on placement (used along with neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.world.block.WireOrientation, boolean)
- When resetting a position-dependent state (see TargetBlock)
- When converting a block on placement (see WetSpongeBlock)
- When fire lights a portal
 - Overrides:
- onBlockAddedin class- AbstractBlock
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - onBlockAdded- Lnet/minecraft/block/AbstractBlock;onBlockAdded(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V- intermediary - method_9615- Lnet/minecraft/class_4970;method_9615(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)V- official - b- Ldwx;b(Ldwy;Ldgj;Lji;Ldwy;Z)V
 
- When activating a redstone component on placement (used along with 
- 
getPlacementState- Overrides:
- getPlacementStatein class- Block
- Mappings:
- Namespace - Name - Mixin selector - named - getPlacementState- Lnet/minecraft/block/Block;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;- intermediary - method_9605- Lnet/minecraft/class_2248;method_9605(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;- official - a- Ldjn;a(Ldah;)Ldwy;
 
- 
tryMove- Mappings:
- Namespace - Name - Mixin selector - named - tryMove- Lnet/minecraft/block/PistonBlock;tryMove(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V- intermediary - method_11483- Lnet/minecraft/class_2665;method_11483(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V- official - a- Ldwr;a(Ldgj;Lji;Ldwy;)V
 
- 
shouldExtend- Mappings:
- Namespace - Name - Mixin selector - named - shouldExtend- Lnet/minecraft/block/PistonBlock;shouldExtend(Lnet/minecraft/world/RedstoneView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Z- intermediary - method_11482- Lnet/minecraft/class_2665;method_11482(Lnet/minecraft/class_8235;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Z- official - a- Ldwr;a(Ldhb;Lji;Ljn;)Z
 
- 
onSyncedBlockEventprotected boolean onSyncedBlockEvent(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.- Overrides:
- onSyncedBlockEventin class- AbstractBlock
- Returns:
- whether the event was handled successfully
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - onSyncedBlockEvent- Lnet/minecraft/block/AbstractBlock;onSyncedBlockEvent(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;II)Z- intermediary - method_9592- Lnet/minecraft/class_4970;method_9592(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;II)Z- official - a- Ldwx;a(Ldwy;Ldgj;Lji;II)Z
 
- 
isMovablepublic static boolean isMovable(BlockState state, World world, BlockPos pos, Direction direction, boolean canBreak, Direction pistonDir) - Mappings:
- Namespace - Name - Mixin selector - named - isMovable- Lnet/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- intermediary - method_11484- Lnet/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;)Z- official - a- Ldwr;a(Ldwy;Ldgj;Lji;Ljn;ZLjn;)Z
 
- 
move- Mappings:
- Namespace - Name - Mixin selector - named - move- Lnet/minecraft/block/PistonBlock;move(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Z)Z- intermediary - method_11481- Lnet/minecraft/class_2665;method_11481(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;Z)Z- official - a- Ldwr;a(Ldgj;Lji;Ljn;Z)Z
 
- 
rotateReturnsstaterotated byrotation.By default, this returns the provided block state. - Overrides:
- rotatein class- AbstractBlock
- Returns:
- staterotated by- rotation
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - rotate- Lnet/minecraft/block/AbstractBlock;rotate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockRotation;)Lnet/minecraft/block/BlockState;- intermediary - method_9598- Lnet/minecraft/class_4970;method_9598(Lnet/minecraft/class_2680;Lnet/minecraft/class_2470;)Lnet/minecraft/class_2680;- official - a- Ldwx;a(Ldwy;Ldqf;)Ldwy;
 
- 
mirrorReturnsstatemirrored bymirror.By default, this returns the provided block state. - Overrides:
- mirrorin class- AbstractBlock
- Returns:
- statemirrored by- mirror
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - mirror- Lnet/minecraft/block/AbstractBlock;mirror(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockMirror;)Lnet/minecraft/block/BlockState;- intermediary - method_9569- Lnet/minecraft/class_4970;method_9569(Lnet/minecraft/class_2680;Lnet/minecraft/class_2415;)Lnet/minecraft/class_2680;- official - a- Ldwx;a(Ldwy;Ldom;)Ldwy;
 
- 
appendPropertiesAppends 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 class- Block
- Mappings:
- Namespace - Name - Mixin selector - named - appendProperties- Lnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V- intermediary - method_9515- Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)V- official - a- Ldjn;a(Ldwz$a;)V
 
- 
hasSidedTransparencyReturns whether the block's transparency depends on the side of the block, like slabs.- Overrides:
- hasSidedTransparencyin class- AbstractBlock
- Returns:
- whether the block's transparency depends on the side of the block, like slabs
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - hasSidedTransparency- Lnet/minecraft/block/AbstractBlock;hasSidedTransparency(Lnet/minecraft/block/BlockState;)Z- intermediary - method_9526- Lnet/minecraft/class_4970;method_9526(Lnet/minecraft/class_2680;)Z- official - g_- Ldwx;g_(Ldwy;)Z
 
 
-