Advertisement
NiRoXz

Untitled

Mar 21st, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. public void teleport(Player p, List<Player> team) {
  2.  
  3.  
  4.  
  5. if(team == TeamBlau) {
  6. File mapfile = new File("plugins/NextPlugin/Maps", "maps.yml");
  7. FileConfiguration cfgmap = YamlConfiguration.loadConfiguration(mapfile);
  8.  
  9. String world = cfgmap.getString("Warps." +ms+ ".Blau.World");
  10. double x = cfgmap.getDouble("Warps." +ms+ ".Blau.X");
  11. double y = cfgmap.getDouble("Warps." +ms+ ".Blau.Y");
  12. double z = cfgmap.getDouble("Warps." +ms+ ".Blau.Z");
  13. double yaw = cfgmap.getDouble("Warps." +ms+ ".Blau.Yaw");
  14. double pitch = cfgmap.getDouble("Warps." +ms+ ".Blau.Pitch");
  15. Location loc = new Location(Bukkit.getWorld(world), x, y, z);
  16. loc.setYaw((float)yaw);
  17. loc.setPitch((float)pitch);
  18.  
  19. p.teleport(loc);
  20. }
  21.  
  22. if(team == TeamRot) {
  23. File mapfile = new File("plugins/NextPlugin/Maps", "maps.yml");
  24. FileConfiguration cfgmap = YamlConfiguration.loadConfiguration(mapfile);
  25.  
  26. String world = cfgmap.getString("Warps." +ms+ ".Rot.World");
  27. double x = cfgmap.getDouble("Warps." +ms+ ".Rot.X");
  28. double y = cfgmap.getDouble("Warps." +ms+ ".Rot.Y");
  29. double z = cfgmap.getDouble("Warps." +ms+ ".Rot.Z");
  30. double yaw = cfgmap.getDouble("Warps." +ms+ ".Rot.Yaw");
  31. double pitch = cfgmap.getDouble("Warps." +ms+ ".Rot.Pitch");
  32. Location loc = new Location(Bukkit.getWorld(world), x, y, z);
  33. loc.setYaw((float)yaw);
  34. loc.setPitch((float)pitch);
  35.  
  36. p.teleport(loc);
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement