Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. else if(args[0].equalsIgnoreCase("setspawn")) {
  2.  
  3. FileConfiguration config = plugin.getConfig();
  4.  
  5. Location l = jugador.getLocation();
  6.  
  7. double x = l.getX();
  8. double y = l.getY();
  9. double z = l.getZ();
  10. float yaw = l.getYaw();
  11. float pitch = l.getYaw();
  12. String world = jugador.getWorld().getName();
  13.  
  14. config.set("Config.Spawn.x", x);
  15. config.set("Config.Spawn.y", y);
  16. config.set("Config.Spawn.z", z);
  17. config.set("Config.Spawn.yaw", yaw);
  18. config.set("Config.Spawn.pitch", pitch);
  19. config.set("Config.Spawn.world", world);
  20.  
  21. jugador.sendMessage("Se ha pusto el spawn correctsmente!");
  22.  
  23.  
  24.  
  25. return true;
  26.  
  27. }
  28. else if(args[0].equalsIgnoreCase("spawn")) {
  29.  
  30. FileConfiguration config = plugin.getConfig();
  31. double x = Double.valueOf(config.getString("Config.Spawn.x"));
  32. double y = Double.valueOf(config.getString("Config.Spawn.y"));
  33. double z = Double.valueOf(config.getString("Config.Spawn.z"));
  34. float yaw = Float.valueOf(config.getString("Config.Spawn.yaw"));
  35. float pitch = Float.valueOf(config.getString("Config.Spawn.pitch"));
  36. World world = plugin.getServer().getWorld("Config.Spawn.world");
  37.  
  38. Location l = new Location(world, x, y, z, yaw, pitch);
  39. jugador.teleport(l);
  40. jugador.sendMessage("te has teletranspotado correctamente!");
  41.  
  42. return true;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement