diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/DebugCleanCacheCommand.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/DebugCleanCacheCommand.java index d6b01bcd3..2371f0c9f 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/DebugCleanCacheCommand.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/DebugCleanCacheCommand.java @@ -13,6 +13,7 @@ import net.momirealms.craftengine.core.pack.allocator.IdAllocator; import net.momirealms.craftengine.core.pack.allocator.VisualBlockStateAllocator; import net.momirealms.craftengine.core.plugin.CraftEngine; import net.momirealms.craftengine.core.plugin.command.CraftEngineCommandManager; +import net.momirealms.craftengine.core.plugin.config.Config; import net.momirealms.craftengine.core.util.FileUtils; import net.momirealms.craftengine.core.util.Key; import org.bukkit.command.CommandSender; @@ -165,7 +166,7 @@ public class DebugCleanCacheCommand extends BukkitCommandFeature Map idAllocators = new HashMap<>(); try (Stream files = Files.list(cacheDir)) { files.filter(this::isJsonFile) - .forEach(file -> processIdAllocatorFile(cacheDir, file, idAllocators)); + .forEach(file -> processIdAllocatorFile("minecraft", file, idAllocators)); } catch (IOException e) { CraftEngine.instance().logger().warn("Failed to process: " + cacheDir.getFileName(), e); @@ -199,7 +200,7 @@ public class DebugCleanCacheCommand extends BukkitCommandFeature try (Stream files = Files.list(namespace)) { files.filter(this::isJsonFile) - .forEach(file -> processIdAllocatorFile(namespace, file, idAllocators)); + .forEach(file -> processIdAllocatorFile(namespace.getFileName().toString(), file, idAllocators)); } catch (IOException e) { CraftEngine.instance().logger().warn("Failed to process namespace: " + namespace.getFileName(), e); @@ -210,9 +211,8 @@ public class DebugCleanCacheCommand extends BukkitCommandFeature return Files.isRegularFile(file) && file.getFileName().toString().endsWith(".json"); } - private void processIdAllocatorFile(Path namespace, Path file, Map idAllocators) { + private void processIdAllocatorFile(String namespaceName, Path file, Map idAllocators) { try { - String namespaceName = namespace.getFileName().toString(); String fileName = FileUtils.pathWithoutExtension(file.getFileName().toString()); Key font = Key.of(namespaceName, fileName);