Advertisement
MrGG4ming

Untitled

Feb 4th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. package com.terrenos.users;
  2.  
  3. import java.util.HashMap;
  4.  
  5. import org.bukkit.Location;
  6. import org.bukkit.entity.Player;
  7.  
  8. public class Region {
  9.  
  10. private static HashMap<String, Region> CACHE = new HashMap<>();
  11.  
  12. private String name;
  13. private Location p1;
  14. private Location p2;
  15. private String owner;
  16. private String convidados;
  17. private Location home;
  18. private String home1;
  19. private String home2;
  20.  
  21. public Region(String name, Location p1, Location p2, String owner, String convidados, Location home, String home1, String home2) {
  22.  
  23. this.name = name;
  24. this.p1 = p1;
  25. this.p2 = p2;
  26. this.owner = owner;
  27. this.convidados = convidados;
  28. this.home = home;
  29. this.home1 = home1;
  30. this.home2 = home2;
  31. }
  32.  
  33. public static Region get(String name){
  34. return CACHE.get(name);
  35. }
  36.  
  37. public Region insert() {
  38. CACHE.put(name, this);
  39. return this;
  40. }
  41.  
  42. public String getName() {
  43. return name;
  44. }
  45.  
  46. public void setName(String name) {
  47. this.name = name;
  48. }
  49.  
  50. public Location getP1() {
  51. return p1;
  52. }
  53.  
  54. public void setP1(Location p1) {
  55. this.p1 = p1;
  56. }
  57.  
  58. public Location getP2() {
  59. return p2;
  60. }
  61.  
  62. public void setP2(Location p2) {
  63. this.p2 = p2;
  64. }
  65.  
  66. public String getOwner() {
  67. return owner;
  68. }
  69.  
  70. public void setOwner(String owner) {
  71. this.owner = owner;
  72. }
  73.  
  74. public static Region getUser(Player player) {
  75. return CACHE.get(player.getName());
  76. }
  77.  
  78. public String getConvidados() {
  79. return convidados;
  80. }
  81.  
  82. public void setConvidados(String convidados) {
  83. this.convidados = convidados;
  84. }
  85.  
  86. public Location getHome() {
  87. return home;
  88. }
  89.  
  90. public void setHome(Location home) {
  91. this.home = home;
  92. }
  93.  
  94. public String getHome1() {
  95. return home1;
  96. }
  97.  
  98. public void setHome1(String home1) {
  99. this.home1 = home1;
  100. }
  101.  
  102. public String getHome2() {
  103. return home2;
  104. }
  105.  
  106. public void setHome2(String home2) {
  107. this.home2 = home2;
  108. }
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement