Class PistonBlock

All Implemented Interfaces:
ItemConvertible, ToggleableFeature

public class PistonBlock extends FacingBlock
Mappings:
Namespace Name
official dja
intermediary net/minecraft/class_2665
named net/minecraft/block/PistonBlock
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<PistonBlock> CODEC
      Mappings:
      Namespace Name Mixin selector
      official b Ldja;b:Lcom/mojang/serialization/MapCodec;
      intermediary field_46530 Lnet/minecraft/class_2665;field_46530:Lcom/mojang/serialization/MapCodec;
      named CODEC Lnet/minecraft/block/PistonBlock;CODEC:Lcom/mojang/serialization/MapCodec;
    • EXTENDED

      public static final BooleanProperty EXTENDED
      Mappings:
      Namespace Name Mixin selector
      official c Ldja;c:Ldjy;
      intermediary field_12191 Lnet/minecraft/class_2665;field_12191:Lnet/minecraft/class_2746;
      named EXTENDED Lnet/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 d Ldja;d:I
      intermediary field_31373 Lnet/minecraft/class_2665;field_31373:I
      named field_31373 Lnet/minecraft/block/PistonBlock;field_31373:I
    • field_31374

      public static final int field_31374
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official e Ldja;e:I
      intermediary field_31374 Lnet/minecraft/class_2665;field_31374:I
      named field_31374 Lnet/minecraft/block/PistonBlock;field_31374:I
    • field_31375

      public static final int field_31375
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official f Ldja;f:I
      intermediary field_31375 Lnet/minecraft/class_2665;field_31375:I
      named field_31375 Lnet/minecraft/block/PistonBlock;field_31375:I
    • field_31376

      public static final float field_31376
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official g Ldja;g:F
      intermediary field_31376 Lnet/minecraft/class_2665;field_31376:F
      named field_31376 Lnet/minecraft/block/PistonBlock;field_31376:F
    • EXTENDED_EAST_SHAPE

      protected static final VoxelShape EXTENDED_EAST_SHAPE
      Mappings:
      Namespace Name Mixin selector
      official h Ldja;h:Lemm;
      intermediary field_12188 Lnet/minecraft/class_2665;field_12188:Lnet/minecraft/class_265;
      named EXTENDED_EAST_SHAPE Lnet/minecraft/block/PistonBlock;EXTENDED_EAST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
    • EXTENDED_WEST_SHAPE

      protected static final VoxelShape EXTENDED_WEST_SHAPE
      Mappings:
      Namespace Name Mixin selector
      official i Ldja;i:Lemm;
      intermediary field_12184 Lnet/minecraft/class_2665;field_12184:Lnet/minecraft/class_265;
      named EXTENDED_WEST_SHAPE Lnet/minecraft/block/PistonBlock;EXTENDED_WEST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
    • EXTENDED_SOUTH_SHAPE

      protected static final VoxelShape EXTENDED_SOUTH_SHAPE
      Mappings:
      Namespace Name Mixin selector
      official j Ldja;j:Lemm;
      intermediary field_12186 Lnet/minecraft/class_2665;field_12186:Lnet/minecraft/class_265;
      named EXTENDED_SOUTH_SHAPE Lnet/minecraft/block/PistonBlock;EXTENDED_SOUTH_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
    • EXTENDED_NORTH_SHAPE

      protected static final VoxelShape EXTENDED_NORTH_SHAPE
      Mappings:
      Namespace Name Mixin selector
      official k Ldja;k:Lemm;
      intermediary field_12189 Lnet/minecraft/class_2665;field_12189:Lnet/minecraft/class_265;
      named EXTENDED_NORTH_SHAPE Lnet/minecraft/block/PistonBlock;EXTENDED_NORTH_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
    • EXTENDED_UP_SHAPE

      protected static final VoxelShape EXTENDED_UP_SHAPE
      Mappings:
      Namespace Name Mixin selector
      official l Ldja;l:Lemm;
      intermediary field_12185 Lnet/minecraft/class_2665;field_12185:Lnet/minecraft/class_265;
      named EXTENDED_UP_SHAPE Lnet/minecraft/block/PistonBlock;EXTENDED_UP_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
    • EXTENDED_DOWN_SHAPE

      protected static final VoxelShape EXTENDED_DOWN_SHAPE
      Mappings:
      Namespace Name Mixin selector
      official m Ldja;m:Lemm;
      intermediary field_12190 Lnet/minecraft/class_2665;field_12190:Lnet/minecraft/class_265;
      named EXTENDED_DOWN_SHAPE Lnet/minecraft/block/PistonBlock;EXTENDED_DOWN_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
    • sticky

      private final boolean sticky
      Mappings:
      Namespace Name Mixin selector
      official n Ldja;n:Z
      intermediary field_12187 Lnet/minecraft/class_2665;field_12187:Z
      named sticky Lnet/minecraft/block/PistonBlock;sticky:Z
  • Constructor Details

    • PistonBlock

      public PistonBlock(boolean sticky, AbstractBlock.Settings settings)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldja;<init>(ZLdjg$d;)V
      intermediary <init> Lnet/minecraft/class_2665;<init>(ZLnet/minecraft/class_4970$class_2251;)V
      named <init> Lnet/minecraft/block/PistonBlock;<init>(ZLnet/minecraft/block/AbstractBlock$Settings;)V
  • Method Details

    • getCodec

      public com.mojang.serialization.MapCodec<PistonBlock> getCodec()
      Specified by:
      getCodec in class FacingBlock
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a()Lcom/mojang/serialization/MapCodec;
      intermediary method_53969 Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;
      named getCodec Lnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;
    • getOutlineShape

      public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
      Overrides:
      getOutlineShape in class AbstractBlock
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a(Ldjh;Lcsv;Lhx;Lely;)Lemm;
      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;
      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;
    • 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:
      onPlaced in class Block
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lcwq;a(Lctp;Lhx;Ldjh;Lbml;Lcmy;)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
      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
    • 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 as SpongeBlock which 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:
      neighborUpdate in class AbstractBlock
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a(Ldjh;Lctp;Lhx;Lcwq;Lhx;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_2338;Z)V
      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/util/math/BlockPos;Z)V
    • onBlockAdded

      public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)
      Overrides:
      onBlockAdded in class AbstractBlock
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Ldjg;b(Ldjh;Lctp;Lhx;Ldjh;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
      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
    • getPlacementState

      public BlockState getPlacementState(ItemPlacementContext ctx)
      Overrides:
      getPlacementState in class Block
      Mappings:
      Namespace Name Mixin selector
      official a Lcwq;a(Lcph;)Ldjh;
      intermediary method_9605 Lnet/minecraft/class_2248;method_9605(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;
      named getPlacementState Lnet/minecraft/block/Block;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;
    • tryMove

      private void tryMove(World world, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official a Ldja;a(Lctp;Lhx;Ldjh;)V
      intermediary method_11483 Lnet/minecraft/class_2665;method_11483(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named tryMove Lnet/minecraft/block/PistonBlock;tryMove(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • shouldExtend

      private boolean shouldExtend(RedstoneView world, BlockPos pos, Direction pistonFace)
      Mappings:
      Namespace Name Mixin selector
      official a Ldja;a(Lcuf;Lhx;Lic;)Z
      intermediary method_11482 Lnet/minecraft/class_2665;method_11482(Lnet/minecraft/class_8235;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Z
      named shouldExtend Lnet/minecraft/block/PistonBlock;shouldExtend(Lnet/minecraft/world/RedstoneView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Z
    • onSyncedBlockEvent

      public 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:
      onSyncedBlockEvent in class AbstractBlock
      Returns:
      whether the event was handled successfully
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a(Ldjh;Lctp;Lhx;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
      named onSyncedBlockEvent Lnet/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 a Ldja;a(Ldjh;Lctp;Lhx;Lic;ZLic;)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
      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
    • move

      private boolean move(World world, BlockPos pos, Direction dir, boolean retract)
      Mappings:
      Namespace Name Mixin selector
      official a Ldja;a(Lctp;Lhx;Lic;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
      named move Lnet/minecraft/block/PistonBlock;move(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Z)Z
    • rotate

      public BlockState rotate(BlockState state, BlockRotation rotation)
      Returns state rotated by rotation.

      By default, this returns the provided block state.

      Overrides:
      rotate in class AbstractBlock
      Returns:
      state rotated by rotation
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a(Ldjh;Lddc;)Ldjh;
      intermediary method_9598 Lnet/minecraft/class_4970;method_9598(Lnet/minecraft/class_2680;Lnet/minecraft/class_2470;)Lnet/minecraft/class_2680;
      named rotate Lnet/minecraft/block/AbstractBlock;rotate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockRotation;)Lnet/minecraft/block/BlockState;
    • mirror

      public BlockState mirror(BlockState state, BlockMirror mirror)
      Returns state mirrored by mirror.

      By default, this returns the provided block state.

      Overrides:
      mirror in class AbstractBlock
      Returns:
      state mirrored by mirror
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a(Ldjh;Ldbm;)Ldjh;
      intermediary method_9569 Lnet/minecraft/class_4970;method_9569(Lnet/minecraft/class_2680;Lnet/minecraft/class_2415;)Lnet/minecraft/class_2680;
      named mirror Lnet/minecraft/block/AbstractBlock;mirror(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockMirror;)Lnet/minecraft/block/BlockState;
    • appendProperties

      protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
      Appends block state properties to this block. To use this, override and call StateManager.Builder.add(net.minecraft.state.property.Property<?>[]) inside the method. See Properties for the list of pre-defined properties.
      Overrides:
      appendProperties in class Block
      Mappings:
      Namespace Name Mixin selector
      official a Lcwq;a(Ldji$a;)V
      intermediary method_9515 Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)V
      named appendProperties Lnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V
    • hasSidedTransparency

      public boolean hasSidedTransparency(BlockState state)
      Returns whether the block's transparency depends on the side of the block, like slabs.
      Overrides:
      hasSidedTransparency in class AbstractBlock
      Returns:
      whether the block's transparency depends on the side of the block, like slabs
      Mappings:
      Namespace Name Mixin selector
      official g_ Ldjg;g_(Ldjh;)Z
      intermediary method_9526 Lnet/minecraft/class_4970;method_9526(Lnet/minecraft/class_2680;)Z
      named hasSidedTransparency Lnet/minecraft/block/AbstractBlock;hasSidedTransparency(Lnet/minecraft/block/BlockState;)Z
    • canPathfindThrough

      public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
      Returns if an entity using navigation type type can navigate through this block.
      Overrides:
      canPathfindThrough in class AbstractBlock
      Returns:
      if an entity using navigation type type can navigate through this block
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a(Ldjh;Lcsv;Lhx;Lefh;)Z
      intermediary method_9516 Lnet/minecraft/class_4970;method_9516(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_10;)Z
      named canPathfindThrough Lnet/minecraft/block/AbstractBlock;canPathfindThrough(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/ai/pathing/NavigationType;)Z