mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 05:47:59 +01:00
Fixed particles not spawning for small entities
This commit is contained in:
parent
c5074c41de
commit
d9b6c3f6e0
1 changed files with 2 additions and 2 deletions
|
@ -12,10 +12,10 @@ import net.minecraft.particle.ParticleEffect;
|
||||||
public final class ParticleUtils {
|
public final class ParticleUtils {
|
||||||
|
|
||||||
public static void spawnParticles(ParticleEffect particleId, Entity entity, int count) {
|
public static void spawnParticles(ParticleEffect particleId, Entity entity, int count) {
|
||||||
double halfDist = entity.getStandingEyeHeight() / 1.5;
|
double halfDist = Math.abs(entity.getStandingEyeHeight() / 1.5);
|
||||||
double middle = entity.getBoundingBox().y1 + halfDist;
|
double middle = entity.getBoundingBox().y1 + halfDist;
|
||||||
|
|
||||||
Shape shape = new Sphere(false, (float)halfDist + entity.getWidth());
|
Shape shape = new Sphere(false, Math.abs((float)halfDist + entity.getWidth()));
|
||||||
|
|
||||||
shape.randomPoints(count, entity.world.random).forEach(point -> {
|
shape.randomPoints(count, entity.world.random).forEach(point -> {
|
||||||
entity.world.addParticle(particleId,
|
entity.world.addParticle(particleId,
|
||||||
|
|
Loading…
Reference in a new issue