Skip to content

Commit

Permalink
Assertions int ParticleUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
ktpatient committed Mar 1, 2025
1 parent ecfd98b commit b97100e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public final class ParticleUtils {

// Method for spawning particles around an item entity
public static void spawnParticlesAroundItem(ItemEntity itemEntity, Level level, ParticleOptions particlesTypes) {
assert level.isClientSide;
if (particleTicks % PARTICLE_DELAY == 0) {
for (int i = 0; i < PARTICLE_COUNT; i++) {
double theta = level.random.nextDouble() * Math.PI * 2;
Expand All @@ -40,6 +41,8 @@ public static void spawnParticlesAroundItem(ItemEntity itemEntity, Level level,

// Method for spawning particles around a block
public static void spawnParticlesAroundBlock(BlockPos blockPos, Level level, ParticleOptions particlesTypes) {
assert level.isClientSide;

if (particleTicks % PARTICLE_DELAY == 0) {
for (int i = 0; i < PARTICLE_COUNT; i++) {
double theta = level.random.nextDouble() * Math.PI * 2;
Expand All @@ -61,6 +64,7 @@ public static void spawnParticlesAroundBlock(BlockPos blockPos, Level level, Par
}

public static void spawnBreakParticle(BlockPos pos, Block block, int count) {
assert Minecraft.getInstance().level != null && Minecraft.getInstance().level.isClientSide;
for (int i = 0; i < count; i++) {
Minecraft.getInstance().particleEngine.add(new TerrainParticle(Minecraft.getInstance().level, pos.getX() + 0.5f, pos.above().getY(), pos.getZ() + 0.5f,
0 + ((double) i / 10), 0 + ((double) i / 10), 0 + ((double) i / 10), block.defaultBlockState()));
Expand Down

0 comments on commit b97100e

Please sign in to comment.