fix: prevent player from beeing banned multiple times
This commit is contained in:
parent
37e2e9d8e7
commit
143476ec9f
1 changed files with 6 additions and 3 deletions
|
@ -26,9 +26,12 @@ public class BanUtils {
|
|||
public void addBann(final UUID uuid) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final ArrayList<String> bans = (ArrayList<String>) this.plugin.getConfig().get("Varo.Bans");
|
||||
bans.add(uuid.toString().replace("-", ""));
|
||||
this.plugin.getConfig().set("Varo.Bans", bans);
|
||||
this.plugin.saveConfig();
|
||||
final String compressedUUID = uuid.toString().replace("-", "");
|
||||
if (!bans.contains(compressedUUID)) {
|
||||
bans.add(compressedUUID);
|
||||
this.plugin.getConfig().set("Varo.Bans", bans);
|
||||
this.plugin.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
public void removeBan(final String compressedUuid) {
|
||||
|
|
Loading…
Reference in a new issue