2015-07-27 12:20:54 +00:00
|
|
|
From c84e8b213d787358de30c456003e4abc570e9a32 Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46:54 +00:00
|
|
|
From: Andrew Krieger <Slizyboy@hotmail.com>
|
|
|
|
Date: Tue, 24 Dec 2013 07:55:23 -0800
|
|
|
|
Subject: [PATCH] Cross World Entity Teleportation
|
|
|
|
|
|
|
|
Use Entity.teleportTo for cross-world teleportation in CraftEntity.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
2015-07-23 20:43:27 +00:00
|
|
|
index 89cbb45..725870a 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
2015-07-23 20:43:27 +00:00
|
|
|
@@ -232,7 +232,14 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
2014-08-18 15:43:17 +00:00
|
|
|
// If this entity is riding another entity, we must dismount before teleporting.
|
|
|
|
entity.mount(null);
|
2014-07-21 20:46:54 +00:00
|
|
|
|
|
|
|
- entity.world = ((CraftWorld) location.getWorld()).getHandle();
|
|
|
|
+ // Spigot start
|
|
|
|
+ if (!location.getWorld().equals(getWorld())) {
|
|
|
|
+ entity.teleportTo(location, cause.equals(TeleportCause.NETHER_PORTAL));
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // entity.world = ((CraftWorld) location.getWorld()).getHandle();
|
|
|
|
+ // Spigot end
|
|
|
|
entity.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
|
|
|
// entity.setLocation() throws no event, and so cannot be cancelled
|
|
|
|
return true;
|
|
|
|
--
|
2015-05-09 20:23:26 +00:00
|
|
|
2.1.4
|
2014-07-21 20:46:54 +00:00
|
|
|
|