Class CropBlock

All Implemented Interfaces:
Growable
Direct Known Subclasses:
CarrotsBlock, PotatoesBlock

public class CropBlock
extends PlantBlock
implements Growable
Mappings:
Namespace Name
official afz
intermediary net/minecraft/class_182
named net/minecraft/block/CropBlock
  • Field Details

    • field_846

      public static final IntProperty field_846
      Mappings:
      Namespace Name Mixin selector
      official a Lafz;a:Lamn;
      intermediary field_846 Lnet/minecraft/class_182;field_846:Lnet/minecraft/class_391;
      named field_846 Lnet/minecraft/block/CropBlock;field_846:Lnet/minecraft/state/property/IntProperty;
  • Constructor Details

    • CropBlock

      protected CropBlock()
  • Method Details

    • canPlantOnTop

      protected boolean canPlantOnTop​(Block block)
      Overrides:
      canPlantOnTop in class PlantBlock
      Mappings:
      Namespace Name Mixin selector
      official c Lafm;c(Lafh;)Z
      intermediary method_753 Lnet/minecraft/class_167;method_753(Lnet/minecraft/class_160;)Z
      named canPlantOnTop Lnet/minecraft/block/PlantBlock;canPlantOnTop(Lnet/minecraft/block/Block;)Z
    • scheduledTick

      public void scheduledTick​(World world, BlockPos pos, BlockState state, Random rand)
      Runs when the block is updated as per a schedule
      Overrides:
      scheduledTick in class PlantBlock
      Parameters:
      world - The world that the block is placed in
      pos - The block's position
      state - The block's BlockState
      rand - Random object
      Mappings:
      Namespace Name Mixin selector
      official b Lafh;b(Ladm;Lcj;Lalz;Ljava/util/Random;)V
      intermediary method_690 Lnet/minecraft/class_160;method_690(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;Ljava/util/Random;)V
      named scheduledTick Lnet/minecraft/block/Block;scheduledTick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Ljava/util/Random;)V
    • method_779

      public void method_779​(World world, BlockPos blockPos, BlockState blockState)
      Mappings:
      Namespace Name Mixin selector
      official g Lafz;g(Ladm;Lcj;Lalz;)V
      intermediary method_779 Lnet/minecraft/class_182;method_779(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)V
      named method_779 Lnet/minecraft/block/CropBlock;method_779(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • method_778

      protected static float method_778​(Block block, World world, BlockPos blockPos)
      Mappings:
      Namespace Name Mixin selector
      official a Lafz;a(Lafh;Ladm;Lcj;)F
      intermediary method_778 Lnet/minecraft/class_182;method_778(Lnet/minecraft/class_160;Lnet/minecraft/class_99;Lnet/minecraft/class_1372;)F
      named method_778 Lnet/minecraft/block/CropBlock;method_778(Lnet/minecraft/block/Block;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)F
    • method_755

      public boolean method_755​(World world, BlockPos blockPos, BlockState blockState)
      Overrides:
      method_755 in class PlantBlock
      Mappings:
      Namespace Name Mixin selector
      official f Lafm;f(Ladm;Lcj;Lalz;)Z
      intermediary method_755 Lnet/minecraft/class_167;method_755(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)Z
      named method_755 Lnet/minecraft/block/PlantBlock;method_755(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z
    • method_780

      protected Item method_780()
      Mappings:
      Namespace Name Mixin selector
      official l Lafz;l()Lzw;
      intermediary method_780 Lnet/minecraft/class_182;method_780()Lnet/minecraft/class_2054;
      named method_780 Lnet/minecraft/block/CropBlock;method_780()Lnet/minecraft/item/Item;
    • method_781

      protected Item method_781()
      Mappings:
      Namespace Name Mixin selector
      official n Lafz;n()Lzw;
      intermediary method_781 Lnet/minecraft/class_182;method_781()Lnet/minecraft/class_2054;
      named method_781 Lnet/minecraft/block/CropBlock;method_781()Lnet/minecraft/item/Item;
    • randomDropAsItem

      public void randomDropAsItem​(World world, BlockPos pos, BlockState state, float chance, int id)
      Called when the block must be dropped as an item by dropAsItem, but luck is taken into consideration here.
      Overrides:
      randomDropAsItem in class Block
      Parameters:
      world - The world that the block is placed in
      pos - The block's position
      state - The block's BlockState
      chance - The chance (luck factor)
      id - Id
      Mappings:
      Namespace Name Mixin selector
      official a Lafh;a(Ladm;Lcj;Lalz;FI)V
      intermediary method_646 Lnet/minecraft/class_160;method_646(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;FI)V
      named randomDropAsItem Lnet/minecraft/block/Block;randomDropAsItem(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;FI)V
    • getDropItem

      public Item getDropItem​(BlockState blockState, Random random, int state)
      Returns the item that must be dropped when the block is broken
      Overrides:
      getDropItem in class Block
      Parameters:
      blockState - The block's BlockState
      random - Random object
      state - State
      Returns:
      The Item that drops after the block breaks
      Mappings:
      Namespace Name Mixin selector
      official a Lafh;a(Lalz;Ljava/util/Random;I)Lzw;
      intermediary method_674 Lnet/minecraft/class_160;method_674(Lnet/minecraft/class_376;Ljava/util/Random;I)Lnet/minecraft/class_2054;
      named getDropItem Lnet/minecraft/block/Block;getDropItem(Lnet/minecraft/block/BlockState;Ljava/util/Random;I)Lnet/minecraft/item/Item;
    • getPickItem

      @Environment(CLIENT) public Item getPickItem​(World world, BlockPos pos)
      Called when a player presses the pick block key while facing the block. It returns the item that must be placed into the player's inventory.
      Overrides:
      getPickItem in class Block
      Returns:
      The Item that must be placed into the player's inventory
      Mappings:
      Namespace Name Mixin selector
      official c Lafh;c(Ladm;Lcj;)Lzw;
      intermediary method_702 Lnet/minecraft/class_160;method_702(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;)Lnet/minecraft/class_2054;
      named getPickItem Lnet/minecraft/block/Block;getPickItem(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/item/Item;
    • canGrow

      public boolean canGrow​(World world, BlockPos pos, BlockState state, boolean bl)
      Specified by:
      canGrow in interface Growable
      Mappings:
      Namespace Name Mixin selector
      official a Lafj;a(Ladm;Lcj;Lalz;Z)Z
      intermediary method_750 Lnet/minecraft/class_164;method_750(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;Z)Z
      named canGrow Lnet/minecraft/block/Growable;canGrow(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)Z
    • canBeFertilized

      public boolean canBeFertilized​(World world, Random random, BlockPos pos, BlockState state)
      Specified by:
      canBeFertilized in interface Growable
      Mappings:
      Namespace Name Mixin selector
      official a Lafj;a(Ladm;Ljava/util/Random;Lcj;Lalz;)Z
      intermediary method_751 Lnet/minecraft/class_164;method_751(Lnet/minecraft/class_99;Ljava/util/Random;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)Z
      named canBeFertilized Lnet/minecraft/block/Growable;canBeFertilized(Lnet/minecraft/world/World;Ljava/util/Random;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z
    • grow

      public void grow​(World world, Random random, BlockPos pos, BlockState state)
      Specified by:
      grow in interface Growable
      Mappings:
      Namespace Name Mixin selector
      official b Lafj;b(Ladm;Ljava/util/Random;Lcj;Lalz;)V
      intermediary method_752 Lnet/minecraft/class_164;method_752(Lnet/minecraft/class_99;Ljava/util/Random;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)V
      named grow Lnet/minecraft/block/Growable;grow(Lnet/minecraft/world/World;Ljava/util/Random;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • stateFromData

      public BlockState stateFromData​(int data)
      Returns a blockstate of the current block from it's id
      Overrides:
      stateFromData in class Block
      Parameters:
      data - The Blockstate's associated data value
      Returns:
      The Default state
      Mappings:
      Namespace Name Mixin selector
      official a Lafh;a(I)Lalz;
      intermediary method_637 Lnet/minecraft/class_160;method_637(I)Lnet/minecraft/class_376;
      named stateFromData Lnet/minecraft/block/Block;stateFromData(I)Lnet/minecraft/block/BlockState;
    • getData

      public int getData​(BlockState state)
      Returns the data value for a blockstate Throws an IllegalArmumentException as this method does not work
      Overrides:
      getData in class Block
      Parameters:
      state - The Blockstate
      Returns:
      Zero
      Mappings:
      Namespace Name Mixin selector
      official c Lafh;c(Lalz;)I
      intermediary method_706 Lnet/minecraft/class_160;method_706(Lnet/minecraft/class_376;)I
      named getData Lnet/minecraft/block/Block;getData(Lnet/minecraft/block/BlockState;)I
    • appendProperties

      protected StateManager appendProperties()
      Returns a new state manager with a property array.
      Overrides:
      appendProperties in class Block
      Returns:
      New state manager
      Mappings:
      Namespace Name Mixin selector
      official e Lafh;e()Lama;
      intermediary method_714 Lnet/minecraft/class_160;method_714()Lnet/minecraft/class_378;
      named appendProperties Lnet/minecraft/block/Block;appendProperties()Lnet/minecraft/state/StateManager;