From 03d59d159a83f2b9a54ee5a1f1033e992dc020dd Mon Sep 17 00:00:00 2001 From: MistPhizzle Date: Sun, 7 Sep 2014 23:13:01 -0400 Subject: [PATCH] Properly bind Presets --- src/com/projectkorra/ProjectKorra/BendingPlayer.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/projectkorra/ProjectKorra/BendingPlayer.java b/src/com/projectkorra/ProjectKorra/BendingPlayer.java index 8a621f48..0ea6c3e3 100644 --- a/src/com/projectkorra/ProjectKorra/BendingPlayer.java +++ b/src/com/projectkorra/ProjectKorra/BendingPlayer.java @@ -34,15 +34,15 @@ public class BendingPlayer { players.put(player, this); } - + public boolean isOnCooldown(String ability) { return this.cooldowns.containsKey(ability); } - + public void addCooldown(String ability, long cooldown) { this.cooldowns.put(ability, cooldown + System.currentTimeMillis()); } - + public void removeCooldown(String ability) { this.cooldowns.remove(ability); } @@ -110,5 +110,8 @@ public class BendingPlayer { public void setAbilities(HashMap abilities) { this.abilities = abilities; + for (int i = 1; i <= 9; i++) { + DBConnection.sql.modifyQuery("UPDATE pk_players SET slot" + i + " = '" + (abilities.get(i) == null ? null: abilities.get(i)) + "' WHERE uuid = '" + uuid + "'"); + } } }