Skip to content

Commit

Permalink
Update InjectBlock.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Chailotl committed May 15, 2024
1 parent 6f74ac6 commit b147cc3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/chailotl/particular/mixin/InjectBlock.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.chailotl.particular.mixin;

import com.chailotl.particular.Main;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.*;
import net.minecraft.client.util.ParticleUtil;
import net.minecraft.registry.entry.RegistryEntry;
Expand Down Expand Up @@ -30,9 +28,11 @@ private static boolean isValidBiome(RegistryEntry<Biome> biome)
}

@Inject(at = @At("TAIL"), method = "randomDisplayTick")
public void spawnFireflies(BlockState state, World world, BlockPos pos, Random random, CallbackInfo ci)
public void spawnParticles(BlockState state, World world, BlockPos pos, Random random, CallbackInfo ci)
{
Block block = state.getBlock();

// Fireflies
boolean isGrass = block == Blocks.GRASS || block == Blocks.TALL_GRASS;
if (isGrass ||
block instanceof FlowerBlock ||
Expand All @@ -48,7 +48,7 @@ public void spawnFireflies(BlockState state, World world, BlockPos pos, Random r
else if (block == Blocks.AIR || block == Blocks.CAVE_AIR)
{
// Cave dust
if (random.nextInt(500) == 0 && pos.getY() < world.getSeaLevel() && isValidBiome(world.getBiome(pos)) && !state.isOf(Blocks.VOID_AIR))
if (random.nextInt(500) == 0 && pos.getY() < world.getSeaLevel() && isValidBiome(world.getBiome(pos)))
{
float lightChance = 1f - Math.min(8, world.getLightLevel(LightType.SKY, pos)) / 8f;
float depthChance = Math.min(1f, (world.getSeaLevel() - pos.getY()) / 96f);
Expand Down

0 comments on commit b147cc3

Please sign in to comment.