When leaving the end, always target the main world. Fixes BUKKIT-3517

This commit is contained in:
feildmaster 2013-01-29 09:36:56 -06:00
parent b0e43c8097
commit 0576395ddd

View File

@ -441,7 +441,9 @@ public abstract class PlayerList {
if ((cause == TeleportCause.END_PORTAL) && (i == 0)) { if ((cause == TeleportCause.END_PORTAL) && (i == 0)) {
// THE_END -> NORMAL; use bed if available, otherwise default spawn // THE_END -> NORMAL; use bed if available, otherwise default spawn
exit = ((CraftPlayer) entityplayer.getBukkitEntity()).getBedSpawnLocation(); exit = ((CraftPlayer) entityplayer.getBukkitEntity()).getBedSpawnLocation();
if (exit == null) exit = exitWorld.getWorld().getSpawnLocation(); if (exit == null || ((CraftWorld) exit.getWorld()).getHandle().dimension != 0) {
exit = exitWorld.getWorld().getSpawnLocation();
}
} else { } else {
// NORMAL <-> NETHER or NORMAL -> THE_END // NORMAL <-> NETHER or NORMAL -> THE_END
exit = this.calculateTarget(enter, exitWorld); exit = this.calculateTarget(enter, exitWorld);