Fixed drake not updating when it grabs a spell, and make them stand at eye height

This commit is contained in:
Sollace 2019-02-05 22:47:48 +02:00
parent 2895e5881c
commit 6a17f1dd1c
2 changed files with 5 additions and 1 deletions

View file

@ -76,7 +76,7 @@ public class ModelGem extends ModelBase {
EntitySpell spell = (EntitySpell)entity; EntitySpell spell = (EntitySpell)entity;
float floatOffset = MathHelper.sin((spell.ticksExisted + stutter) / 10 + spell.hoverStart) / 10 + 0.1F; 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; floatOffset = (spell.ticksExisted + stutter) / 20;
if (spell.getCurrentLevel() > 0) { if (spell.getCurrentLevel() > 0) {

View file

@ -64,6 +64,9 @@ public class SpellDrake extends AbstractSpell {
((PathNavigateGround)living.getNavigator()).setCanSwim(false); ((PathNavigateGround)living.getNavigator()).setCanSwim(false);
living.tasks.addTask(1, new EntityAISwimming(living)); living.tasks.addTask(1, new EntityAISwimming(living));
living.tasks.addTask(2, new EntityAIFollowCaster<>(source, 1, 4, 70)); 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 = i.getEffect().copy();
piggyBackSpell.onPlaced(source); piggyBackSpell.onPlaced(source);
i.setEffect(null); i.setEffect(null);
setDirty(true);
}); });
} }