mirror of
https://github.com/PaperMC/Paper.git
synced 2025-04-04 11:06:23 +02:00
Improvements to teleport with passenger vehicle
This commit is contained in:
parent
c5d9810268
commit
1610f6d153
@ -47,10 +47,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
// If this player is riding another entity, we must dismount before teleporting.
|
||||
entity.mount(null);
|
||||
}
|
||||
|
||||
// If this player is riding another entity, we must dismount before teleporting.
|
||||
- entity.mount(null);
|
||||
+ // PaperSpigot start
|
||||
+ entity.mount(null); // Comment out when fully working, until then leave this
|
||||
+
|
||||
+ Entity vehicle = entity.vehicle;
|
||||
+ Entity passenger = entity.passenger;
|
||||
+ if (vehicle != null) {
|
||||
@ -66,13 +69,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ passenger.teleportTo(location, false);
|
||||
+ passenger = passenger.getBukkitEntity().getHandle();
|
||||
+ entity.passenger = passenger;
|
||||
+ entity.vehicle = entity;
|
||||
+ passenger.vehicle = entity;
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
+
|
||||
|
||||
// Update the From Location
|
||||
from = event.getFrom();
|
||||
// Grab the new To Location dependent on whether the event was cancelled.
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
} else {
|
||||
server.getHandle().moveToWorld(entity, toWorld.dimension, true, to, true);
|
||||
|
Loading…
Reference in New Issue
Block a user