From 4470462a54954109ebb39dcd0cc3bb4be983a050 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 9 Jan 2015 16:59:18 +1100 Subject: SPIGOT-387: Remove redundant custom vehicle handling. --- nms-patches/Entity.patch | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'nms-patches/Entity.patch') diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch index 44025a59..36f8960a 100644 --- a/nms-patches/Entity.patch +++ b/nms-patches/Entity.patch @@ -1,5 +1,5 @@ ---- ../work/decompile-8eb82bde//net/minecraft/server/Entity.java 2015-01-04 20:00:32.717671452 +0000 -+++ src/main/java/net/minecraft/server/Entity.java 2015-01-04 20:00:32.721671452 +0000 +--- ../work/decompile-8eb82bde/net/minecraft/server/Entity.java 2015-01-09 16:56:08.177542854 +1100 ++++ src/main/java/net/minecraft/server/Entity.java 2015-01-09 16:56:08.181542844 +1100 @@ -6,8 +6,40 @@ import java.util.UUID; import java.util.concurrent.Callable; @@ -315,7 +315,7 @@ + } + } + // CraftBukkit end -+ + + // CraftBukkit start - Exempt Vehicles from notch's sanity check + if (!(getBukkitEntity() instanceof Vehicle)) { + if (Math.abs(this.motX) > 10.0D) { @@ -331,7 +331,7 @@ + } + } + // CraftBukkit end - ++ + // CraftBukkit start - Reset world + if (this instanceof EntityPlayer) { + Server server = Bukkit.getServer(); @@ -371,14 +371,11 @@ EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack); entityitem.p(); -@@ -1276,16 +1491,76 @@ +@@ -1275,17 +1490,70 @@ + return (double) this.length * 0.75D; } - public void mount(Entity entity) { -+ // CraftBukkit start -+ setPassengerOf(entity); -+ } -+ ++ // CraftBukkit start + protected CraftEntity bukkitEntity; + + public CraftEntity getBukkitEntity() { @@ -388,10 +385,7 @@ + return bukkitEntity; + } + -+ public void setPassengerOf(Entity entity) { -+ // b(null) doesn't really fly for overloaded methods, -+ // so this method is needed -+ + public void mount(Entity entity) { + Entity originalVehicle = this.vehicle; + Entity originalPassenger = this.vehicle == null ? null : this.vehicle.passenger; + PluginManager pluginManager = Bukkit.getPluginManager(); @@ -437,7 +431,7 @@ + if (event.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) { + // If we only cancelled the enterevent then we need to put the player in a decent position. + if (exitEvent != null && this.vehicle == originalVehicle && this.vehicle != null && this.vehicle.passenger == originalPassenger) { -+ this.setPositionRotation(this.vehicle.locX, this.vehicle.boundingBox.b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch); ++ this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch); + this.vehicle.passenger = null; + this.vehicle = null; + } @@ -448,7 +442,7 @@ if (this.vehicle != null) { this.vehicle.passenger = null; } -@@ -1406,10 +1681,50 @@ +@@ -1406,10 +1674,50 @@ } public void onLightningStrike(EntityLightning entitylightning) { @@ -500,7 +494,7 @@ } } -@@ -1546,32 +1861,82 @@ +@@ -1546,32 +1854,82 @@ if (!this.world.isStatic && !this.dead) { this.world.methodProfiler.a("changeDimension"); MinecraftServer minecraftserver = MinecraftServer.getServer(); @@ -588,7 +582,7 @@ } this.dead = true; -@@ -1680,8 +2045,27 @@ +@@ -1680,8 +2038,27 @@ return this.boundingBox; } -- cgit v1.2.3