Class DecayCommon

java.lang.Object
etithespirit.orimod.common.block.decay.DecayCommon

public final class DecayCommon extends Object
Values common across most spreading Decay blocks.
Author:
Eti
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.world.level.block.state.properties.BooleanProperty
    A property storing if all adjacent blocks are decay blocks.
    static final Map<net.minecraft.world.level.block.state.BlockState,net.minecraft.world.level.block.state.BlockState>
    Deprecated, for removal: This API element is subject to removal in a future version.
    static final Map<net.minecraft.world.level.block.state.StateHolder<?,?>,net.minecraft.world.level.block.state.StateHolder<?,?>>
    A mapping where keys are origin states and values are Decay equivalents.
    static final net.minecraft.world.level.block.state.properties.IntegerProperty
    Since some blocks may not be connected in an adjacent fashion, this is the rarity of a chance that a random tick will be used to check diagonally connected blocks (to get a full 3x3 cube).
    Lower values denote more frequent tests.
    static final int
    A limit of 1 in (this many) blocks will perform an edge test.
    static final Map<net.minecraft.world.level.material.FluidState,net.minecraft.world.level.material.FluidState>
    Deprecated, for removal: This API element is subject to removal in a future version.
    static final int
    The maximum amount of times that a random diagonal placement will bounce between positions if it scans a position that is already occupied by a decay block before just giving up.
    static final net.minecraft.world.phys.shapes.VoxelShape[]
    An array of panel shaped collision boxes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isDecayBlock(net.minecraft.world.level.block.Block block)
    Returns true if the block classifies as a decay block.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • EDGE_TEST_MINIMUM_CHANCE

      public static final int EDGE_TEST_MINIMUM_CHANCE
      A limit of 1 in (this many) blocks will perform an edge test.
      See Also:
    • MAX_DIAGONAL_TESTS

      public static final int MAX_DIAGONAL_TESTS
      The maximum amount of times that a random diagonal placement will bounce between positions if it scans a position that is already occupied by a decay block before just giving up.
      See Also:
    • ALL_ADJACENT_ARE_DECAY

      public static final net.minecraft.world.level.block.state.properties.BooleanProperty ALL_ADJACENT_ARE_DECAY
      A property storing if all adjacent blocks are decay blocks. This is used for performance optimizations to avoid checking if there's no need to.
      While it was a bit of an extra step to implement, this was instrumental
    • EDGE_DETECTION_RARITY

      public static final net.minecraft.world.level.block.state.properties.IntegerProperty EDGE_DETECTION_RARITY
      Since some blocks may not be connected in an adjacent fashion, this is the rarity of a chance that a random tick will be used to check diagonally connected blocks (to get a full 3x3 cube).
      Lower values denote more frequent tests. Think of it as "1 in (this many + 1) tests will look for edge blocks."
    • PANELS

      public static final net.minecraft.world.phys.shapes.VoxelShape[] PANELS
      An array of panel shaped collision boxes. For those unaware, the units are pixels, so 16 is a full block. The order of this array matters for use in DecaySurfaceMyceliumBlock
    • BLOCK_REPLACEMENT_TARGETS

      @Deprecated(forRemoval=true) public static final Map<net.minecraft.world.level.block.state.BlockState,net.minecraft.world.level.block.state.BlockState> BLOCK_REPLACEMENT_TARGETS
      Deprecated, for removal: This API element is subject to removal in a future version.
      A mapping where keys are vanilla BlockStates and values are Decay equivalents.
    • DECAY_REPLACEMENT_TARGETS

      public static final Map<net.minecraft.world.level.block.state.StateHolder<?,?>,net.minecraft.world.level.block.state.StateHolder<?,?>> DECAY_REPLACEMENT_TARGETS
      A mapping where keys are origin states and values are Decay equivalents.
    • FLUID_REPLACEMENT_TARGETS

      @Deprecated(forRemoval=true) public static final Map<net.minecraft.world.level.material.FluidState,net.minecraft.world.level.material.FluidState> FLUID_REPLACEMENT_TARGETS
      Deprecated, for removal: This API element is subject to removal in a future version.
      A mapping where keys are vanilla FluidStates and values are Decay equivalents.
  • Method Details

    • isDecayBlock

      public static boolean isDecayBlock(net.minecraft.world.level.block.Block block)
      Returns true if the block classifies as a decay block.
      Parameters:
      block - The block to check.
      Returns:
      True if this block classifies as a decay block.