Skip to content

Commit

Permalink
Use updated utility library
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Oct 29, 2024
1 parent b9428ae commit 4ba559a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 41 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ dependencies {

implementation("dev.jorel", "commandapi-bukkit-shade-mojang-mapped", "9.5.3")
implementation("net.lingala.zip4j", "zip4j", "2.11.5")
implementation("com.github.EsotericFoundation:utility.kt:0.3.0")
implementation("com.github.EsotericFoundation:utility.kt:0.4.0")
implementation("com.github.EsotericFoundation:plugin-library:0.3.0")
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.sun.net.httpserver.HttpServer;
import org.bukkit.Bukkit;
import foundation.esoteric.minecraft.plugins.template.PaperTemplatePlugin;
import foundation.esoteric.minecraft.plugins.template.file.FileUtil;
import foundation.esoteric.minecraft.plugins.template.http.server.event.listeners.PlayerJoinListener;
import foundation.esoteric.minecraft.plugins.template.resourcepack.ResourcePackManager;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -74,7 +73,7 @@ public void handle(HttpExchange exchange) throws IOException {

if (file.exists()) {
exchange.getResponseHeaders().set("Content-Type", resourcePackManager.getResourcePackFileMimeType());
exchange.getResponseHeaders().set("Content-Disposition", "attachment; filename=\"" + resourcePackManager.getResourcePackResourceFolderName() + FileUtil.getFileExtensionSeparator() + resourcePackManager.getResourcePackFileExtension() + "\"");
exchange.getResponseHeaders().set("Content-Disposition", "attachment; filename=\"" + resourcePackManager.getResourcePackResourceFolderName() + "." + resourcePackManager.getResourcePackFileExtension() + "\"");

exchange.sendResponseHeaders(successResponseCode, file.length());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import foundation.esoteric.utility.file.FileUtility;
import org.apache.commons.io.FileUtils;
import foundation.esoteric.minecraft.plugins.template.PaperTemplatePlugin;
import foundation.esoteric.minecraft.plugins.template.file.FileUtil;

import java.io.File;
import java.util.List;
Expand All @@ -16,7 +15,7 @@ public class ResourcePackManager {

private final String resourcePackFileType = "application";
private final String resourcePackFileExtension = "zip";
private final String resourcePackFileMimeType = resourcePackFileType + FileUtil.getFileMimeTypeTypeSubtypeSeparator() + resourcePackFileExtension;
private final String resourcePackFileMimeType = resourcePackFileType + "/" + resourcePackFileExtension;

private final String resourcePackAssetsFolderName = "assets";

Expand Down Expand Up @@ -70,11 +69,11 @@ private void saveResourcepackZipFile() {
return;
}

resourcePackZipFilePath = plugin.getDataPath() + File.separator + resourcePackResourceFolderName + FileUtil.getFileExtensionSeparator() + resourcePackFileExtension;
resourcePackZipFilePath = plugin.getDataPath() + File.separator + resourcePackResourceFolderName + "." + resourcePackFileExtension;

try {
resourcePackZipFile = new File(resourcePackZipFilePath);
FileUtil.zipFolder(resourcePackFolder, resourcePackZipFile);
FileUtility.Companion.zipFolder(resourcePackFolder, resourcePackZipFile);

FileUtils.deleteDirectory(resourcePackFolder);
} catch (Exception exception) {
Expand Down

0 comments on commit 4ba559a

Please sign in to comment.