Class AttachedStemBlock

All Implemented Interfaces:
ItemConvertible, ToggleableFeature

public class AttachedStemBlock extends PlantBlock
Mappings:
Namespace Name
official crx
intermediary net/minecraft/class_2195
named net/minecraft/block/AttachedStemBlock
  • Field Details

    • FACING

      public static final DirectionProperty FACING
      Mappings:
      Namespace Name Mixin selector
      official a Lcrx;a:Ldgd;
      intermediary field_9873 Lnet/minecraft/class_2195;field_9873:Lnet/minecraft/class_2753;
      named FACING Lnet/minecraft/block/AttachedStemBlock;FACING:Lnet/minecraft/state/property/DirectionProperty;
    • field_30995

      protected static final float field_30995
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lcrx;b:F
      intermediary field_30995 Lnet/minecraft/class_2195;field_30995:F
      named field_30995 Lnet/minecraft/block/AttachedStemBlock;field_30995:F
    • FACING_TO_SHAPE

      private static final Map<Direction,VoxelShape> FACING_TO_SHAPE
      Mappings:
      Namespace Name Mixin selector
      official c Lcrx;c:Ljava/util/Map;
      intermediary field_9874 Lnet/minecraft/class_2195;field_9874:Ljava/util/Map;
      named FACING_TO_SHAPE Lnet/minecraft/block/AttachedStemBlock;FACING_TO_SHAPE:Ljava/util/Map;
    • gourdBlock

      private final GourdBlock gourdBlock
      Mappings:
      Namespace Name Mixin selector
      official d Lcrx;d:Ldas;
      intermediary field_9875 Lnet/minecraft/class_2195;field_9875:Lnet/minecraft/class_2511;
      named gourdBlock Lnet/minecraft/block/AttachedStemBlock;gourdBlock:Lnet/minecraft/block/GourdBlock;
    • pickBlockItem

      private final Supplier<Item> pickBlockItem
      Mappings:
      Namespace Name Mixin selector
      official e Lcrx;e:Ljava/util/function/Supplier;
      intermediary field_27095 Lnet/minecraft/class_2195;field_27095:Ljava/util/function/Supplier;
      named pickBlockItem Lnet/minecraft/block/AttachedStemBlock;pickBlockItem:Ljava/util/function/Supplier;
  • Constructor Details

    • AttachedStemBlock

      protected AttachedStemBlock(GourdBlock gourdBlock, Supplier<Item> pickBlockItem, AbstractBlock.Settings settings)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcrx;<init>(Ldas;Ljava/util/function/Supplier;Ldfi$d;)V
      intermediary <init> Lnet/minecraft/class_2195;<init>(Lnet/minecraft/class_2511;Ljava/util/function/Supplier;Lnet/minecraft/class_4970$class_2251;)V
      named <init> Lnet/minecraft/block/AttachedStemBlock;<init>(Lnet/minecraft/block/GourdBlock;Ljava/util/function/Supplier;Lnet/minecraft/block/AbstractBlock$Settings;)V
  • Method Details

    • getOutlineShape

      public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
      Overrides:
      getOutlineShape in class AbstractBlock
      Mappings:
      Namespace Name Mixin selector
      official a Ldfi;a(Ldfj;Lcpb;Lgw;Lehs;)Leig;
      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;
    • getStateForNeighborUpdate

      public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos)
      Returns the state of the block after a neighboring block's state change.

      Returning Blocks.AIR breaks the block. This is useful to implement supporting block requirement for blocks (if used along with AbstractBlock.canPlaceAt(net.minecraft.block.BlockState, net.minecraft.world.WorldView, net.minecraft.util.math.BlockPos)).

      Side effects like activating a redstone component (but not scheduling a tick) should be performed in 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) instead. If the block supports waterlogging and currently has water, this method should be overridden to tick the fluid at the block's position.

      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. This is not called if Block.FORCE_STATE flag is set in the setBlockState call.

      This method can be used for multiple purposes. Here are some examples:

      • FenceBlock uses it to update the fence's connection when a horizontally neighboring block's state is changed.
      • PlantBlock uses it to break the plant if the state change causes it to lose its supporting block.
      • DoorBlock uses it to copy the state of the other half of the door.
      • SlabBlock uses it to schedule the fluid to tick if waterlogged.
      • SoulSandBlock uses it to schedule the water block above to tick so that it becomes a bubble column.
      • FallingBlock uses it to schedule the block to tick so that it can fall if needed.
      Overrides:
      getStateForNeighborUpdate in class PlantBlock
      Parameters:
      state - the state of this block
      direction - the direction from this block to the neighbor
      neighborState - the state of the updated neighbor block
      world - the world
      pos - the position of this block
      neighborPos - the position of the neighbor block
      Returns:
      the state of the block after a neighboring block's state change
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldfi;a(Ldfj;Lha;Ldfj;Lcpw;Lgw;Lgw;)Ldfj;
      intermediary method_9559 Lnet/minecraft/class_4970;method_9559(Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;
      named getStateForNeighborUpdate Lnet/minecraft/block/AbstractBlock;getStateForNeighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;
    • canPlantOnTop

      protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos)
      Overrides:
      canPlantOnTop in class PlantBlock
      Mappings:
      Namespace Name Mixin selector
      official d Lctd;d(Ldfj;Lcpb;Lgw;)Z
      intermediary method_9695 Lnet/minecraft/class_2261;method_9695(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z
      named canPlantOnTop Lnet/minecraft/block/PlantBlock;canPlantOnTop(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Z
    • getPickStack

      public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state)
      Returns the new item stack when using pick block functionality.

      Pick block is available via middle-clicking by default. Blocks without the corresponding BlockItem, such as crops, should override this method to return the correct item stack.

      Overrides:
      getPickStack in class Block
      Returns:
      the new item stack when using pick block functionality
      Mappings:
      Namespace Name Mixin selector
      official a Lcsv;a(Lcpb;Lgw;Ldfj;)Lcjf;
      intermediary method_9574 Lnet/minecraft/class_2248;method_9574(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Lnet/minecraft/class_1799;
      named getPickStack Lnet/minecraft/block/Block;getPickStack(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;
    • 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 Ldfi;a(Ldfj;Lczh;)Ldfj;
      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 Ldfi;a(Ldfj;Lcxq;)Ldfj;
      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 Lcsv;a(Ldfk$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