From 6a17f1dd1c6360802715c4a6e685abe6440adce0 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 5 Feb 2019 22:47:48 +0200 Subject: [PATCH] Fixed drake not updating when it grabs a spell, and make them stand at eye height --- src/main/java/com/minelittlepony/unicopia/model/ModelGem.java | 2 +- .../java/com/minelittlepony/unicopia/spell/SpellDrake.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/model/ModelGem.java b/src/main/java/com/minelittlepony/unicopia/model/ModelGem.java index 85d9e6c2..dce49f82 100644 --- a/src/main/java/com/minelittlepony/unicopia/model/ModelGem.java +++ b/src/main/java/com/minelittlepony/unicopia/model/ModelGem.java @@ -76,7 +76,7 @@ public class ModelGem extends ModelBase { EntitySpell spell = (EntitySpell)entity; float floatOffset = MathHelper.sin((spell.ticksExisted + stutter) / 10 + spell.hoverStart) / 10 + 0.1F; - GlStateManager.translate(0, floatOffset, 0); + GlStateManager.translate(0, floatOffset - entity.getEyeHeight(), 0); floatOffset = (spell.ticksExisted + stutter) / 20; if (spell.getCurrentLevel() > 0) { diff --git a/src/main/java/com/minelittlepony/unicopia/spell/SpellDrake.java b/src/main/java/com/minelittlepony/unicopia/spell/SpellDrake.java index 48ef3f6c..e484dc18 100644 --- a/src/main/java/com/minelittlepony/unicopia/spell/SpellDrake.java +++ b/src/main/java/com/minelittlepony/unicopia/spell/SpellDrake.java @@ -64,6 +64,9 @@ public class SpellDrake extends AbstractSpell { ((PathNavigateGround)living.getNavigator()).setCanSwim(false); living.tasks.addTask(1, new EntityAISwimming(living)); living.tasks.addTask(2, new EntityAIFollowCaster<>(source, 1, 4, 70)); + living.height = 1.8F; + + living.setPosition(living.posX, living.posY, living.posZ); } } @@ -77,6 +80,7 @@ public class SpellDrake extends AbstractSpell { piggyBackSpell = i.getEffect().copy(); piggyBackSpell.onPlaced(source); i.setEffect(null); + setDirty(true); }); }