Class SpreadableBlock

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

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

    • SpreadableBlock

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

    • canSurvive

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

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

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

      protected 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 does nothing. 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
      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
      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
      official b Ldsk;b(Ldsl;Laqm;Lja;Layo;)V