Add warning when the server is missing a floor info

This commit is contained in:
Melledy
2024-07-30 23:45:01 -07:00
parent c8ac84ff37
commit 57b0454866

View File

@@ -224,6 +224,11 @@ public class ResourceLoader {
String name = "P" + excel.getPlaneID() + "_F" + excel.getFloorID(); String name = "P" + excel.getPlaneID() + "_F" + excel.getFloorID();
File file = new File(LunarCore.getConfig().getResourceDir() + "/Config/LevelOutput/RuntimeFloor/" + name + ".json"); File file = new File(LunarCore.getConfig().getResourceDir() + "/Config/LevelOutput/RuntimeFloor/" + name + ".json");
if (!file.exists()) {
LunarCore.getLogger().warn("Missing floor info: " + name);
continue;
}
try (FileReader reader = new FileReader(file)) { try (FileReader reader = new FileReader(file)) {
FloorInfo floor = gson.fromJson(reader, FloorInfo.class); FloorInfo floor = gson.fromJson(reader, FloorInfo.class);
GameData.getFloorInfos().put(name, floor); GameData.getFloorInfos().put(name, floor);