From 512ae4d126d11a2c708916dea92e3ddbf4569cb7 Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 16 Sep 2024 20:26:07 +0100 Subject: [PATCH] Fixed bat screech effect position when ponified. Fixes #399 --- .../com/minelittlepony/unicopia/ability/ScreechAbility.java | 5 ++++- .../minelittlepony/unicopia/client/minelittlepony/Main.java | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java index 55b9c393..52bd6e66 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/ScreechAbility.java @@ -8,6 +8,7 @@ import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.ability.data.Numeric; import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType; import com.minelittlepony.unicopia.advancement.UCriteria; +import com.minelittlepony.unicopia.client.minelittlepony.MineLPDelegate; import com.minelittlepony.unicopia.client.render.PlayerPoser.Animation; import com.minelittlepony.unicopia.entity.Living; import com.minelittlepony.unicopia.entity.damage.UDamageTypes; @@ -126,8 +127,10 @@ public class ScreechAbility implements Ability { @Override public void coolDown(Pony player, AbilitySlot slot) { + Vec3d eyePos = player.asEntity().getPos().add(0, MineLPDelegate.getInstance().getPonyHeight(player.asEntity()) * 0.8, 0); + for (int i = 0; i < 20; i++) { - player.addParticle(ParticleTypes.BUBBLE_POP, player.asEntity().getEyePos(), + player.addParticle(ParticleTypes.BUBBLE_POP, eyePos, VecHelper.supply(() -> (player.asWorld().getRandom().nextGaussian() - 0.5) * 0.3) ); } diff --git a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/Main.java b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/Main.java index 229fb3ed..4abe27c4 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/Main.java +++ b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/Main.java @@ -117,7 +117,9 @@ public class Main extends MineLPDelegate implements ClientModInitializer { @Override public float getPonyHeight(Entity entity) { - return super.getPonyHeight(entity) * IPony.getManager().getPony(entity).map(pony -> pony.metadata().getSize().getScaleFactor() + 0.1F).orElse(1F); + return super.getPonyHeight(entity) * IPony.getManager().getPony(entity) + .map(pony -> pony.race().isHuman() ? 1 : pony.metadata().getSize().getScaleFactor() + 0.1F) + .orElse(1F); } private static Race toUnicopiaRace(com.minelittlepony.api.pony.meta.Race race) {