Rework punishment system by deleting the Ban and BanManager and moving everything into Punishment Manager. TODO cache punishments maybe? who knows! add an active field to punishments and fix the ban service to actually unban players

This commit is contained in:
Taah
2022-02-21 16:20:22 -08:00
parent d4578f2255
commit 6f506ac5cb
16 changed files with 295 additions and 381 deletions

View File

@ -2,13 +2,6 @@ package dev.plex.util;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializer;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
@ -16,13 +9,21 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
public class MojangUtils
{
public static AshconInfo getInfo(String name)
public static AshconInfo getInfo(String nameOrUuid)
{
CloseableHttpClient client = HttpClients.createDefault();
HttpGet get = new HttpGet("https://api.ashcon.app/mojang/v2/user/" + name);
HttpGet get = new HttpGet("https://api.ashcon.app/mojang/v2/user/" + nameOrUuid);
try
{
HttpResponse response = client.execute(get);