2021-01-03 07:21:15 +00:00
|
|
|
package dev.plex.punishment;
|
2020-11-06 18:51:47 +00:00
|
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
2022-02-28 06:28:00 +00:00
|
|
|
import com.google.common.reflect.TypeToken;
|
|
|
|
import com.google.gson.Gson;
|
2021-01-03 07:21:15 +00:00
|
|
|
import dev.plex.Plex;
|
2022-02-04 08:18:07 +00:00
|
|
|
import dev.plex.PlexBase;
|
2022-04-04 08:36:50 +00:00
|
|
|
import dev.plex.cache.DataUtils;
|
|
|
|
import dev.plex.player.PlexPlayer;
|
|
|
|
import dev.plex.storage.StorageType;
|
2022-02-04 08:18:07 +00:00
|
|
|
import dev.plex.util.PlexLog;
|
2021-01-03 07:21:15 +00:00
|
|
|
import dev.plex.util.PlexUtils;
|
2020-11-06 18:51:47 +00:00
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.nio.charset.StandardCharsets;
|
2022-02-05 23:14:23 +00:00
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.temporal.ChronoUnit;
|
2022-03-05 23:44:38 +00:00
|
|
|
import java.util.Collection;
|
2020-11-06 18:51:47 +00:00
|
|
|
import java.util.List;
|
2020-11-10 02:47:03 +00:00
|
|
|
import java.util.UUID;
|
2022-04-04 08:36:50 +00:00
|
|
|
import java.util.concurrent.CompletableFuture;
|
2022-02-22 00:20:22 +00:00
|
|
|
import java.util.stream.Collectors;
|
2022-03-05 23:44:38 +00:00
|
|
|
import lombok.Data;
|
2022-04-02 03:58:03 +00:00
|
|
|
import lombok.Getter;
|
2022-02-22 09:30:23 +00:00
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.scheduler.BukkitRunnable;
|
|
|
|
import org.json.JSONObject;
|
2020-11-06 18:51:47 +00:00
|
|
|
|
2022-02-04 08:18:07 +00:00
|
|
|
public class PunishmentManager extends PlexBase
|
2020-11-06 18:51:47 +00:00
|
|
|
{
|
2022-04-02 03:58:03 +00:00
|
|
|
@Getter
|
2022-03-05 23:44:38 +00:00
|
|
|
private final List<IndefiniteBan> indefiniteBans = Lists.newArrayList();
|
2022-02-28 06:28:00 +00:00
|
|
|
|
|
|
|
public void mergeIndefiniteBans()
|
|
|
|
{
|
2022-03-05 23:44:38 +00:00
|
|
|
this.indefiniteBans.clear();
|
2022-03-17 22:16:17 +00:00
|
|
|
Plex.get().indefBans.getKeys(false).forEach(key ->
|
|
|
|
{
|
2022-03-05 23:44:38 +00:00
|
|
|
IndefiniteBan ban = new IndefiniteBan();
|
|
|
|
ban.ips.addAll(Plex.get().getIndefBans().getStringList(key + ".ips"));
|
|
|
|
ban.usernames.addAll(Plex.get().getIndefBans().getStringList(key + ".users"));
|
|
|
|
ban.uuids.addAll(Plex.get().getIndefBans().getStringList(key + ".uuids").stream().map(UUID::fromString).toList());
|
|
|
|
this.indefiniteBans.add(ban);
|
|
|
|
});
|
2022-02-28 06:28:00 +00:00
|
|
|
|
2022-03-05 23:44:38 +00:00
|
|
|
PlexLog.log("Loaded {0} UUID(s), {1} IP(s), and {2} username(s) as indefinitely banned", this.indefiniteBans.stream().map(IndefiniteBan::getUuids).mapToLong(Collection::size).sum(), this.indefiniteBans.stream().map(IndefiniteBan::getIps).mapToLong(Collection::size).sum(), this.indefiniteBans.stream().map(IndefiniteBan::getUsernames).mapToLong(Collection::size).sum());
|
2022-02-28 06:28:00 +00:00
|
|
|
|
|
|
|
if (Plex.get().getRedisConnection().isEnabled())
|
|
|
|
{
|
2022-03-03 23:24:15 +00:00
|
|
|
PlexLog.log("Asynchronously uploading all indefinite bans to Redis");
|
2022-03-17 22:16:17 +00:00
|
|
|
Plex.get().getRedisConnection().runAsync(jedis ->
|
|
|
|
{
|
2022-03-05 23:44:38 +00:00
|
|
|
jedis.set("indefbans", new Gson().toJson(indefiniteBans));
|
2022-02-28 06:28:00 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isIndefUUIDBanned(UUID uuid)
|
|
|
|
{
|
|
|
|
if (Plex.get().getRedisConnection().isEnabled())
|
|
|
|
{
|
2022-03-05 23:44:38 +00:00
|
|
|
PlexLog.debug("Checking if UUID is banned in Redis");
|
2022-03-17 22:16:17 +00:00
|
|
|
List<IndefiniteBan> bans = new Gson().fromJson(Plex.get().getRedisConnection().getJedis().get("indefbans"), new TypeToken<List<IndefiniteBan>>()
|
|
|
|
{
|
|
|
|
}.getType());
|
2022-03-05 23:44:38 +00:00
|
|
|
return bans.stream().anyMatch(indefiniteBan -> indefiniteBan.getUuids().contains(uuid));
|
2022-02-28 06:28:00 +00:00
|
|
|
}
|
2022-03-05 23:44:38 +00:00
|
|
|
return this.indefiniteBans.stream().anyMatch(indefiniteBan -> indefiniteBan.getUuids().contains(uuid));
|
2022-02-28 06:28:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isIndefIPBanned(String ip)
|
|
|
|
{
|
|
|
|
if (Plex.get().getRedisConnection().isEnabled())
|
|
|
|
{
|
2022-03-05 23:44:38 +00:00
|
|
|
PlexLog.debug("Checking if IP is banned in Redis");
|
2022-03-17 22:16:17 +00:00
|
|
|
List<IndefiniteBan> bans = new Gson().fromJson(Plex.get().getRedisConnection().getJedis().get("indefbans"), new TypeToken<List<IndefiniteBan>>()
|
|
|
|
{
|
|
|
|
}.getType());
|
2022-03-05 23:44:38 +00:00
|
|
|
return bans.stream().anyMatch(indefiniteBan -> indefiniteBan.getIps().contains(ip));
|
2022-02-28 06:28:00 +00:00
|
|
|
}
|
2022-03-05 23:44:38 +00:00
|
|
|
return this.indefiniteBans.stream().anyMatch(indefiniteBan -> indefiniteBan.getIps().contains(ip));
|
2022-02-28 06:28:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isIndefUserBanned(String username)
|
|
|
|
{
|
|
|
|
if (Plex.get().getRedisConnection().isEnabled())
|
|
|
|
{
|
2022-03-05 23:44:38 +00:00
|
|
|
PlexLog.debug("Checking if username is banned in Redis");
|
2022-03-17 22:16:17 +00:00
|
|
|
List<IndefiniteBan> bans = new Gson().fromJson(Plex.get().getRedisConnection().getJedis().get("indefbans"), new TypeToken<List<IndefiniteBan>>()
|
|
|
|
{
|
|
|
|
}.getType());
|
2022-03-05 23:44:38 +00:00
|
|
|
return bans.stream().anyMatch(indefiniteBan -> indefiniteBan.getUsernames().contains(username));
|
2022-02-28 06:28:00 +00:00
|
|
|
}
|
2022-03-05 23:44:38 +00:00
|
|
|
return this.indefiniteBans.stream().anyMatch(indefiniteBan -> indefiniteBan.getUsernames().contains(username));
|
2022-02-28 06:28:00 +00:00
|
|
|
}
|
|
|
|
|
2022-04-04 08:36:50 +00:00
|
|
|
public void issuePunishment(PlexPlayer plexPlayer, Punishment punishment)
|
2020-11-06 18:51:47 +00:00
|
|
|
{
|
2022-04-04 08:36:50 +00:00
|
|
|
plexPlayer.getPunishments().add(punishment);
|
|
|
|
if (Plex.get().getStorageType() == StorageType.MONGODB)
|
|
|
|
{
|
|
|
|
CompletableFuture.runAsync(() -> {
|
|
|
|
DataUtils.update(plexPlayer);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
Plex.get().getSqlPunishment().insertPunishment(punishment);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*File file = player.getPunishmentsFile();
|
2020-11-06 18:51:47 +00:00
|
|
|
|
2022-01-30 21:03:47 +00:00
|
|
|
try
|
|
|
|
{
|
2020-11-06 18:51:47 +00:00
|
|
|
if (isNotEmpty(file))
|
|
|
|
{
|
|
|
|
JSONTokener tokener = new JSONTokener(new FileInputStream(file));
|
|
|
|
JSONObject object = new JSONObject(tokener);
|
|
|
|
object.getJSONObject(punishment.getPunished().toString()).getJSONArray("punishments").put(punishment.toJSON());
|
2022-04-03 21:45:32 +00:00
|
|
|
addToRedis(player, file, object);
|
2022-02-22 09:30:23 +00:00
|
|
|
}
|
|
|
|
else
|
2022-01-30 21:03:47 +00:00
|
|
|
{
|
2020-11-06 18:51:47 +00:00
|
|
|
JSONObject object = new JSONObject();
|
|
|
|
Map<String, List<String>> punishments = Maps.newHashMap();
|
|
|
|
|
|
|
|
List<String> punishmentList = Lists.newArrayList();
|
|
|
|
punishmentList.add(punishment.toJSON());
|
|
|
|
|
|
|
|
punishments.put("punishments", punishmentList);
|
|
|
|
object.put(punishment.getPunished().toString(), punishments);
|
2022-04-03 21:45:32 +00:00
|
|
|
addToRedis(player, file, object);
|
2020-11-06 18:51:47 +00:00
|
|
|
}
|
2022-02-22 09:30:23 +00:00
|
|
|
}
|
|
|
|
catch (IOException e)
|
2022-01-30 21:03:47 +00:00
|
|
|
{
|
2020-11-06 18:51:47 +00:00
|
|
|
e.printStackTrace();
|
2022-04-04 08:36:50 +00:00
|
|
|
}*/
|
2022-04-03 21:45:32 +00:00
|
|
|
}
|
|
|
|
|
2022-01-30 21:03:47 +00:00
|
|
|
private boolean isNotEmpty(File file)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2020-11-06 18:51:47 +00:00
|
|
|
return !FileUtils.readFileToString(file, StandardCharsets.UTF_8).trim().isEmpty();
|
2022-02-22 09:30:23 +00:00
|
|
|
}
|
|
|
|
catch (IOException e)
|
2022-01-30 21:03:47 +00:00
|
|
|
{
|
2020-11-06 18:51:47 +00:00
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-04-04 08:36:50 +00:00
|
|
|
public CompletableFuture<Boolean> isAsyncBanned(UUID uuid)
|
|
|
|
{
|
|
|
|
return CompletableFuture.supplyAsync(() -> {
|
|
|
|
PlexPlayer player = DataUtils.getPlayer(uuid);
|
|
|
|
player.loadPunishments();
|
|
|
|
return player.getPunishments().stream().anyMatch(punishment -> punishment.getType() == PunishmentType.BAN && punishment.isActive());
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-02-22 00:20:22 +00:00
|
|
|
public boolean isBanned(UUID uuid)
|
|
|
|
{
|
2022-04-04 08:36:50 +00:00
|
|
|
return DataUtils.getPlayer(uuid).getPunishments().stream().anyMatch(punishment -> punishment.getType() == PunishmentType.BAN && punishment.isActive());
|
2022-02-22 00:20:22 +00:00
|
|
|
}
|
|
|
|
|
2022-04-04 08:36:50 +00:00
|
|
|
public boolean isBanned(PlexPlayer player)
|
2022-02-22 00:20:22 +00:00
|
|
|
{
|
|
|
|
return isBanned(UUID.fromString(player.getUuid()));
|
|
|
|
}
|
|
|
|
|
2022-04-04 08:36:50 +00:00
|
|
|
public CompletableFuture<List<Punishment>> getActiveBans()
|
2022-02-22 00:20:22 +00:00
|
|
|
{
|
2022-04-04 08:36:50 +00:00
|
|
|
if (Plex.get().getStorageType() == StorageType.MONGODB)
|
|
|
|
{
|
|
|
|
return CompletableFuture.supplyAsync(() -> {
|
|
|
|
List<PlexPlayer> players = Plex.get().getMongoPlayerData().getPlayers();
|
|
|
|
return players.stream().map(PlexPlayer::getPunishments).flatMap(Collection::stream).filter(Punishment::isActive).filter(punishment -> punishment.getType() == PunishmentType.BAN).toList();
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
CompletableFuture<List<Punishment>> future = new CompletableFuture<>();
|
|
|
|
Plex.get().getSqlPunishment().getPunishments().whenComplete((punishments, throwable) -> {
|
|
|
|
future.complete(punishments.stream().filter(Punishment::isActive).filter(punishment -> punishment.getType() == PunishmentType.BAN).toList());
|
|
|
|
});
|
|
|
|
return future;
|
|
|
|
}
|
|
|
|
/*List<Punishment> punishments = Lists.newArrayList();
|
2022-03-19 09:38:09 +00:00
|
|
|
|
|
|
|
if (Plex.get().getRedisConnection().isEnabled())
|
2022-02-22 00:20:22 +00:00
|
|
|
{
|
2022-03-19 09:38:09 +00:00
|
|
|
Jedis jedis = Plex.get().getRedisConnection().getJedis();
|
2022-04-03 22:59:16 +00:00
|
|
|
for (String key : jedis.keys("*"))
|
2022-02-22 00:20:22 +00:00
|
|
|
{
|
2022-03-19 09:38:09 +00:00
|
|
|
try
|
2022-02-22 00:20:22 +00:00
|
|
|
{
|
2022-03-19 09:38:09 +00:00
|
|
|
UUID uuid = UUID.fromString(key);
|
|
|
|
String jsonPunishmentString = jedis.get(uuid.toString());
|
|
|
|
JSONObject object = new JSONObject(jsonPunishmentString);
|
2022-04-03 22:59:16 +00:00
|
|
|
for (Object json : object.getJSONObject(uuid.toString()).getJSONArray("punishments"))
|
2022-02-22 00:20:22 +00:00
|
|
|
{
|
2022-03-19 09:38:09 +00:00
|
|
|
Punishment punishment = Punishment.fromJson(json.toString());
|
|
|
|
if (punishment.isActive() && punishment.getType() == PunishmentType.BAN)
|
|
|
|
{
|
|
|
|
punishments.add(punishment);
|
|
|
|
}
|
2022-04-03 22:59:16 +00:00
|
|
|
}
|
2022-03-19 09:38:09 +00:00
|
|
|
}
|
|
|
|
catch (IllegalArgumentException ignored)
|
|
|
|
{
|
|
|
|
}
|
2022-04-03 22:59:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
File fileDir = new File(plugin.getDataFolder() + File.separator + "punishments");
|
|
|
|
for (File file : Objects.requireNonNull(fileDir.listFiles()))
|
|
|
|
{
|
|
|
|
if (isNotEmpty(file))
|
|
|
|
{
|
|
|
|
try (FileInputStream fis = new FileInputStream(file))
|
|
|
|
{
|
|
|
|
JSONTokener tokener = new JSONTokener(fis);
|
|
|
|
JSONObject object = new JSONObject(tokener);
|
|
|
|
object.keySet().stream().findFirst().ifPresent(key ->
|
|
|
|
{
|
|
|
|
JSONObject obj = object.getJSONObject(key);
|
|
|
|
punishments.addAll(obj.getJSONArray("punishments").toList().stream().map(Object::toString).map(Punishment::fromJson).filter(punishment -> punishment.isActive() && punishment.getType() == PunishmentType.BAN).toList());
|
|
|
|
});
|
|
|
|
}
|
|
|
|
catch (IOException e)
|
|
|
|
{
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-04 08:36:50 +00:00
|
|
|
}*/
|
|
|
|
// return punishments;
|
2022-02-22 00:20:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void unban(Punishment punishment)
|
|
|
|
{
|
|
|
|
this.unban(punishment.getPunished());
|
|
|
|
}
|
|
|
|
|
2022-04-04 08:36:50 +00:00
|
|
|
public CompletableFuture<Void> unban(UUID uuid)
|
2022-02-22 00:20:22 +00:00
|
|
|
{
|
2022-04-04 08:36:50 +00:00
|
|
|
if (Plex.get().getStorageType() == StorageType.MONGODB)
|
|
|
|
{
|
|
|
|
return CompletableFuture.runAsync(() -> {
|
|
|
|
PlexPlayer plexPlayer = DataUtils.getPlayer(uuid);
|
|
|
|
plexPlayer.setPunishments(plexPlayer.getPunishments().stream().filter(Punishment::isActive).filter(punishment -> punishment.getType() == PunishmentType.BAN)
|
|
|
|
.peek(punishment -> punishment.setActive(false)).collect(Collectors.toList()));
|
|
|
|
DataUtils.update(plexPlayer);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
return Plex.get().getSqlPunishment().removeBan(uuid);
|
|
|
|
}
|
|
|
|
/*if (Plex.get().getRedisConnection().isEnabled())
|
2022-02-22 00:20:22 +00:00
|
|
|
{
|
|
|
|
Jedis jedis = Plex.get().getRedisConnection().getJedis();
|
|
|
|
|
|
|
|
String jsonPunishmentString = jedis.get(uuid.toString());
|
|
|
|
JSONObject object = new JSONObject(jsonPunishmentString);
|
2022-04-03 21:45:32 +00:00
|
|
|
setActive(uuid, object, false);
|
2022-02-22 00:20:22 +00:00
|
|
|
jedis.set(uuid.toString(), object.toString());
|
|
|
|
}
|
|
|
|
|
2022-02-25 07:50:11 +00:00
|
|
|
PunishedPlayer player = PlayerCache.getPunishedPlayer(uuid);
|
|
|
|
|
2022-02-22 00:20:22 +00:00
|
|
|
File file = player.getPunishmentsFile();
|
|
|
|
if (isNotEmpty(file))
|
|
|
|
{
|
|
|
|
try (FileInputStream fis = new FileInputStream(file))
|
|
|
|
{
|
|
|
|
JSONTokener tokener = new JSONTokener(fis);
|
|
|
|
JSONObject object = new JSONObject(tokener);
|
2022-04-03 21:45:32 +00:00
|
|
|
setActive(uuid, object, false);
|
2022-02-22 00:20:22 +00:00
|
|
|
FileWriter writer = new FileWriter(file);
|
|
|
|
writer.append(object.toString());
|
|
|
|
writer.flush();
|
|
|
|
writer.close();
|
2022-02-22 09:30:23 +00:00
|
|
|
}
|
|
|
|
catch (IOException e)
|
2022-02-22 00:20:22 +00:00
|
|
|
{
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
2022-04-04 08:36:50 +00:00
|
|
|
}*/
|
2022-02-22 00:20:22 +00:00
|
|
|
}
|
|
|
|
|
2022-04-03 21:45:32 +00:00
|
|
|
private void setActive(UUID uuid, JSONObject object, boolean active)
|
|
|
|
{
|
|
|
|
List<Punishment> punishments = object.getJSONObject(uuid.toString()).getJSONArray("punishments").toList().stream().map(obj -> Punishment.fromJson(obj.toString())).collect(Collectors.toList());
|
|
|
|
while (punishments.stream().anyMatch(punishment -> punishment.isActive() && punishment.getType() == PunishmentType.BAN))
|
|
|
|
{
|
|
|
|
punishments.stream().filter(Punishment::isActive).filter(punishment -> punishment.getType() == PunishmentType.BAN).findFirst().ifPresent(punishment ->
|
|
|
|
{
|
|
|
|
int index = punishments.indexOf(punishment);
|
|
|
|
punishment.setActive(active);
|
|
|
|
punishments.set(index, punishment);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
object.getJSONObject(uuid.toString()).getJSONArray("punishments").clear();
|
|
|
|
object.getJSONObject(uuid.toString()).getJSONArray("punishments").putAll(punishments.stream().map(Punishment::toJSON).collect(Collectors.toList()));
|
|
|
|
}
|
|
|
|
|
2022-04-04 08:36:50 +00:00
|
|
|
private void doPunishment(PlexPlayer player, Punishment punishment)
|
2020-11-10 02:47:03 +00:00
|
|
|
{
|
2022-02-22 00:20:22 +00:00
|
|
|
if (punishment.getType() == PunishmentType.FREEZE)
|
2020-11-10 02:47:03 +00:00
|
|
|
{
|
|
|
|
player.setFrozen(true);
|
2022-02-05 23:14:23 +00:00
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
LocalDateTime then = punishment.getEndDate();
|
|
|
|
long seconds = ChronoUnit.SECONDS.between(now, then);
|
2022-01-30 21:03:47 +00:00
|
|
|
new BukkitRunnable()
|
|
|
|
{
|
2020-11-10 02:47:03 +00:00
|
|
|
@Override
|
2022-01-30 21:03:47 +00:00
|
|
|
public void run()
|
|
|
|
{
|
2020-11-10 02:47:03 +00:00
|
|
|
if (!player.isFrozen())
|
|
|
|
{
|
|
|
|
this.cancel();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
player.setFrozen(false);
|
2022-02-25 07:09:55 +00:00
|
|
|
Bukkit.broadcast(PlexUtils.messageComponent("unfrozePlayer", "Plex", Bukkit.getOfflinePlayer(UUID.fromString(player.getUuid())).getName()));
|
2020-11-10 02:47:03 +00:00
|
|
|
}
|
|
|
|
}.runTaskLater(Plex.get(), 20 * seconds);
|
2022-02-22 09:30:23 +00:00
|
|
|
}
|
|
|
|
else if (punishment.getType() == PunishmentType.MUTE)
|
2020-11-10 02:47:03 +00:00
|
|
|
{
|
|
|
|
player.setMuted(true);
|
2022-02-05 23:14:23 +00:00
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
LocalDateTime then = punishment.getEndDate();
|
|
|
|
long seconds = ChronoUnit.SECONDS.between(now, then);
|
2022-01-30 21:03:47 +00:00
|
|
|
new BukkitRunnable()
|
|
|
|
{
|
2020-11-10 02:47:03 +00:00
|
|
|
@Override
|
2022-01-30 21:03:47 +00:00
|
|
|
public void run()
|
|
|
|
{
|
2022-02-25 08:59:48 +00:00
|
|
|
if (!player.isMuted())
|
|
|
|
{
|
|
|
|
this.cancel();
|
|
|
|
return;
|
|
|
|
}
|
2020-11-10 02:47:03 +00:00
|
|
|
player.setMuted(false);
|
2022-02-25 08:59:48 +00:00
|
|
|
Bukkit.broadcast(PlexUtils.messageComponent("unmutedPlayer", "Plex", Bukkit.getOfflinePlayer(UUID.fromString(player.getUuid())).getName()));
|
2020-11-10 02:47:03 +00:00
|
|
|
}
|
|
|
|
}.runTaskLater(Plex.get(), 20 * seconds);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-04 08:36:50 +00:00
|
|
|
public void punish(PlexPlayer player, Punishment punishment)
|
2020-11-10 02:47:03 +00:00
|
|
|
{
|
|
|
|
issuePunishment(player, punishment);
|
2022-04-04 08:36:50 +00:00
|
|
|
doPunishment(player, punishment);
|
2020-11-10 02:47:03 +00:00
|
|
|
}
|
2022-03-05 23:44:38 +00:00
|
|
|
|
|
|
|
@Data
|
|
|
|
public static class IndefiniteBan
|
|
|
|
{
|
|
|
|
private final List<String> usernames = Lists.newArrayList();
|
|
|
|
private final List<UUID> uuids = Lists.newArrayList();
|
|
|
|
private final List<String> ips = Lists.newArrayList();
|
|
|
|
}
|
2020-11-06 18:51:47 +00:00
|
|
|
}
|