Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. package com.Pladetor.BVKitPvP.Stats;
  2.  
  3. import org.bukkit.entity.Player;
  4. import org.bukkit.event.player.PlayerInteractEvent;
  5.  
  6. import com.Pladetor.BVKitPvP.BVKitPvP;
  7.  
  8. public class Stats {
  9.  
  10.  
  11. public static int getKills(Player p)
  12. {
  13.  
  14. int kills = BVKitPvP.plugin.getConfig().getInt("Stats." + p.getName() + ".Kills");
  15.  
  16. return kills;
  17. }
  18.  
  19. public static int getDeaths(Player p)
  20. {
  21. return BVKitPvP.plugin.getConfig().getInt("Stats." + p.getName() + ".Deaths");
  22. }
  23.  
  24. public static double getKDR(Player p)
  25. {
  26. return BVKitPvP.plugin.getConfig().getInt("Stats." + p.getName() + ".KDR");
  27. }
  28.  
  29. public static void giveKill(Player p)
  30. {
  31. BVKitPvP.plugin.getConfig().set("Stats." + p.getName() + ".Kills", getKills(p) + 1);
  32.  
  33. BVKitPvP.plugin.saveConfig();
  34. BVKitPvP.plugin.reloadConfig();
  35. }
  36.  
  37. public static void giveDeath(Player p)
  38. {
  39. BVKitPvP.plugin.getConfig().set("Stats." + p.getName() + ".Deaths", getDeaths(p) + 1);
  40.  
  41. BVKitPvP.plugin.saveConfig();
  42. BVKitPvP.plugin.reloadConfig();
  43. }
  44.  
  45. public static void updateKDR(Player p)
  46. {
  47. BVKitPvP.plugin.getConfig().set("Stats." + p.getName() + ".Kills", getKills(p) / getDeaths(p));
  48.  
  49. BVKitPvP.plugin.saveConfig();
  50. BVKitPvP.plugin.reloadConfig();
  51. }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement