mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
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
This commit is contained in:
parent
dc6bc9fe9e
commit
a36aa10085
1 changed files with 9 additions and 4 deletions
|
@ -40,6 +40,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.damage.DamageSource;
|
import net.minecraft.entity.damage.DamageSource;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NbtCompound;
|
import net.minecraft.nbt.NbtCompound;
|
||||||
|
import net.minecraft.particle.BlockStateParticleEffect;
|
||||||
import net.minecraft.particle.ParticleTypes;
|
import net.minecraft.particle.ParticleTypes;
|
||||||
import net.minecraft.predicate.entity.EntityPredicates;
|
import net.minecraft.predicate.entity.EntityPredicates;
|
||||||
import net.minecraft.registry.RegistryKeys;
|
import net.minecraft.registry.RegistryKeys;
|
||||||
|
@ -564,12 +565,16 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
|
||||||
entity.calculateDimensions();
|
entity.calculateDimensions();
|
||||||
|
|
||||||
if (entity.isOnGround() || !force) {
|
if (entity.isOnGround() || !force) {
|
||||||
|
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<Vec3d> pos = VecHelper.sphere(pony.asWorld().getRandom(), 0.5D);
|
Supplier<Vec3d> pos = VecHelper.sphere(pony.asWorld().getRandom(), 0.5D);
|
||||||
Supplier<Vec3d> vel = VecHelper.sphere(pony.asWorld().getRandom(), 0.15D);
|
Supplier<Vec3d> vel = VecHelper.sphere(pony.asWorld().getRandom(), 0.015D);
|
||||||
pony.spawnParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, pos, vel, 5);
|
|
||||||
pony.spawnParticles(ParticleTypes.CLOUD, pos, vel, 5);
|
pony.spawnParticles(ParticleTypes.CLOUD, pos, vel, 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void handleWallCollission(MutableVector velocity) {
|
private void handleWallCollission(MutableVector velocity) {
|
||||||
if (wallHitCooldown > 0) {
|
if (wallHitCooldown > 0) {
|
||||||
|
|
Loading…
Reference in a new issue