From 06483020784d4cbe20fda911d1a703bc7a42c183 Mon Sep 17 00:00:00 2001 From: Rigby Date: Tue, 21 Jun 2011 04:33:29 +0100 Subject: [PATCH] Implements isBedSpawn() to the PlayerRespawnEvent. --- .../java/net/minecraft/server/ServerConfigurationManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index b419642d34..6ec5bd920f 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -217,10 +217,12 @@ public class ServerConfigurationManager { EntityPlayer entityplayer1 = entityplayer; if (location == null) { + boolean isBedSpawn = false; CraftWorld cw = (CraftWorld) this.server.server.getWorld(entityplayer.spawnWorld); if (cw != null && chunkcoordinates != null) { ChunkCoordinates chunkcoordinates1 = EntityHuman.getBed(cw.getHandle(), chunkcoordinates); if (chunkcoordinates1 != null) { + isBedSpawn = true; location = new Location(cw, chunkcoordinates1.x + 0.5, chunkcoordinates1.y, chunkcoordinates1.z + 0.5); } else { entityplayer1.netServerHandler.sendPacket(new Packet70Bed(0)); @@ -234,7 +236,7 @@ public class ServerConfigurationManager { } Player respawnPlayer = cserver.getPlayer(entityplayer); - PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location); + PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn); cserver.getPluginManager().callEvent(respawnEvent); location = respawnEvent.getRespawnLocation();