fix: prevent player from beeing banned multiple times

This commit is contained in:
Simon Giesel 2020-05-09 15:51:37 +02:00
parent 37e2e9d8e7
commit 143476ec9f

View file

@ -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) {