@Override public void onDisable(Entity entity) { if (entity instanceof EntityModeled) { EntityModeled model = (EntityModeled) entity; ModelInstance instance = model.getModelInstance(); if (instance != null && instance.isPlayingAnyAnimations()) { instance.getAnimationInstance(0).startPlay(); } } }
@Override public void onUpdate(Entity entity) { this._move.set(entity.getViewVector()); this._move.y = 0; this._move.normalise(); this._move.scale(entity.getSpeed()); entity.move(this._move); if (entity instanceof EntityModeled) { EntityModeled model = (EntityModeled) entity; ModelInstance instance = model.getModelInstance(); if (instance != null && !instance.isPlayingAnyAnimations()) { instance.getAnimationInstance(0).startPlay(); } } }