mirror of
https://github.com/songoda/UltimateModeration.git
synced 2024-09-28 14:37:41 +02:00
26 lines
672 B
Java
26 lines
672 B
Java
|
package com.songoda.ultimatemoderation.punish.player;
|
||
|
|
||
|
import org.bukkit.OfflinePlayer;
|
||
|
|
||
|
import java.util.Collections;
|
||
|
import java.util.HashMap;
|
||
|
import java.util.Map;
|
||
|
import java.util.UUID;
|
||
|
|
||
|
public class PunishmentManager {
|
||
|
|
||
|
private Map<UUID, PlayerPunishData> punishments = new HashMap<>();
|
||
|
|
||
|
public Map<UUID, PlayerPunishData> getPunishments() {
|
||
|
return Collections.unmodifiableMap(punishments);
|
||
|
}
|
||
|
|
||
|
public PlayerPunishData getPlayer(OfflinePlayer player) {
|
||
|
return getPlayer(player.getUniqueId());
|
||
|
}
|
||
|
|
||
|
public PlayerPunishData getPlayer(UUID player) {
|
||
|
return punishments.computeIfAbsent(player, PlayerPunishData::new);
|
||
|
}
|
||
|
}
|