mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-28 15:38:00 +01:00
24 lines
600 B
Java
24 lines
600 B
Java
|
package com.minelittlepony.unicopia.util;
|
||
|
|
||
|
import net.minecraft.entity.LimbAnimator;
|
||
|
|
||
|
public interface LimbAnimationUtil {
|
||
|
|
||
|
static void resetToZero(LimbAnimator animator) {
|
||
|
animator.setSpeed(0);
|
||
|
animator.updateLimbs(-animator.getPos(), 1);
|
||
|
animator.setSpeed(0);
|
||
|
}
|
||
|
|
||
|
static void copy(LimbAnimator from, LimbAnimator to) {
|
||
|
float prevSpeed = from.getSpeed(0);
|
||
|
float speed = from.getSpeed();
|
||
|
float pos = from.getPos();
|
||
|
|
||
|
resetToZero(to);
|
||
|
to.setSpeed(prevSpeed);
|
||
|
to.updateLimbs(pos, 1);
|
||
|
to.setSpeed(speed);
|
||
|
}
|
||
|
}
|