mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +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
@ -1220,7 +1220,7 @@ public class PlayerProfile
|
||||
else
|
||||
return null;
|
||||
} else
|
||||
return null;
|
||||
return null;
|
||||
|
||||
loc.setYaw(0);
|
||||
loc.setPitch(0);
|
||||
|
@ -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;
|
||||
@ -138,9 +139,18 @@ public class mcBlockListener implements Listener
|
||||
int id = block.getTypeId();
|
||||
ItemStack inhand = player.getItemInHand();
|
||||
|
||||
if (event instanceof FakeBlockBreakEvent)
|
||||
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