package dev.plex.request.impl; import com.google.gson.GsonBuilder; import dev.plex.HTTPDModule; import dev.plex.Plex; import dev.plex.cache.DataUtils; import dev.plex.player.PlexPlayer; import dev.plex.rank.enums.Rank; import dev.plex.request.AbstractServlet; import dev.plex.request.GetMapping; import dev.plex.util.PlexLog; import dev.plex.util.adapter.LocalDateTimeSerializer; import jakarta.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import java.time.LocalDateTime; import java.util.UUID; public class PunishmentsEndpoint extends AbstractServlet { @GetMapping(endpoint = "/api/punishments/") public String getPunishments(HttpServletRequest request) { String ipAddress = request.getRemoteAddr(); if (ipAddress == null) { return "An IP address could not be detected. Please ensure you are connecting using IPv4."; } if (request.getPathInfo() == null) { /*StringBuilder contentBuilder = new StringBuilder(); PlexLog.log(this.getClass().getClassLoader().getResource("punishments.html").getPath()); try { BufferedReader in = new BufferedReader(new FileReader(this.getClass().getClassLoader().getResource("punishments.html").getFile().replace("!", ""))); String str; while ((str = in.readLine()) != null) { contentBuilder.append(str); } in.close(); } catch (IOException ignored) { } return contentBuilder.toString();*/ return """