mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 08:02:13 -07:00
SPIGOT-387: Remove redundant custom vehicle handling.
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user