mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 05:03:55 -07: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:
@@ -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