From 69cbe7d22255ad9786ecbf698c3cb2d269596b16 Mon Sep 17 00:00:00 2001 From: afforess Date: Mon, 21 Mar 2011 16:31:15 -0400 Subject: [PATCH] Allow Vehicle Motion to save properly --- .../java/net/minecraft/server/Entity.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 303fa6c55..54cbe9ccd 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -822,17 +822,22 @@ public abstract class Entity { this.motX = ((NBTTagDouble) nbttaglist1.a(0)).a; this.motY = ((NBTTagDouble) nbttaglist1.a(1)).a; this.motZ = ((NBTTagDouble) nbttaglist1.a(2)).a; - if (Math.abs(this.motX) > 10.0D) { - this.motX = 0.0D; - } + //CraftBukkit Start + //Exempt Vehicles from notch's sanity check + if (!(this.getBukkitEntity() instanceof CraftVehicle)) { + if (Math.abs(this.motX) > 10.0D) { + this.motX = 0.0D; + } - if (Math.abs(this.motY) > 10.0D) { - this.motY = 0.0D; - } + if (Math.abs(this.motY) > 10.0D) { + this.motY = 0.0D; + } - if (Math.abs(this.motZ) > 10.0D) { - this.motZ = 0.0D; + if (Math.abs(this.motZ) > 10.0D) { + this.motZ = 0.0D; + } } + //CraftBukkit End this.lastX = this.bi = this.locX = ((NBTTagDouble) nbttaglist.a(0)).a; this.lastY = this.bj = this.locY = ((NBTTagDouble) nbttaglist.a(1)).a;