mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Target default world when returning from The End; Fixes BUKKIT-3494
Due to the having to generate new logic to avoid using the customized PlayerConnection.moveToWorld, entities returning from The End were not properly calculating their exit target. This commit corrects that logic.
This commit is contained in:
1 parent
50e74b3b49
commit
132fdbc4ac
3 files changed
+15
-7
No files matched your search
@@ -1762,9 +1762,11 @@ public abstract class Entity {
|
||||
|
||||
Location enter = this.getBukkitEntity().getLocation();
|
||||
Location exit = exitWorld != null ? minecraftserver.getPlayerList().calculateTarget(enter, minecraftserver.getWorldServer(i)) : null;
|
||||
boolean useTravelAgent = exitWorld != null && !(this.dimension == 1 && exitWorld.dimension == 1); // don't use agent for custom worlds or return from THE_END
|
||||
|
||||
TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().s() : null;
|
||||
EntityPortalEvent event = new EntityPortalEvent(this.getBukkitEntity(), enter, exit, agent);
|
||||
event.useTravelAgent(useTravelAgent);
|
||||
event.getEntity().getServer().getPluginManager().callEvent(event);
|
||||
if (event.isCancelled() || event.getTo() == null || !this.isAlive()) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user