From dc615d5d49274a45fd446cb2d7773c8f37dd00a9 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 30 Apr 2016 10:18:59 -0500 Subject: [PATCH] Fixed disabled abilities still being bound to bar --- .../projectkorra/projectkorra/PKListener.java | 8 +++++--- .../projectkorra/ProjectKorra.java | 20 ++++++++++--------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/com/projectkorra/projectkorra/PKListener.java b/src/com/projectkorra/projectkorra/PKListener.java index de3f10d8..1d186c2a 100644 --- a/src/com/projectkorra/projectkorra/PKListener.java +++ b/src/com/projectkorra/projectkorra/PKListener.java @@ -1035,10 +1035,12 @@ public class PKListener implements Listener { } @EventHandler - public void onPlayerJoin(PlayerJoinEvent e) { - Player player = e.getPlayer(); + public void onPlayerJoin(PlayerJoinEvent event) { + Player player = event.getPlayer(); JUMPS.put(player, player.getStatistic(Statistic.JUMP)); - GeneralMethods.createBendingPlayer(e.getPlayer().getUniqueId(), player.getName()); + + GeneralMethods.createBendingPlayer(player.getUniqueId(), player.getName()); + GeneralMethods.removeUnusableAbilities(player.getName()); } @EventHandler diff --git a/src/com/projectkorra/projectkorra/ProjectKorra.java b/src/com/projectkorra/projectkorra/ProjectKorra.java index 074788ad..dbf75b66 100644 --- a/src/com/projectkorra/projectkorra/ProjectKorra.java +++ b/src/com/projectkorra/projectkorra/ProjectKorra.java @@ -1,5 +1,14 @@ package com.projectkorra.projectkorra; +import java.io.File; +import java.io.IOException; +import java.util.logging.Logger; + +import org.bukkit.Bukkit; +import org.bukkit.Statistic; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + import com.bekvon.bukkit.residence.protection.FlagPermissions; import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.util.ComboManager; @@ -19,15 +28,6 @@ import com.projectkorra.projectkorra.util.Updater; import com.projectkorra.projectkorra.util.logging.PKLogHandler; import com.projectkorra.projectkorra.waterbending.WaterbendingManager; -import org.bukkit.Bukkit; -import org.bukkit.Statistic; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import java.io.File; -import java.io.IOException; -import java.util.logging.Logger; - public class ProjectKorra extends JavaPlugin { public static ProjectKorra plugin; @@ -85,7 +85,9 @@ public class ProjectKorra extends JavaPlugin { for (Player player : Bukkit.getOnlinePlayers()) { PKListener.getJumpStatistics().put(player, player.getStatistic(Statistic.JUMP)); + GeneralMethods.createBendingPlayer(player.getUniqueId(), player.getName()); + GeneralMethods.removeUnusableAbilities(player.getName()); } try {