mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
Breaking a bed now clears your spawn, just as if you had used the
/clearmyspawn command.
This commit is contained in:
parent
69b7c3077f
commit
64b46a88c9
@ -25,6 +25,7 @@ import com.gmail.nossr50.spout.SpoutStuff;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
@ -141,6 +142,15 @@ public class mcBlockListener implements Listener
|
||||
if(event instanceof FakeBlockBreakEvent)
|
||||
return;
|
||||
|
||||
//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);
|
||||
}
|
||||
/*
|
||||
* HERBALISM
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user