From f6df468e47dc6cb47f69fd5120295c882f8cef86 Mon Sep 17 00:00:00 2001 From: Yazawazi <47273265+Yazawazi@users.noreply.github.com> Date: Thu, 21 Apr 2022 10:37:24 +0800 Subject: [PATCH] folder check --- src/main/java/emu/grasscutter/data/ResourceLoader.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/emu/grasscutter/data/ResourceLoader.java b/src/main/java/emu/grasscutter/data/ResourceLoader.java index e597257ce..8a29f5a72 100644 --- a/src/main/java/emu/grasscutter/data/ResourceLoader.java +++ b/src/main/java/emu/grasscutter/data/ResourceLoader.java @@ -129,6 +129,12 @@ public class ResourceLoader { private static void loadScenePoints() { Pattern pattern = Pattern.compile("(?<=scene)(.*?)(?=_point.json)"); File folder = new File(Grasscutter.getConfig().RESOURCE_FOLDER + "BinOutPut/Scene/Point"); + + if (!folder.isDirectory() || !folder.exists() || folder.listFiles() == null) { + Grasscutter.getLogger().error("Scene point files cannot be found, you cannot use teleport waypoints!"); + return; + } + List scenePointList = new ArrayList<>(); for (File file : folder.listFiles()) { ScenePointConfig config = null;