mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 19:50:37 +00:00
Properly bind Presets
This commit is contained in:
parent
a709ee6b53
commit
03d59d159a
1 changed files with 6 additions and 3 deletions
|
@ -34,15 +34,15 @@ public class BendingPlayer {
|
||||||
|
|
||||||
players.put(player, this);
|
players.put(player, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOnCooldown(String ability) {
|
public boolean isOnCooldown(String ability) {
|
||||||
return this.cooldowns.containsKey(ability);
|
return this.cooldowns.containsKey(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addCooldown(String ability, long cooldown) {
|
public void addCooldown(String ability, long cooldown) {
|
||||||
this.cooldowns.put(ability, cooldown + System.currentTimeMillis());
|
this.cooldowns.put(ability, cooldown + System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeCooldown(String ability) {
|
public void removeCooldown(String ability) {
|
||||||
this.cooldowns.remove(ability);
|
this.cooldowns.remove(ability);
|
||||||
}
|
}
|
||||||
|
@ -110,5 +110,8 @@ public class BendingPlayer {
|
||||||
|
|
||||||
public void setAbilities(HashMap<Integer, String> abilities) {
|
public void setAbilities(HashMap<Integer, String> abilities) {
|
||||||
this.abilities = 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 + "'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue