13
0
geforkt von Mirrors/Paper

[Bleeding] Fix NPE with a null bedSpawnLocation. Fixes BUKKIT-1500

Dieser Commit ist enthalten in:
EdGruberman 2012-12-09 17:37:37 -06:00 committet von feildmaster
Ursprung 4d2a92ed47
Commit f18b3cdc76
2 geänderte Dateien mit 7 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -1094,6 +1094,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
} else { } else {
this.c = null; this.c = null;
this.d = false; this.d = false;
this.spawnWorld = ""; // CraftBukkit
} }
} }

Datei anzeigen

@ -614,9 +614,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void setBedSpawnLocation(Location location, boolean override) { public void setBedSpawnLocation(Location location, boolean override) {
if (location == null) {
getHandle().setRespawnPosition(null, override);
} else {
getHandle().setRespawnPosition(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()), override); getHandle().setRespawnPosition(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()), override);
getHandle().spawnWorld = location.getWorld().getName(); getHandle().spawnWorld = location.getWorld().getName();
} }
}
public void hidePlayer(Player player) { public void hidePlayer(Player player) {
Validate.notNull(player, "hidden player cannot be null"); Validate.notNull(player, "hidden player cannot be null");