From e55006f662c92f4ccdfb381a83c387f9a183ae46 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 28 Feb 2012 17:06:13 -0500 Subject: [PATCH] Fixed the fact that myspawn would clear if you broke ANY bed (not just your own) - Addresses MCCORE-50 --- .../gmail/nossr50/listeners/mcBlockListener.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java index 6939c1d64..96469b240 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java @@ -145,11 +145,14 @@ public class mcBlockListener implements Listener //Reset player spawn back to world spawn if their bed is destroyed. if(block.getType().equals(Material.BED_BLOCK) && LoadProperties.enableMySpawn && PP.getMySpawn(player) != null) { - double x = Bukkit.getServer().getWorlds().get(0).getSpawnLocation().getX(); - double y = Bukkit.getServer().getWorlds().get(0).getSpawnLocation().getY(); - double z = Bukkit.getServer().getWorlds().get(0).getSpawnLocation().getZ(); - String worldname = Bukkit.getServer().getWorlds().get(0).getName(); - PP.setMySpawn(x, y, z, worldname); + if(PP.getMySpawn(player).getBlock().getType() != Material.BED_BLOCK) + { + double x = Bukkit.getServer().getWorlds().get(0).getSpawnLocation().getX(); + double y = Bukkit.getServer().getWorlds().get(0).getSpawnLocation().getY(); + double z = Bukkit.getServer().getWorlds().get(0).getSpawnLocation().getZ(); + String worldname = Bukkit.getServer().getWorlds().get(0).getName(); + PP.setMySpawn(x, y, z, worldname); + } } /* * HERBALISM