From 33e4764e95cd800f6e3c7271f10172d9dc19d446 Mon Sep 17 00:00:00 2001 From: Slqmy <90862990+Slqmy@users.noreply.github.com> Date: Wed, 14 Aug 2024 12:37:18 +0100 Subject: [PATCH] Use a constant for `"assets"` --- .../resource_pack/ResourcePackManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/slqmy/template_paper_plugin/resource_pack/ResourcePackManager.java b/src/main/java/net/slqmy/template_paper_plugin/resource_pack/ResourcePackManager.java index 762216a6..10e83d69 100644 --- a/src/main/java/net/slqmy/template_paper_plugin/resource_pack/ResourcePackManager.java +++ b/src/main/java/net/slqmy/template_paper_plugin/resource_pack/ResourcePackManager.java @@ -18,6 +18,8 @@ public class ResourcePackManager { private final String resourcePackFileExtension = "zip"; private final String resourcePackFileMimeType = resourcePackFileType + FileUtil.getFileMimeTypeTypeSubtypeSeparator() + resourcePackFileExtension; + private final String resourcePackAssetsFolderName = "assets"; + private String resourcePackZipFilePath; private File resourcePackZipFile; @@ -59,11 +61,11 @@ private void saveResourcepackZipFile() { return; } - if (!List.of(resourcePackFiles).contains("assets")) { + if (!List.of(resourcePackFiles).contains(resourcePackAssetsFolderName)) { return; } - File assetsFile = new File(plugin.getDataPath() + File.separator + resourcePackResourceFolderName + File.separator + "assets"); + File assetsFile = new File(plugin.getDataPath() + File.separator + resourcePackResourceFolderName + File.separator + resourcePackAssetsFolderName); if (FileUtil.isDirectoryRecursivelyEmpty(assetsFile)) { return; }