Advertisement
Guest User

LocationHandler

a guest
Jun 13th, 2014
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. package me.phantom64.teamdeathmatch.utils;
  2.  
  3. import me.phantom64.teamdeathmatch.TeamDeathMatch;
  4. import me.phantom64.teamdeathmatch.utils.TeamManager.Team;
  5.  
  6. import org.bukkit.Location;
  7. import org.bukkit.entity.Player;
  8.  
  9. public class LocationHandler {
  10.  
  11. @SuppressWarnings("unused")
  12. private TeamDeathMatch plugin;
  13.  
  14. private Location redSpawn;
  15. private Location blueSpawn;
  16. private Location exitSpawn;
  17.  
  18. public LocationHandler(TeamDeathMatch plugin) {
  19. this.plugin = plugin;
  20. }
  21.  
  22. public void teleportPlayerToArena(Player p, Team team) {
  23. if (team == Team.RED) {p.teleport(getRedSpawn()); TeamDeathMatch.getTeamManager().setTeam(p, team);}
  24. else if (team == Team.BLUE) {p.teleport(getBlueSpawn()); TeamDeathMatch.getTeamManager().setTeam(p, team);}
  25. }
  26.  
  27. @SuppressWarnings("static-access")
  28. public void teleportPlayerFromArena(Player p) {
  29. p.teleport(TeamDeathMatch.getLocationHandler().getExitSpawn());
  30. TeamDeathMatch.getTeamManager().teams.remove(p);
  31. }
  32.  
  33. public Location getRedSpawn() {
  34. return redSpawn;
  35. }
  36.  
  37. public void setRedSpawn(Location redSpawn) {
  38. this.redSpawn = redSpawn;
  39. }
  40.  
  41. public Location getBlueSpawn() {
  42. return blueSpawn;
  43. }
  44.  
  45. public void setBlueSpawn(Location blueSpawn) {
  46. this.blueSpawn = blueSpawn;
  47. }
  48.  
  49. public Location getExitSpawn() {
  50. return exitSpawn;
  51. }
  52.  
  53. public void setExitSpawn(Location exitSpawn) {
  54. this.exitSpawn = exitSpawn;
  55. }
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement