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,10 +26,13 @@ public class BanUtils {
|
||||||
public void addBann(final UUID uuid) {
|
public void addBann(final UUID uuid) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
final ArrayList<String> bans = (ArrayList<String>) this.plugin.getConfig().get("Varo.Bans");
|
final ArrayList<String> bans = (ArrayList<String>) this.plugin.getConfig().get("Varo.Bans");
|
||||||
bans.add(uuid.toString().replace("-", ""));
|
final String compressedUUID = uuid.toString().replace("-", "");
|
||||||
|
if (!bans.contains(compressedUUID)) {
|
||||||
|
bans.add(compressedUUID);
|
||||||
this.plugin.getConfig().set("Varo.Bans", bans);
|
this.plugin.getConfig().set("Varo.Bans", bans);
|
||||||
this.plugin.saveConfig();
|
this.plugin.saveConfig();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void removeBan(final String compressedUuid) {
|
public void removeBan(final String compressedUuid) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
Loading…
Reference in a new issue