Class SpreadableBlock

All Implemented Interfaces:
ItemConvertible, ToggleableFeature
Direct Known Subclasses:
GrassBlock, MyceliumBlock

public abstract class SpreadableBlock extends SnowyBlock
Mappings:
Namespace Name
official deg
intermediary net/minecraft/class_2500
named net/minecraft/block/SpreadableBlock
  • Constructor Details

    • SpreadableBlock

      protected SpreadableBlock(AbstractBlock.Settings settings)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldjg;<init>(Ldjg$d;)V
      intermediary <init> Lnet/minecraft/class_4970;<init>(Lnet/minecraft/class_4970$class_2251;)V
      named <init> Lnet/minecraft/block/AbstractBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;)V
  • Method Details

    • canSurvive

      private static boolean canSurvive(BlockState state, WorldView world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      official b Ldeg;b(Ldjh;Lcts;Lhx;)Z
      intermediary method_10614 Lnet/minecraft/class_2500;method_10614(Lnet/minecraft/class_2680;Lnet/minecraft/class_4538;Lnet/minecraft/class_2338;)Z
      named canSurvive Lnet/minecraft/block/SpreadableBlock;canSurvive(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;)Z
    • getCodec

      protected abstract com.mojang.serialization.MapCodec<? extends SpreadableBlock> getCodec()
      Overrides:
      getCodec in class SnowyBlock
      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;
    • canSpread

      private static boolean canSpread(BlockState state, WorldView world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      official c Ldeg;c(Ldjh;Lcts;Lhx;)Z
      intermediary method_10613 Lnet/minecraft/class_2500;method_10613(Lnet/minecraft/class_2680;Lnet/minecraft/class_4538;Lnet/minecraft/class_2338;)Z
      named canSpread Lnet/minecraft/block/SpreadableBlock;canSpread(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;)Z
    • randomTick

      public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
      Called server-side when a block gets ticked randomly. This can be overridden to implement various logics, most commonly plant growth. Default implementation calls AbstractBlock.scheduledTick(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.util.math.random.Random). To control the rate of the action, use random.

      Random tick speed is controlled by the game rule randomTickSpeed and can be disabled. Only blocks within 128-block cylinder (i.e. ignoring Y coordinates) around players receive random ticks.

      Blocks overriding this must use AbstractBlock.Settings.ticksRandomly() block settings.

      Here are some examples:

      Overrides:
      randomTick in class AbstractBlock
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Ldjg;b(Ldjh;Land;Lhx;Lauv;)V
      intermediary method_9514 Lnet/minecraft/class_4970;method_9514(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)V
      named randomTick Lnet/minecraft/block/AbstractBlock;randomTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)V