diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java index 636928b..6c72cc3 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java @@ -9,7 +9,7 @@ public class EaglercraftVersion { /// Customize these to fit your fork: public static final String projectForkName = "Eaglercraft Lambda"; - public static final String projectForkVersion = "0.3.0"; + public static final String projectForkVersion = "0.3.1"; public static final String projectForkVendor = "hoosiertransfer"; public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; diff --git a/src/main/java/net/minecraft/entity/EntityLivingBase.java b/src/main/java/net/minecraft/entity/EntityLivingBase.java index f181c0e..94d2740 100644 --- a/src/main/java/net/minecraft/entity/EntityLivingBase.java +++ b/src/main/java/net/minecraft/entity/EntityLivingBase.java @@ -1435,8 +1435,8 @@ public abstract class EntityLivingBase extends Entity { if (rotation < 0.0F) { double d9 = d8 * (double) (-MathHelper.sin(rotation)) * 0.04D; this.motionY += d9 * 3.2D; - this.motionX -= vec3d.xCoord * d9 / d6; - this.motionZ -= vec3d.zCoord * d9 / d6; + this.motionX -= vec3d.xCoord * d9 / (d6); + this.motionZ -= vec3d.zCoord * d9 / (d6); } if (d6 > 0.0D) { @@ -1447,6 +1447,17 @@ public abstract class EntityLivingBase extends Entity { this.motionX *= 0.9900000095367432D; this.motionY *= 0.9800000190734863D; this.motionZ *= 0.9900000095367432D; + // if motion is nan or infinite, reset it + if (Double.isNaN(this.motionX) || Double.isInfinite(this.motionX)) { + this.motionX = 0.0D; + } + if (Double.isNaN(this.motionZ) || Double.isInfinite(this.motionZ)) { + this.motionZ = 0.0D; + } + + this.motionX = MathHelper.clamp_double(this.motionX, -4.0D, 4.0D); + this.motionZ = MathHelper.clamp_double(this.motionZ, -4.0D, 4.0D); + this.moveEntity(this.motionX, this.motionY, this.motionZ); if (this.isCollidedHorizontally && !this.worldObj.isRemote) {