diff --git a/.github/README.md b/.github/README.md index 7af6c82..b290b85 100644 --- a/.github/README.md +++ b/.github/README.md @@ -37,7 +37,7 @@ If you still didn't find an answer see documentation section below. com.github.Despical KOTL - 2.7.5 + 2.7.6 compile ``` @@ -54,7 +54,7 @@ repositories { ``` ``` dependencies { - compileOnly group: "com.github.Despical", name: "KOTL", version: "2.7.5; + compileOnly group: "com.github.Despical", name: "KOTL", version: "2.7.6; } ``` diff --git a/pom.xml b/pom.xml index e76abf9..dfca221 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 me.despical king-of-the-ladder - 2.7.5 + 2.7.6 King of the Ladder https://www.spigotmc.org/resources/80686/ diff --git a/src/main/java/me/despical/kotl/user/User.java b/src/main/java/me/despical/kotl/user/User.java index 7622543..551c304 100644 --- a/src/main/java/me/despical/kotl/user/User.java +++ b/src/main/java/me/despical/kotl/user/User.java @@ -44,7 +44,6 @@ public class User { private static long cooldownCounter = 0; private final UUID uuid; - private final Player player; private final Map cooldowns; private final Map stats; @@ -52,17 +51,16 @@ public class User { public User(UUID uuid) { this.uuid = uuid; - this.player = plugin.getServer().getPlayer(uuid); this.cooldowns = new HashMap<>(); this.stats = new EnumMap<>(StatsStorage.StatisticType.class); } public Arena getArena() { - return plugin.getArenaRegistry().getArena(player); + return plugin.getArenaRegistry().getArena(getPlayer()); } public Player getPlayer() { - return player; + return plugin.getServer().getPlayer(uuid); } public UUID getUniqueId() { @@ -83,7 +81,7 @@ public int getStat(StatsStorage.StatisticType statisticType) { public void setStat(StatsStorage.StatisticType stat, int value) { stats.put(stat, value); - plugin.getServer().getScheduler().runTask(plugin, () -> plugin.getServer().getPluginManager().callEvent(new KOTLPlayerStatisticChangeEvent(getArena(), player, stat, value))); + plugin.getServer().getScheduler().runTask(plugin, () -> plugin.getServer().getPluginManager().callEvent(new KOTLPlayerStatisticChangeEvent(getArena(), getPlayer(), stat, value))); } public void addStat(StatsStorage.StatisticType stat, int value) { @@ -95,17 +93,17 @@ public void performReward(final Reward.RewardType rewardType) { } public void giveKit() { - plugin.getKitManager().giveKit(player); + plugin.getKitManager().giveKit(getPlayer()); } public void cacheScoreboard() { - this.cachedScoreboard = this.player.getScoreboard(); + this.cachedScoreboard = getPlayer().getScoreboard(); } public void removeScoreboard() { if (this.cachedScoreboard == null) return; - this.player.setScoreboard(this.cachedScoreboard); + this.getPlayer().setScoreboard(this.cachedScoreboard); this.cachedScoreboard = null; }