From a36aa10085b24cd942415a129eb340dd83f6450c Mon Sep 17 00:00:00 2001 From: Sollace Date: Wed, 31 Jan 2024 14:05:14 +0000 Subject: [PATCH] Add the dust cloud when pegasi take off from sand, gravel, and concrete power + fix dust particles flying away too quickly from where a pegasus takes off --- .../unicopia/entity/player/PlayerPhysics.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java index bb9b68e9..e1a6cd75 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -40,6 +40,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; +import net.minecraft.particle.BlockStateParticleEffect; import net.minecraft.particle.ParticleTypes; import net.minecraft.predicate.entity.EntityPredicates; import net.minecraft.registry.RegistryKeys; @@ -564,10 +565,14 @@ public class PlayerPhysics extends EntityPhysics implements Tickab entity.calculateDimensions(); if (entity.isOnGround() || !force) { - Supplier pos = VecHelper.sphere(pony.asWorld().getRandom(), 0.5D); - Supplier vel = VecHelper.sphere(pony.asWorld().getRandom(), 0.15D); - pony.spawnParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, pos, vel, 5); - pony.spawnParticles(ParticleTypes.CLOUD, pos, vel, 5); + BlockState steppingState = pony.asEntity().getSteppingBlockState(); + if (steppingState.isIn(UTags.KICKS_UP_DUST)) { + pony.addParticle(new BlockStateParticleEffect(UParticles.DUST_CLOUD, steppingState), pony.getOrigin().down().toCenterPos(), Vec3d.ZERO); + } else { + Supplier pos = VecHelper.sphere(pony.asWorld().getRandom(), 0.5D); + Supplier vel = VecHelper.sphere(pony.asWorld().getRandom(), 0.015D); + pony.spawnParticles(ParticleTypes.CLOUD, pos, vel, 5); + } } }