diff --git a/src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java b/src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java index 0a6645f..293d09e 100644 --- a/src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java +++ b/src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java @@ -3,12 +3,15 @@ package dev.plex.request.impl; import dev.plex.HTTPDModule; import dev.plex.request.AbstractServlet; import dev.plex.request.GetMapping; +import dev.plex.util.PlexLog; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; public class SchematicDownloadEndpoint extends AbstractServlet { @@ -72,20 +75,37 @@ public class SchematicDownloadEndpoint extends AbstractServlet return null; } StringBuilder sb = new StringBuilder(); - File[] alphabetical = worldeditFolder.listFiles(); - if (alphabetical != null) + for (File worldeditFile : listFilesForFolder(worldeditFolder)) { - Arrays.sort(alphabetical); - for (File worldeditFile : alphabetical) - { - String sanitizedName = worldeditFile.getName().replaceAll("<","<").replaceAll(">",">"); - sb.append("