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

26 lines
672 B
Java
Raw Normal View History

2019-03-03 22:33:44 +01:00
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);
}
}