Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.Pladetor.BVKitPvP.Stats;
- import org.bukkit.entity.Player;
- import org.bukkit.event.player.PlayerInteractEvent;
- import com.Pladetor.BVKitPvP.BVKitPvP;
- public class Stats {
- public static int getKills(Player p)
- {
- int kills = BVKitPvP.plugin.getConfig().getInt("Stats." + p.getName() + ".Kills");
- return kills;
- }
- public static int getDeaths(Player p)
- {
- return BVKitPvP.plugin.getConfig().getInt("Stats." + p.getName() + ".Deaths");
- }
- public static double getKDR(Player p)
- {
- return BVKitPvP.plugin.getConfig().getInt("Stats." + p.getName() + ".KDR");
- }
- public static void giveKill(Player p)
- {
- BVKitPvP.plugin.getConfig().set("Stats." + p.getName() + ".Kills", getKills(p) + 1);
- BVKitPvP.plugin.saveConfig();
- BVKitPvP.plugin.reloadConfig();
- }
- public static void giveDeath(Player p)
- {
- BVKitPvP.plugin.getConfig().set("Stats." + p.getName() + ".Deaths", getDeaths(p) + 1);
- BVKitPvP.plugin.saveConfig();
- BVKitPvP.plugin.reloadConfig();
- }
- public static void updateKDR(Player p)
- {
- BVKitPvP.plugin.getConfig().set("Stats." + p.getName() + ".Kills", getKills(p) / getDeaths(p));
- BVKitPvP.plugin.saveConfig();
- BVKitPvP.plugin.reloadConfig();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement