Class ParticleDropBlockComponent
java.lang.Object
org.cyclops.cyclopscore.block.component.ParticleDropBlockComponent
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected floatprotected floatprotected float -
Constructor Summary
ConstructorsConstructorDescriptionParticleDropBlockComponent(float particleRed, float particleGreen, float particleBlue) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidrandomDisplayTick(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.voidsetChance(int chance) Sets the chance for drop particles.voidsetOffset(int offset) Set the offset to a lower Y where the drops should appear.
-
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:IEntityDropParticleFXBlockCalled when a random display tick occurs.- Specified by:
randomDisplayTickin interfaceIEntityDropParticleFXBlock- Parameters:
blockState- The block state.world- The world.blockPos- The position.rand- Random object.
-