UltimateModeration/src/main/java/com/craftaro/ultimatemoderation/punish/player/PunishmentManager.java

25 lines
688 B
Java
Raw Normal View History

2023-08-02 18:57:10 +02:00
package com.craftaro.ultimatemoderation.punish.player;
2019-03-03 22:33:44 +01:00
import org.bukkit.OfflinePlayer;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class PunishmentManager {
private final Map<UUID, PlayerPunishData> punishments = new HashMap<>();
2019-03-03 22:33:44 +01:00
public Map<UUID, PlayerPunishData> getPunishments() {
return Collections.unmodifiableMap(this.punishments);
2019-03-03 22:33:44 +01:00
}
public PlayerPunishData getPlayer(OfflinePlayer player) {
return getPlayer(player.getUniqueId());
}
public PlayerPunishData getPlayer(UUID player) {
return this.punishments.computeIfAbsent(player, PlayerPunishData::new);
2019-03-03 22:33:44 +01:00
}
}