diff --git a/patches/minecraft/net/minecraft/client/particle/TerrainParticle.java.patch b/patches/minecraft/net/minecraft/client/particle/TerrainParticle.java.patch index 86b9920080..4ab28232ef 100644 --- a/patches/minecraft/net/minecraft/client/particle/TerrainParticle.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/TerrainParticle.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/client/particle/TerrainParticle.java +++ b/net/minecraft/client/particle/TerrainParticle.java +@@ -28,7 +_,7 @@ + this.f_107227_ = 0.6F; + this.f_107228_ = 0.6F; + this.f_107229_ = 0.6F; +- if (!p_172458_.m_60713_(Blocks.f_50440_)) { ++ if (net.minecraftforge.client.extensions.common.IClientBlockExtensions.of(p_172458_).areBreakingParticlesTinted(p_172458_, p_172451_, p_172459_)) { + int i = Minecraft.m_91087_().m_91298_().m_92577_(p_172458_, p_172451_, p_172459_, 0); + this.f_107227_ *= (float)(i >> 16 & 255) / 255.0F; + this.f_107228_ *= (float)(i >> 8 & 255) / 255.0F; @@ -69,7 +_,13 @@ public static class Provider implements ParticleProvider { public Particle m_6966_(BlockParticleOption p_108304_, ClientLevel p_108305_, double p_108306_, double p_108307_, double p_108308_, double p_108309_, double p_108310_, double p_108311_) { diff --git a/src/main/java/net/minecraftforge/client/extensions/common/IClientBlockExtensions.java b/src/main/java/net/minecraftforge/client/extensions/common/IClientBlockExtensions.java index 7c4f42df9a..faedbf56f3 100644 --- a/src/main/java/net/minecraftforge/client/extensions/common/IClientBlockExtensions.java +++ b/src/main/java/net/minecraftforge/client/extensions/common/IClientBlockExtensions.java @@ -5,6 +5,7 @@ package net.minecraftforge.client.extensions.common; +import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.particle.ParticleEngine; import net.minecraft.core.BlockPos; import net.minecraft.tags.FluidTags; @@ -15,6 +16,7 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.phys.HitResult; @@ -113,4 +115,17 @@ public interface IClientBlockExtensions } return originalColor; } + + /** + * Returns true if the breaking particles created from the {@link BlockState} passed should be tinted with biome colors. + * + * @param state The state of this block + * @param level The level the particles are spawning in + * @param pos The position of the block + * @return {@code true} if the particles should be tinted. + */ + default boolean areBreakingParticlesTinted(BlockState state, ClientLevel level, BlockPos pos) + { + return !state.is(Blocks.GRASS_BLOCK); + } }