Class ParticleDropBlockComponent

java.lang.Object
org.cyclops.cyclopscore.block.component.ParticleDropBlockComponent
All Implemented Interfaces:
IEntityDropParticleFXBlock

public class ParticleDropBlockComponent extends Object implements IEntityDropParticleFXBlock
Component that can show drops of a certain color underneath blocks. This has by default the same behaviour as lava and water drops underneath the blocks underneath them. But this offset can be altered.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected int
     
    protected float
     
    protected float
     
    protected float
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ParticleDropBlockComponent(float particleRed, float particleGreen, float particleBlue)
    Make a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    randomDisplayTick(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos blockPos, net.minecraft.util.RandomSource rand)
    Called when a random display tick occurs.
    void
    setChance(int chance)
    Sets the chance for drop particles.
    void
    setOffset(int offset)
    Set the offset to a lower Y where the drops should appear.

    Methods inherited from class java.lang.Object

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

    • particleRed

      protected float particleRed
    • particleGreen

      protected float particleGreen
    • particleBlue

      protected float particleBlue
    • offset

      protected int offset
    • chance

      protected int chance
  • Constructor Details

    • ParticleDropBlockComponent

      public ParticleDropBlockComponent(float particleRed, float particleGreen, float particleBlue)
      Make a new instance.
      Parameters:
      particleRed - Red color.
      particleGreen - Green color.
      particleBlue - Blue color.
  • Method Details

    • setOffset

      public void setOffset(int offset)
      Set the offset to a lower Y where the drops should appear.
      Parameters:
      offset - Amount of blocks to a lower Y.
    • setChance

      public void setChance(int chance)
      Sets the chance for drop particles.
      Parameters:
      chance - Every tick there will be a 1/chance chance.
    • randomDisplayTick

      public void randomDisplayTick(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos blockPos, net.minecraft.util.RandomSource rand)
      Description copied from interface: IEntityDropParticleFXBlock
      Called when a random display tick occurs.
      Specified by:
      randomDisplayTick in interface IEntityDropParticleFXBlock
      Parameters:
      blockState - The block state.
      world - The world.
      blockPos - The position.
      rand - Random object.