Fixed bat screech effect position when ponified. Fixes #399

This commit is contained in:
Sollace 2024-09-16 20:26:07 +01:00
parent 1b2f0ebd6b
commit 512ae4d126
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 7 additions and 2 deletions

View file

@ -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<Numeric> {
@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)
);
}

View file

@ -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) {