Skip to content

Commit 81d6616

Browse files
committedJun 15, 2016
Fix the motion angles for other players.
1 parent 8d29614 commit 81d6616

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
 

‎src/main/java/com/brohoof/minelittlepony/mixin/MixinRenderPlayer.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,13 @@ private ModelRenderer redirectRightArmwear(ModelPlayer mr) {
177177
shift = Shift.AFTER))
178178
private void onRotateCorpse(AbstractClientPlayer player, float yaw, float pitch, float ticks, CallbackInfo ci) {
179179
if (this.mainModel instanceof ModelPlayerPony) {
180-
double motionY = player.motionY;
180+
double motionX = player.posX - player.prevPosX;
181+
double motionY = player.posY - player.prevPosY;
182+
double motionZ = player.posZ - player.prevPosZ;
181183
if (player.onGround) {
182184
motionY = 0;
183185
}
184-
double dist = Math.sqrt(player.motionX * player.motionX + player.motionZ * player.motionZ);
186+
double dist = Math.sqrt(motionX * motionX + motionZ * motionZ);
185187
double angle = Math.atan2(motionY, dist);
186188
if (!player.capabilities.isFlying) {
187189
if (angle > 0) {
@@ -194,11 +196,6 @@ private void onRotateCorpse(AbstractClientPlayer player, float yaw, float pitch,
194196
angle *= -1;
195197
}
196198

197-
// if (player.motionY > 0.2 && dist < 1) {
198-
//
199-
// // TODO straight up/down
200-
// angle = Math.signum(player.motionY) * Math.PI / 3;
201-
// }
202199
if (angle > Math.PI / 3)
203200
angle = Math.PI / 3;
204201
if (angle < -Math.PI / 3)

0 commit comments

Comments
 (0)