Advertisement
Guest User

<3

a guest
Nov 18th, 2014
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.54 KB | None | 0 0
  1. package me.betanyan.povertycraft.poverty;
  2.  
  3. import me.betanyan.povertycraft.PovertyCraft;
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.ChatColor;
  7. import org.bukkit.Location;
  8. import org.bukkit.Material;
  9. import org.bukkit.Sound;
  10. import org.bukkit.entity.Player;
  11. import org.bukkit.event.EventHandler;
  12. import org.bukkit.event.EventPriority;
  13. import org.bukkit.event.Listener;
  14. import org.bukkit.event.block.Action;
  15. import org.bukkit.event.block.BlockBreakEvent;
  16. import org.bukkit.event.block.BlockPlaceEvent;
  17. import org.bukkit.event.entity.EntityDamageByEntityEvent;
  18. import org.bukkit.event.player.PlayerInteractEvent;
  19. import org.bukkit.event.player.PlayerMoveEvent;
  20. import org.bukkit.event.world.ChunkLoadEvent;
  21.  
  22. public class ProtectionStone implements Listener {
  23.  
  24. private static double x1;
  25. private static double y1;
  26. private static double z1;
  27.  
  28. private static double x2;
  29. private static double y2;
  30. private static double z2;
  31.  
  32. private static Location l1;
  33. private static Location l2;
  34.  
  35. private static int bdis = PovertyCraft.c.getInt("protection-blocks.beacon");
  36. private static int sdis = PovertyCraft.c.getInt("protection-blocks.sponge");
  37.  
  38. @EventHandler
  39. public void onPlace(BlockPlaceEvent e) {
  40. Player p = e.getPlayer();
  41. int notallowed = 0;
  42. int max = PovertyCraft.ps.getList("protections.all").size();
  43. int counter = 0;
  44. double x = 0;
  45. double y = 0;
  46. double z = 0;
  47. Location l = null;
  48. Location bl = e.getBlock().getLocation();
  49. Location ploc = p.getLocation();
  50. String ltostring = ""+(int) bl.getX()+"{"+ (int) bl.getY()+"}"+(int)bl.getZ();
  51. if (!e.getBlock().getLocation().getWorld().getName().equals("world_the_end") || !e.getBlock().getLocation().getWorld().getName().equals("world_nether")) {
  52. if(e.getBlock().getType() == Material.FLOWER_POT) {
  53. if (!e.getBlock().getLocation().getWorld().getName().equalsIgnoreCase("shop") && !e.getBlock().getLocation().getWorld().getName().equalsIgnoreCase("world_nether") && !e.getBlock().getLocation().getWorld().getName().equalsIgnoreCase("world_the_end")) {
  54. if (p.hasPermission("povertycraft.protections.beacon")) {
  55. for (String s : PovertyCraft.ps.getList("protections.all")) {
  56. counter++;
  57. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  58. x = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.x"));
  59. y = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.y"));
  60. z = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.z"));
  61. l = new Location(p.getWorld(), x, y, z);
  62. }
  63. if (PovertyCraft.ps.contains("protections."+s+".2")) {
  64. x1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.x"));
  65. y1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.y"));
  66. z1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.z"));
  67. l1 = new Location(p.getWorld(), x1, y1, z1);
  68. }
  69. if (PovertyCraft.ps.contains("protections."+s+".3")) {
  70. x2 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".3.x"));
  71. y2 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".3.y"));
  72. z2 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".3.z"));
  73. l2 = new Location(p.getWorld(), x2, y2, z2);
  74. }
  75.  
  76. Location s1 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock1.x"), PovertyCraft.c.getInt("spawnblock1.y"), PovertyCraft.c.getInt("spawnblock1.z"));
  77. Location s2 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock2.x"), PovertyCraft.c.getInt("spawnblock2.y"), PovertyCraft.c.getInt("spawnblock2.z"));
  78.  
  79. if (e.getBlock().getLocation().distance(s1) < 100 || e.getBlock().getLocation().distance(s2) < 100) {
  80. p.sendMessage(PovertyCraft.prefix + "You can not place here!");
  81. e.setCancelled(true);
  82. p.updateInventory();
  83. break;
  84. }
  85.  
  86. if (x != 0 && l.distance(e.getBlock().getLocation()) < bdis * 2) {
  87. notallowed++;
  88. e.setCancelled(true);
  89. } else {
  90. e.setCancelled(false);
  91. }
  92. if (x1 != 0 && l1.distance(e.getBlock().getLocation()) < bdis * 2) {
  93. notallowed++;
  94. e.setCancelled(true);
  95. } else {
  96. e.setCancelled(false);
  97. }
  98. if (x2 != 0 && l2.distance(e.getBlock().getLocation()) < bdis * 2) {
  99. notallowed++;
  100. e.setCancelled(true);
  101. } else {
  102. e.setCancelled(false);
  103. }
  104.  
  105. if (notallowed > 0) {
  106. p.sendMessage(PovertyCraft.prefix + "You are too close to someone elses claim.");
  107. e.setCancelled(true);
  108. p.updateInventory();
  109. break;
  110. }
  111.  
  112. if (counter != max) {
  113. continue;
  114. } else {
  115. if (notallowed == 0) {
  116. s1 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock1.x"), PovertyCraft.c.getInt("spawnblock1.y"), PovertyCraft.c.getInt("spawnblock1.z"));
  117. s2 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock2.x"), PovertyCraft.c.getInt("spawnblock2.y"), PovertyCraft.c.getInt("spawnblock2.z"));
  118.  
  119. if (e.getBlock().getLocation().distance(s1) < 100 || e.getBlock().getLocation().distance(s2) < 100) {
  120. e.setCancelled(true);
  121. p.sendMessage(PovertyCraft.prefix + "You can not place here!");
  122. p.updateInventory();
  123. break;
  124. }
  125. if (PovertyCraft.ps.contains("protections."+p.getName()+".1")) {
  126. if (!PovertyCraft.ps.contains("protections."+p.getName()+".2")) {
  127. if (p.hasPermission("povertycraft.protections.2")) {
  128. PovertyCraft.ps.createPath("protections."+p.getName(), null);
  129. PovertyCraft.ps.createList("protections."+p.getName()+".2.allowed");
  130. PovertyCraft.ps.createPath("protections."+p.getName()+".2.x", e.getBlock().getLocation().getX());
  131. PovertyCraft.ps.createPath("protections."+p.getName()+".2.y", e.getBlock().getLocation().getY());
  132. PovertyCraft.ps.createPath("protections."+p.getName()+".2.z", e.getBlock().getLocation().getZ());
  133. PovertyCraft.ps.createPath("protections."+p.getName()+".2"+".type", "beacon");
  134. PovertyCraft.ps.getList("protections."+p.getName()+".2.allowed").add(p.getName());
  135. PovertyCraft.ps.save();
  136. p.sendMessage(PovertyCraft.prefix + "Protection block placed! You can not place anymore!");
  137. } else {
  138. p.sendMessage(PovertyCraft.prefix + "You do not have permission to place a second protection block.");
  139. }
  140. break;
  141. } else if (PovertyCraft.ps.contains("protections."+p.getName()+".2")) {
  142. p.sendMessage(PovertyCraft.prefix + "Sorry! A maximum amount of 2 protection blocks can be placed.");
  143. break;
  144. }
  145. } else {
  146. PovertyCraft.ps.createPath("protections."+p.getName(), null);
  147. PovertyCraft.ps.createList("protections."+p.getName()+".1.allowed");
  148. PovertyCraft.ps.createPath("protections."+p.getName()+".1.x", e.getBlock().getLocation().getX());
  149. PovertyCraft.ps.createPath("protections."+p.getName()+".1.y", e.getBlock().getLocation().getY());
  150. PovertyCraft.ps.createPath("protections."+p.getName()+".1.z", e.getBlock().getLocation().getZ());
  151. PovertyCraft.ps.createPath("protections."+p.getName()+".1"+".type", "beacon");
  152. PovertyCraft.ps.getList("protections.all").add(p.getName());
  153. PovertyCraft.ps.getList("protections."+p.getName()+".1.allowed").add(p.getName());
  154. PovertyCraft.ps.save();
  155. if (p.hasPermission("povertycraft.protections.2")) {
  156. p.sendMessage(PovertyCraft.prefix + "Protection block placed! You can place 1 more blocks!");
  157. } else {
  158. p.sendMessage(PovertyCraft.prefix + "Protection block placed! You can not place anymore protection blocks!");
  159. p.updateInventory();
  160. }
  161. break;
  162. }
  163. }
  164. }
  165. }
  166. } else {
  167. p.sendMessage(PovertyCraft.prefix + "You are not allowed to place bedrock blocks.");
  168. }
  169. } else {
  170. p.sendMessage(PovertyCraft.prefix + "You can not claim here!");
  171. e.setCancelled(true);
  172. p.updateInventory();
  173. }
  174. } else if (e.getBlock().getType() == Material.SPONGE) {
  175. if (!p.getWorld().getName().equalsIgnoreCase("shop") || !p.getWorld().getName().equalsIgnoreCase("world_nether") || !p.getWorld().getName().equalsIgnoreCase("world_the_end")) {
  176. if (p.hasPermission("povertycraft.protections.sponge")) {
  177. for (String s : PovertyCraft.ps.getList("protections.all")) {
  178. counter++;
  179. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  180. x = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.x"));
  181. y = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.y"));
  182. z = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.z"));
  183. l = new Location(p.getWorld(), x, y, z);
  184. }
  185. if (PovertyCraft.ps.contains("protections."+s+".2")) {
  186. x1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.x"));
  187. y1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.y"));
  188. z1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.z"));
  189. l1 = new Location(p.getWorld(), x1, y1, z1);
  190. }
  191.  
  192. Location s1 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock1.x"), PovertyCraft.c.getInt("spawnblock1.y"), PovertyCraft.c.getInt("spawnblock1.z"));
  193. Location s2 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock2.x"), PovertyCraft.c.getInt("spawnblock2.y"), PovertyCraft.c.getInt("spawnblock2.z"));
  194.  
  195. if (e.getBlock().getLocation().distance(s1) < 100 || e.getBlock().getLocation().distance(s2) < 100) {
  196. e.setCancelled(true);
  197. p.sendMessage(PovertyCraft.prefix + "You can not place here!");
  198. p.updateInventory();
  199. }
  200.  
  201. if (x != 0 && l.distance(e.getBlock().getLocation()) < sdis * 2) {
  202. notallowed++;
  203. e.setCancelled(true);
  204. } else {
  205. e.setCancelled(false);
  206. }
  207. if (x1 != 0 && l1.distance(e.getBlock().getLocation()) < sdis * 2) {
  208. notallowed++;
  209. e.setCancelled(true);
  210. } else {
  211. e.setCancelled(false);
  212. }
  213. if (x2 != 0 && l2.distance(e.getBlock().getLocation()) < sdis * 2) {
  214. notallowed++;
  215. e.setCancelled(true);
  216. } else {
  217. e.setCancelled(false);
  218. }
  219.  
  220. if (notallowed > 0) {
  221. p.sendMessage(PovertyCraft.prefix + "You are too close to someone elses claim.");
  222. e.setCancelled(true);
  223. break;
  224. }
  225.  
  226. if (counter != max) {
  227. continue;
  228. } else {
  229. if (notallowed == 0) {
  230. s1 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock1.x"), PovertyCraft.c.getInt("spawnblock1.y"), PovertyCraft.c.getInt("spawnblock1.z"));
  231. s2 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock2.x"), PovertyCraft.c.getInt("spawnblock2.y"), PovertyCraft.c.getInt("spawnblock2.z"));
  232.  
  233. if (e.getBlock().getLocation().distance(s1) < 100 || e.getBlock().getLocation().distance(s2) < 100) {
  234. e.setCancelled(true);
  235. p.sendMessage(PovertyCraft.prefix + "You can not place here!");
  236. p.updateInventory();
  237. break;
  238. }
  239. if (PovertyCraft.ps.contains("protections."+p.getName())) {
  240. if (!PovertyCraft.ps.contains("protections."+p.getName()+".2")) {
  241. if (p.hasPermission("povertycraft.protections.2")) {
  242. PovertyCraft.ps.createPath("protections."+p.getName(), null);
  243. PovertyCraft.ps.createList("protections."+p.getName()+".2.allowed");
  244. PovertyCraft.ps.createPath("protections."+p.getName()+".2.x", e.getBlock().getLocation().getX());
  245. PovertyCraft.ps.createPath("protections."+p.getName()+".2.y", e.getBlock().getLocation().getY());
  246. PovertyCraft.ps.createPath("protections."+p.getName()+".2.z", e.getBlock().getLocation().getZ());
  247. PovertyCraft.ps.createPath("protections."+p.getName()+".2"+".type", "sponge");
  248. PovertyCraft.ps.getList("protections."+p.getName()+".2.allowed").add(p.getName());
  249. PovertyCraft.ps.save();
  250. if (p.hasPermission("povertycraft.protections.3")) {
  251. p.sendMessage(PovertyCraft.prefix + "Protection block placed! You can place 1 more block!");
  252. } else {
  253. p.sendMessage(PovertyCraft.prefix + "Protection block placed! You cannot place anymore!");
  254. }
  255. } else {
  256. p.sendMessage(PovertyCraft.prefix + "You do not have permission to place a second protection block.");
  257. }
  258. break;
  259. } else if (PovertyCraft.ps.contains("protections."+p.getName()+".2")) {
  260. p.sendMessage(PovertyCraft.prefix + "Sorry! Only a maximum amount of 2 protection blocks can be placed.");
  261. break;
  262. }
  263. } else {
  264. PovertyCraft.ps.createPath("protections."+p.getName(), null);
  265. PovertyCraft.ps.createList("protections."+p.getName()+".1.allowed");
  266. PovertyCraft.ps.createPath("protections."+p.getName()+".1.x", p.getLocation().getX());
  267. PovertyCraft.ps.createPath("protections."+p.getName()+".1.y", p.getLocation().getY());
  268. PovertyCraft.ps.createPath("protections."+p.getName()+".1.z", p.getLocation().getZ());
  269. PovertyCraft.ps.createPath("protections."+p.getName()+".1"+".type", "sponge");
  270. PovertyCraft.ps.getList("protections.all").add(p.getName());
  271. PovertyCraft.ps.getList("protections."+p.getName()+".1.allowed").add(p.getName());
  272. PovertyCraft.ps.save();
  273. if (p.hasPermission("povertycraft.protections.2")) {
  274. p.sendMessage(PovertyCraft.prefix + "Protection block placed! You can place 1 more blocks!");
  275. } else {
  276. p.sendMessage(PovertyCraft.prefix + "Protection block placed! You cannot place anymore!");
  277. }
  278. break;
  279. }
  280. }
  281. }
  282. }
  283. } else {
  284. p.sendMessage(PovertyCraft.prefix + "You are not allowed to place sponge blocks.");
  285. }
  286. } else {
  287. p.sendMessage(PovertyCraft.prefix + "You can not claim here!");
  288. e.setCancelled(true);
  289. p.updateInventory();
  290. }
  291. } else if (e.getBlock().getType() == Material.ENDER_PORTAL_FRAME) {
  292. if (!PovertyCraft.c.contains("spawnblock1")) {
  293. PovertyCraft.c.createPath("spawnblock1", null);
  294. PovertyCraft.c.createPath("spawnblock1.x", e.getBlock().getX());
  295. PovertyCraft.c.createPath("spawnblock1.y", e.getBlock().getY());
  296. PovertyCraft.c.createPath("spawnblock1.z", e.getBlock().getZ());
  297. p.sendMessage(PovertyCraft.prefix + "You have placed a spawn block.");
  298. } else {
  299. PovertyCraft.c.createPath("spawnblock2", null);
  300. PovertyCraft.c.createPath("spawnblock2.x", e.getBlock().getX());
  301. PovertyCraft.c.createPath("spawnblock2.y", e.getBlock().getY());
  302. PovertyCraft.c.createPath("spawnblock2.z", e.getBlock().getZ());
  303. p.sendMessage(PovertyCraft.prefix + "You have placed a spawn block.");
  304. }
  305.  
  306. Location s1 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock1.x"), PovertyCraft.c.getInt("spawnblock1.y"), PovertyCraft.c.getInt("spawnblock1.z"));
  307. Location s2 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock2.x"), PovertyCraft.c.getInt("spawnblock2.y"), PovertyCraft.c.getInt("spawnblock2.z"));
  308.  
  309. if (e.getBlock().getLocation().distance(s1) < 100 || e.getBlock().getLocation().distance(s2) < 100) {
  310. e.setCancelled(true);
  311. p.sendMessage(PovertyCraft.prefix + "You can not place here!");
  312. p.updateInventory();
  313. return;
  314. }
  315.  
  316. } else {
  317. for (String s : PovertyCraft.ps.getList("protections.all")) {
  318. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  319. x = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.x"));
  320. y = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.y"));
  321. z = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.z"));
  322. l = new Location(p.getWorld(), x, y, z);
  323. }
  324. if (PovertyCraft.ps.contains("protections."+s+".2")) {
  325. x1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.x"));
  326. y1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.y"));
  327. z1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.z"));
  328. l1 = new Location(p.getWorld(), x1, y1, z1);
  329. }
  330.  
  331. Location s1 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock1.x"), PovertyCraft.c.getInt("spawnblock1.y"), PovertyCraft.c.getInt("spawnblock1.z"));
  332. Location s2 = new Location(p.getWorld(), PovertyCraft.c.getInt("spawnblock2.x"), PovertyCraft.c.getInt("spawnblock2.y"), PovertyCraft.c.getInt("spawnblock2.z"));
  333.  
  334. if (e.getBlock().getLocation().distance(s1) < 100 || e.getBlock().getLocation().distance(s2) < 100) {
  335. e.setCancelled(true);
  336. p.sendMessage(PovertyCraft.prefix + "You can not place here!");
  337. p.updateInventory();
  338. break;
  339. }
  340.  
  341. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  342. if (PovertyCraft.ps.getString("protections."+s+".1.type").equals("beacon") || (PovertyCraft.ps.contains("protections."+s+".2") && PovertyCraft.ps.getString("protections."+s+".2.type").equals("beacon"))) {
  343. if (x != 0 && l.distance(e.getBlock().getLocation()) < bdis) {
  344. if (PovertyCraft.ps.contains("protections."+s+".1") && !PovertyCraft.ps.getList("protections."+s+".1.allowed").contains(p.getName())) {
  345. e.setCancelled(true);
  346. p.sendMessage(PovertyCraft.prefix + "You can not place here!");
  347. p.updateInventory();
  348. break;
  349. } else {
  350. e.setCancelled(false);
  351. }
  352. } else if (x1 != 0 && l1.distance(e.getBlock().getLocation()) < bdis) {
  353. if (PovertyCraft.ps.contains("protections."+s+".2") && !PovertyCraft.ps.getList("protections."+s+".2.allowed").contains(p.getName())) {
  354. e.setCancelled(true);
  355. p.sendMessage(PovertyCraft.prefix + "You can not place here!");
  356. p.updateInventory();
  357. break;
  358. } else {
  359. e.setCancelled(false);
  360. }
  361. }
  362. } else {
  363. if (x != 0 && l.distance(e.getBlock().getLocation()) < sdis) {
  364. if (PovertyCraft.ps.contains("protections."+s+".1") && !PovertyCraft.ps.getList("protections."+s+".1.allowed").contains(p.getName())) {
  365. e.setCancelled(true);
  366. p.sendMessage(PovertyCraft.prefix + "You can not place here!");
  367. p.updateInventory();
  368. break;
  369. } else {
  370. e.setCancelled(false);
  371. }
  372. } else if (x1 != 0 && l1.distance(e.getBlock().getLocation()) < sdis) {
  373. if (PovertyCraft.ps.contains("protections."+s+".2") && !PovertyCraft.ps.getList("protections."+s+".2.allowed").contains(p.getName())) {
  374. e.setCancelled(true);
  375. p.sendMessage(PovertyCraft.prefix + "You can not place here!");
  376. p.updateInventory();
  377. break;
  378. } else {
  379. e.setCancelled(false);
  380. }
  381. }
  382. }
  383. }
  384. }
  385. }
  386. } else {
  387. return;
  388. }
  389. }
  390.  
  391. /* @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
  392. public void onTp(PlayerTeleportEvent e) {
  393. Player p = e.getPlayer();
  394. if (!p.hasPermission("povertycraft.admin")) {
  395. for (String s : PovertyCraft.ps.getList("protections.all")) {
  396. double x;
  397. double y;
  398. double z;
  399. Location l = null;
  400. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  401. x = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.x"));
  402. y = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.y"));
  403. z = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.z"));
  404. l = new Location(p.getWorld(), x, y, z);
  405. }
  406. if (PovertyCraft.ps.contains("protections."+s+".2")) {
  407. x1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.x"));
  408. y1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.y"));
  409. z1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.z"));
  410. l1 = new Location(p.getWorld(), x1, y1, z1);
  411. }
  412. if (PovertyCraft.ps.contains("protections."+s+".3")) {
  413. x2 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".3.x"));
  414. y2 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".3.y"));
  415. z2 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".3.z"));
  416. l2 = new Location(p.getWorld(), x2, y2, z2);
  417. }
  418. if (l.distance(e.getTo()) < 10) {
  419. if (!PovertyCraft.ps.getList("protections."+s+".1.allowed").contains(p.getName())) {
  420. p.sendMessage(ChatColor.RED + "You can not teleport here!");
  421. p.teleport(e.getFrom());
  422. } else {
  423. e.setCancelled(false);
  424. }
  425. } else if (l1.distance(e.getTo()) < 10) {
  426. if (!PovertyCraft.ps.getList("protections."+s+".2.allowed").contains(p.getName())) {
  427. p.sendMessage(ChatColor.RED + "You can not teleport here!");
  428. p.teleport(e.getFrom());
  429. } else {
  430. e.setCancelled(false);
  431. }
  432. } else if (l2.distance(e.getTo()) < 10) {
  433. if (!PovertyCraft.ps.getList("protections."+s+".3.allowed").contains(p.getName())) {
  434. p.sendMessage(ChatColor.RED + "You can not teleport here!");
  435. p.teleport(e.getFrom());
  436. } else {
  437. e.setCancelled(false);
  438. }
  439. }
  440. }
  441. } else {
  442. e.setCancelled(false);
  443. }
  444. }
  445. */
  446.  
  447. @SuppressWarnings("deprecation")
  448. @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
  449. public void onMove(PlayerMoveEvent e) {
  450. Player p = e.getPlayer();
  451. Location l = null;
  452. boolean bec = false;
  453. double mx,my,mz;
  454. if (!e.getPlayer().getLocation().getWorld().getName().equals("world_the_end") || !e.getPlayer().getLocation().getWorld().getName().equals("world_nether")) {
  455. for (String s : PovertyCraft.ps.getList("protections.all")) {
  456. if (PovertyCraft.ps.contains("protections."+s+".2")) {
  457. mx = PovertyCraft.ps.getDouble("protections."+s+".2.x");
  458. my = PovertyCraft.ps.getDouble("protections."+s+".2.y");
  459. mz = PovertyCraft.ps.getDouble("protections."+s+".2.z");
  460. } else {
  461. mx = PovertyCraft.ps.getDouble("protections."+s+".1.x");
  462. my = PovertyCraft.ps.getDouble("protections."+s+".1.y");
  463. mz = PovertyCraft.ps.getDouble("protections."+s+".1.z");
  464. }
  465. l = new Location(p.getWorld(), mx, my, mz);
  466.  
  467. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  468. if (PovertyCraft.ps.getString("protections."+s+".1.type").equals("beacon") || (PovertyCraft.ps.contains("protections."+s+".2") && PovertyCraft.ps.getString("protections."+s+".2").equals("beacon"))) {
  469. bec = true;
  470. }
  471. } else {
  472. continue;
  473. }
  474.  
  475. if (bec) {
  476. if (Bukkit.getPlayer(s) != null) {
  477. if (e.getTo().distance(l) < bdis && e.getFrom().distance(l) > bdis) {
  478. p.sendMessage(ChatColor.translateAlternateColorCodes('&',PovertyCraft.prefix + "Now entering " + getPrefix(Bukkit.getPlayer(s)) + ChatColor.RESET + ChatColor.AQUA + "" + ChatColor.BOLD + s + " protected area."));
  479. } else if (e.getTo().distance(l) > bdis && e.getFrom().distance(l) < bdis) {
  480. p.sendMessage(ChatColor.translateAlternateColorCodes('&',PovertyCraft.prefix + "Now leaving " + getPrefix(Bukkit.getPlayer(s)) + ChatColor.RESET + ChatColor.AQUA + "" + ChatColor.BOLD + s + " protected area."));
  481. }
  482. } else {
  483. if (e.getTo().distance(l) < bdis && e.getFrom().distance(l) > bdis) {
  484. p.sendMessage(ChatColor.translateAlternateColorCodes('&',PovertyCraft.prefix + "Now entering " + s + " protected area."));
  485. } else if (e.getTo().distance(l) > bdis && e.getFrom().distance(l) < bdis) {
  486. p.sendMessage(ChatColor.translateAlternateColorCodes('&',PovertyCraft.prefix + "Now leaving " + s + " protected area."));
  487. }
  488. }
  489. } else {
  490. if (Bukkit.getPlayer(s) != null) {
  491. if (e.getTo().distance(l) < sdis && e.getFrom().distance(l) > sdis) {
  492. p.sendMessage(ChatColor.translateAlternateColorCodes('&',PovertyCraft.prefix + "Now entering " + getPrefix(Bukkit.getPlayer(s)) + ChatColor.RESET + ChatColor.AQUA + "" + ChatColor.BOLD + s + " protected area."));
  493. } else if (e.getTo().distance(l) > bdis && e.getFrom().distance(l) < bdis) {
  494. p.sendMessage(ChatColor.translateAlternateColorCodes('&',PovertyCraft.prefix + "Now leaving " + getPrefix(Bukkit.getPlayer(s)) + ChatColor.RESET + ChatColor.AQUA + "" + ChatColor.BOLD + s + " protected area."));
  495. }
  496. } else {
  497. if (e.getTo().distance(l) < sdis && e.getFrom().distance(l) > sdis) {
  498. p.sendMessage(ChatColor.translateAlternateColorCodes('&',PovertyCraft.prefix + "Now entering " + s + " protected area."));
  499. } else if (e.getTo().distance(l) > sdis && e.getFrom().distance(l) < sdis) {
  500. p.sendMessage(ChatColor.translateAlternateColorCodes('&',PovertyCraft.prefix + "Now leaving " + s + " protected area."));
  501. }
  502. }
  503. }
  504. }
  505. }
  506. }
  507.  
  508.  
  509. @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
  510. public void onBreak(BlockBreakEvent e) {
  511. Player p = e.getPlayer();
  512. double x = 0;
  513. double y = 0;
  514. double z = 0;
  515. Location l = null;
  516. boolean bec= false;
  517. if (!e.getBlock().getLocation().getWorld().getName().equals("world_the_end") || !e.getBlock().getLocation().getWorld().getName().equals("world_nether")) {
  518. if (e.getBlock().getType() != Material.FLOWER_POT && e.getBlock().getType() != Material.SPONGE) {
  519. if (!p.hasPermission("povertycraft.admin")) {
  520. if (!p.getWorld().getName().equalsIgnoreCase("shop")) {
  521. for (String s : PovertyCraft.ps.getList("protections.all")) {
  522. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  523. if (PovertyCraft.ps.getString("protections."+s+".1.type").equals("beacon")) {
  524. bec = true;
  525. if (PovertyCraft.ps.contains("protections."+s+".2")) {
  526. if (PovertyCraft.ps.getString("protections."+s+".2.type").equals("beacon")) {
  527. bec = true;
  528. }
  529. }
  530. }
  531. } else {
  532. continue;
  533. }
  534.  
  535. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  536. x = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.x"));
  537. y = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.y"));
  538. z = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.z"));
  539. l = new Location(p.getWorld(), x, y, z);
  540. }
  541. if (PovertyCraft.ps.contains("protections."+s+".2")) {
  542. x1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.x"));
  543. y1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.y"));
  544. z1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.z"));
  545. l1 = new Location(p.getWorld(), x1, y1, z1);
  546. }
  547. if (bec) {
  548. if (x != 0 && l != null && l.distance(e.getBlock().getLocation()) < bdis) {
  549. if (PovertyCraft.ps.contains("protections."+s+".1") && !PovertyCraft.ps.getList("protections."+s+".1.allowed").contains(p.getName())) {
  550. e.setCancelled(true);
  551. p.sendMessage(PovertyCraft.prefix + "You can not break here!");
  552. PovertyCraft.playSound(p, Sound.BLAZE_HIT);
  553. break;
  554. } else {
  555. e.setCancelled(false);
  556. continue;
  557. }
  558. } else if (x1 != 0 && l1 != null && l1.distance(e.getBlock().getLocation()) < bdis) {
  559. if (PovertyCraft.ps.contains("protections."+s+".2") && !PovertyCraft.ps.getList("protections."+s+".2.allowed").contains(p.getName())) {
  560. e.setCancelled(true);
  561. p.sendMessage(PovertyCraft.prefix + "You can not break here!");
  562. PovertyCraft.playSound(p, Sound.BLAZE_HIT);
  563. break;
  564. } else {
  565. e.setCancelled(false);
  566. continue;
  567. }
  568. }
  569. } else {
  570. if (x != 0 && l != null && l.distance(e.getBlock().getLocation()) < sdis) {
  571. if (PovertyCraft.ps.contains("protections."+s+".1") && !PovertyCraft.ps.getList("protections."+s+".1.allowed").contains(p.getName())) {
  572. e.setCancelled(true);
  573. p.sendMessage(PovertyCraft.prefix + "You can not break here!");
  574. PovertyCraft.playSound(p, Sound.BLAZE_HIT);
  575. break;
  576. } else {
  577. e.setCancelled(false);
  578. continue;
  579. }
  580. } else if (x1 != 0 && l1 != null && l1.distance(e.getBlock().getLocation()) < sdis) {
  581. if (PovertyCraft.ps.contains("protections."+s+".2") && !PovertyCraft.ps.getList("protections."+s+".2.allowed").contains(p.getName())) {
  582.  
  583. e.setCancelled(true);
  584. p.sendMessage(PovertyCraft.prefix + "You can not break here!");
  585. PovertyCraft.playSound(p, Sound.BLAZE_HIT);
  586. break;
  587. } else {
  588. e.setCancelled(false);
  589. continue;
  590. }
  591. }
  592. }
  593. }
  594. } else {
  595. e.setCancelled(true);
  596. }
  597. } else {
  598. e.setCancelled(false);
  599. }
  600. } else {
  601.  
  602. Location loc = e.getBlock().getLocation();
  603. if (contains("protections."+p.getName()+".1") && !contains("protections."+p.getName()+".2")) {
  604. if (PovertyCraft.ps.getDouble("protections."+p.getName()+".1.x")==loc.getX()
  605. && PovertyCraft.ps.getDouble("protections."+p.getName()+".1.y")==loc.getY()
  606. && PovertyCraft.ps.getDouble("protections."+p.getName()+".1.z")==loc.getZ()) {
  607. PovertyCraft.ps.setPath("protections."+p.getName(), null);
  608. PovertyCraft.ps.getList("protections.all").remove(p.getName());
  609. PovertyCraft.ps.save();
  610. PovertyCraft.ps.reload();
  611. if (p.hasPermission("povertycraft.protections.2")) {
  612. p.sendMessage(PovertyCraft.prefix + "You have removed the claim! You can now place 2 more!");
  613. return;
  614. } else {
  615. p.sendMessage(PovertyCraft.prefix + "You have removed the claim! You can now place 1 more!");
  616. return;
  617. }
  618. } else {
  619. e.setCancelled(true);
  620. p.sendMessage(PovertyCraft.prefix + "You do not own this claim!");
  621. return;
  622. }
  623. } else if (contains("protections."+p.getName()+".1") && contains("protections."+p.getName()+".2")) {
  624. if (PovertyCraft.ps.getDouble("protections."+p.getName()+".1.x")==loc.getX()
  625. && PovertyCraft.ps.getDouble("protections."+p.getName()+".1.y")==loc.getY()
  626. && PovertyCraft.ps.getDouble("protections."+p.getName()+".1.z")==loc.getZ()) {
  627. PovertyCraft.ps.setPath("protections."+p.getName()+".1.allowed", PovertyCraft.ps.getList("protections."+p.getName()+".2.allowed"));
  628. PovertyCraft.ps.setPath("protections."+p.getName()+".1.x", PovertyCraft.ps.getDouble("protections."+p.getName()+".2.x"));
  629. PovertyCraft.ps.setPath("protections."+p.getName()+".1.y", PovertyCraft.ps.getDouble("protections."+p.getName()+".2.y"));
  630. PovertyCraft.ps.setPath("protections."+p.getName()+".1.z", PovertyCraft.ps.getDouble("protections."+p.getName()+".2.z"));
  631. PovertyCraft.ps.setPath("protections."+p.getName()+".1.type", PovertyCraft.ps.getString("protections."+p.getName()+".2.type"));
  632. PovertyCraft.ps.setPath("protections."+p.getName()+".2", null);
  633. PovertyCraft.ps.save();
  634. PovertyCraft.ps.reload();
  635. if (p.hasPermission("povertycraft.protections.2")) {
  636. p.sendMessage(PovertyCraft.prefix + "You have removed the claim! You can now place 1 more!");
  637. return;
  638. } else {
  639. p.sendMessage(PovertyCraft.prefix + "You have removed the claim! You can now place no more!");
  640. return;
  641. }
  642. } else if (PovertyCraft.ps.getDouble("protections."+p.getName()+".2.x")==loc.getX()
  643. && PovertyCraft.ps.getDouble("protections."+p.getName()+".2.y")==loc.getY()
  644. && PovertyCraft.ps.getDouble("protections."+p.getName()+".2.z")==loc.getZ()) {
  645. PovertyCraft.ps.setPath("protections."+p.getName()+".2", null);
  646. PovertyCraft.ps.save();
  647. PovertyCraft.ps.reload();
  648. if (p.hasPermission("povertycraft.protections.2")) {
  649. p.sendMessage(PovertyCraft.prefix + "You have removed the claim! You can now place 1 more!");
  650. return;
  651. } else {
  652. p.sendMessage(PovertyCraft.prefix + "You have removed the claim! You can now place no more!");
  653. return;
  654. }
  655. } else {
  656. e.setCancelled(true);
  657. p.sendMessage(PovertyCraft.prefix + "You do not own this claim!");
  658. return;
  659. }
  660. } else {
  661. e.setCancelled(true);
  662. p.sendMessage(PovertyCraft.prefix + "You do not own this claim!");
  663. return;
  664. }
  665. }
  666. }
  667. }
  668.  
  669. @EventHandler
  670. public void onInteract(PlayerInteractEvent e) {
  671. Location one = null;
  672. Location two = null;
  673. double x = 0;
  674. double y = 0;
  675. double z = 0;
  676. boolean bec = false;
  677. Location l = null;
  678. Player p = e.getPlayer();
  679. if (e.getClickedBlock() != null)
  680. if (!e.getClickedBlock().getLocation().getWorld().getName().equals("world_the_end") || !e.getClickedBlock().getLocation().getWorld().getName().equals("world_nether")) {
  681. if (!p.hasPermission("povertycraft.admin")) {
  682. if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
  683. if (e.getClickedBlock().getType() == Material.CHEST || e.getClickedBlock().getType() == Material.FURNACE || e.getClickedBlock().getType() == Material.BURNING_FURNACE || e.getPlayer().getItemInHand().getType() == Material.WATER_BUCKET || e.getPlayer().getItemInHand().getType() == Material.LAVA_BUCKET || e.getPlayer().getItemInHand().getType() == Material.BUCKET || e.getClickedBlock().getType() == Material.WOODEN_DOOR || e.getClickedBlock().getType() == Material.TRAP_DOOR
  684. || e.getClickedBlock().getType() == Material.FENCE_GATE || e.getClickedBlock().getType() == Material.ENDER_CHEST || e.getClickedBlock().getType() == Material.ANVIL || e.getClickedBlock().getType() == Material.ENCHANTMENT_TABLE || e.getClickedBlock().getType() == Material.HOPPER || e.getClickedBlock().getType() == Material.DROPPER || e.getClickedBlock().getType() == Material.DISPENSER || e.getClickedBlock().getType() == Material.LEVER || e.getClickedBlock().getType() == Material.STONE_BUTTON || e.getClickedBlock().getType() == Material.WOOD_BUTTON
  685. || e.getClickedBlock().getType() == Material.JUKEBOX || e.getClickedBlock().getType() == Material.MONSTER_EGG || e.getClickedBlock().getType() == Material.MONSTER_EGGS) {
  686. for (String s : PovertyCraft.ps.getList("protections.all")) {
  687. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  688. if (PovertyCraft.ps.getString("protections."+s+".1.type").equals("beacon") || (PovertyCraft.ps.contains("protections."+s+".2") && PovertyCraft.ps.getString("protections."+s+".2.type").equals("beacon"))) {
  689. bec = true;
  690. }
  691. }
  692. if (PovertyCraft.ps.contains("protections."+s+".1") && !contains("protections."+s+".2")) {
  693. x = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.x"));
  694. y = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.y"));
  695. z = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.z"));
  696. l = new Location(p.getWorld(), x, y, z);
  697. }
  698. if (PovertyCraft.ps.contains("protections."+s+".2")) {
  699. x1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.x"));
  700. y1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.y"));
  701. z1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.z"));
  702. l1 = new Location(p.getWorld(), x1, y1, z1);
  703. }
  704. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  705. if (PovertyCraft.ps.getString("protections."+s+".1.type").equals("beacon") || (PovertyCraft.ps.contains("protections."+s+".2") && PovertyCraft.ps.getString("protections."+s+".2.type").equals("beacon"))) {
  706. if (x != 0 && l.distance(e.getClickedBlock().getLocation()) < bdis) {
  707. if (PovertyCraft.ps.contains("protections."+s+".1") && !PovertyCraft.ps.getList("protections."+s+".1.allowed").contains(p.getName())) {
  708. e.setCancelled(true);
  709. p.sendMessage(PovertyCraft.prefix + "You can not interact here!");
  710. p.updateInventory();
  711. break;
  712. } else {
  713. e.setCancelled(false);
  714. }
  715. } else if (x1 != 0 && l1.distance(e.getClickedBlock().getLocation()) < bdis) {
  716. if (PovertyCraft.ps.contains("protections."+s+".2") && !PovertyCraft.ps.getList("protections."+s+".2.allowed").contains(p.getName())) {
  717. e.setCancelled(true);
  718. p.sendMessage(PovertyCraft.prefix + "You can not interact here!");
  719. p.updateInventory();
  720. break;
  721. } else {
  722. e.setCancelled(false);
  723. }
  724. }
  725. } else {
  726. if (x != 0 && l.distance(e.getClickedBlock().getLocation()) < sdis) {
  727. if (PovertyCraft.ps.contains("protections."+s+".1") && !PovertyCraft.ps.getList("protections."+s+".1.allowed").contains(p.getName())) {
  728. e.setCancelled(true);
  729. p.sendMessage(PovertyCraft.prefix + "You can not interact here!");
  730. p.updateInventory();
  731. break;
  732. } else {
  733. e.setCancelled(false);
  734. }
  735. } else if (x1 != 0 && l1.distance(e.getClickedBlock().getLocation()) < sdis) {
  736. if (PovertyCraft.ps.contains("protections."+s+".2") && !PovertyCraft.ps.getList("protections."+s+".2.allowed").contains(p.getName())) {
  737. e.setCancelled(true);
  738. p.sendMessage(PovertyCraft.prefix + "You can not interact here!");
  739. p.updateInventory();
  740. break;
  741. } else {
  742. e.setCancelled(false);
  743. }
  744. }
  745. }
  746. }
  747. }
  748. }
  749. }
  750. } else {
  751. e.setCancelled(false);
  752. }
  753. }
  754. }
  755.  
  756. @EventHandler
  757. public void onHit(EntityDamageByEntityEvent e) {
  758. Location one = null;
  759. Location two = null;
  760. double x = 0;
  761. double y = 0;
  762. double z = 0;
  763. boolean bec = false;
  764. Location l = null;
  765. if (!e.getEntity().getLocation().getWorld().getName().equals("world_the_end") || !e.getEntity().getLocation().getWorld().getName().equals("world_nether")) {
  766. if (e.getDamager() instanceof Player) {
  767. Player p = (Player) e.getDamager();
  768. if (!p.hasPermission("povertycraft.admin")) {
  769. for (String s : PovertyCraft.ps.getList("protections.all")) {
  770. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  771. if (PovertyCraft.ps.getString("protections."+s+".1.type").equals("beacon") || (PovertyCraft.ps.contains("protections."+s+".2") && PovertyCraft.ps.getString("protections."+s+".2.type").equals("beacon"))) {
  772. bec = true;
  773. }
  774. }
  775. if (PovertyCraft.ps.contains("protections."+s+".1") && !contains("protections."+s+".2")) {
  776. x = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.x"));
  777. y = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.y"));
  778. z = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".1.z"));
  779. l = new Location(p.getWorld(), x, y, z);
  780. }
  781. if (PovertyCraft.ps.contains("protections."+s+".2")) {
  782. x1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.x"));
  783. y1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.y"));
  784. z1 = Double.parseDouble(PovertyCraft.ps.getString("protections."+s+".2.z"));
  785. l1 = new Location(p.getWorld(), x1, y1, z1);
  786. }
  787. if (PovertyCraft.ps.contains("protections."+s+".1")) {
  788. if (PovertyCraft.ps.getString("protections."+s+".1.type").equals("beacon") || (PovertyCraft.ps.contains("protections."+s+".2") && PovertyCraft.ps.getString("protections."+s+".2.type").equals("beacon"))) {
  789. if (x != 0 && l.distance(e.getEntity().getLocation()) < bdis) {
  790. if (PovertyCraft.ps.contains("protections."+s+".1") && !PovertyCraft.ps.getList("protections."+s+".1.allowed").contains(p.getName())) {
  791. e.setCancelled(true);
  792. p.sendMessage(PovertyCraft.prefix + "You can not damage animals here!");
  793. p.updateInventory();
  794. break;
  795. } else {
  796. e.setCancelled(false);
  797. }
  798. } else if (x1 != 0 && l1.distance(e.getEntity().getLocation()) < bdis) {
  799. if (PovertyCraft.ps.contains("protections."+s+".2") && !PovertyCraft.ps.getList("protections."+s+".2.allowed").contains(p.getName())) {
  800. e.setCancelled(true);
  801. p.sendMessage(PovertyCraft.prefix + "You can not damage animals here!");
  802. p.updateInventory();
  803. break;
  804. } else {
  805. e.setCancelled(false);
  806. }
  807. }
  808. } else {
  809. if (x != 0 && l.distance(e.getEntity().getLocation()) < sdis) {
  810. if (PovertyCraft.ps.contains("protections."+s+".1") && !PovertyCraft.ps.getList("protections."+s+".1.allowed").contains(p.getName())) {
  811. e.setCancelled(true);
  812. p.sendMessage(PovertyCraft.prefix + "You can not damage animals here!");
  813. p.updateInventory();
  814. break;
  815. } else {
  816. e.setCancelled(false);
  817. }
  818. } else if (x1 != 0 && l1.distance(e.getEntity().getLocation()) < sdis) {
  819. if (PovertyCraft.ps.contains("protections."+s+".2") && !PovertyCraft.ps.getList("protections."+s+".2.allowed").contains(p.getName())) {
  820. e.setCancelled(true);
  821. p.sendMessage(PovertyCraft.prefix + "You can not damage animals here!");
  822. p.updateInventory();
  823. break;
  824. } else {
  825. e.setCancelled(false);
  826. }
  827. }
  828. }
  829. }
  830. }
  831. } else {
  832. e.setCancelled(false);
  833. }
  834. }
  835. }
  836. }
  837.  
  838. private boolean contains(String path) {
  839. return PovertyCraft.ps.contains(path);
  840. }
  841.  
  842. void debug(String str) {
  843. Bukkit.getPlayer("BetaNyan").sendMessage("[DEBUG] "+ str);
  844. }
  845.  
  846. private String getPrefix(Player p) {
  847. try {
  848. return PovertyCraft.chat.getPlayerPrefix(p);
  849. } catch (NullPointerException e) {
  850. return "";
  851. }
  852. }
  853.  
  854. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement