Fixes spawn platform position in the end. (#1713)

In the vanilla end, the highest block in the End can be above 63. Check for just 0, 63, 0 may be incorrect for most of the end vanilla worlds.
This commit is contained in:
BONNe 2021-03-17 04:07:05 +02:00 committed by GitHub
parent 4582b23522
commit 8ce30a7cb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -385,7 +385,7 @@ public class PortalTeleportationListener implements Listener {
World toWorld = getNetherEndWorld(overWorld, env);
Location spawnPoint = toWorld.getSpawnLocation();
// If spawn is set as 0,63,0 in the End then move it to 100, 50 ,0.
if (env.equals(Environment.THE_END) && spawnPoint.toVector().equals(new Vector(0,63,0))) {
if (env.equals(Environment.THE_END) && spawnPoint.getBlockX() == 0 && spawnPoint.getBlockZ() == 0) {
// Set to the default end spawn
spawnPoint = new Location(toWorld, 100, 50, 0);
toWorld.setSpawnLocation(100, 50, 0);