Tested plugin
This commit is contained in:
@@ -18,7 +18,7 @@ public class EasySpawn extends JavaPlugin{
|
||||
if(command.getName().equalsIgnoreCase("spawn")){
|
||||
World world = player.getWorld();
|
||||
String w = world.getName();
|
||||
if(getConfig().contains("spawn."+w)) {
|
||||
if(getConfig().contains("spawn."+w)){
|
||||
int x = getConfig().getInt("spawn."+w+".x");
|
||||
int y = getConfig().getInt("spawn."+w+".y");
|
||||
int z = getConfig().getInt("spawn."+w+".z");
|
||||
@@ -26,7 +26,7 @@ public class EasySpawn extends JavaPlugin{
|
||||
float yaw = getConfig().getInt("spawn."+w+".yaw");
|
||||
player.teleport(new Location(world, x, y, z, yaw, pitch));
|
||||
player.sendMessage("You have been teleported to spawn.");
|
||||
}
|
||||
}else{ player.sendMessage("This world has no spawn");}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public class EasySpawn extends JavaPlugin{
|
||||
getConfig().set("spawn."+world+".z", location.getBlockZ());
|
||||
getConfig().set("spawn."+world+".pitch", location.getPitch());
|
||||
getConfig().set("spawn."+world+".yaw", location.getYaw());
|
||||
saveConfig();
|
||||
player.sendMessage("Spawn set.");
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user