mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-18 14:50:57 +08:00
Remove deprecated API & Fix resource checking
This commit is contained in:
@@ -1,31 +1,25 @@
|
||||
package emu.grasscutter.utils;
|
||||
|
||||
import static emu.grasscutter.utils.FileUtils.getResourcePath;
|
||||
import static emu.grasscutter.utils.lang.Language.translate;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.config.ConfigContainer;
|
||||
import emu.grasscutter.data.DataLoader;
|
||||
import emu.grasscutter.game.world.Position;
|
||||
import io.javalin.http.Context;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import io.netty.buffer.*;
|
||||
import it.unimi.dsi.fastutil.ints.*;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.time.DayOfWeek;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.nio.file.*;
|
||||
import java.time.*;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import javax.annotation.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import static emu.grasscutter.utils.FileUtils.getResourcePath;
|
||||
import static emu.grasscutter.utils.lang.Language.translate;
|
||||
|
||||
@SuppressWarnings({"UnusedReturnValue", "BooleanMethodIsAlwaysInverted"})
|
||||
public final class Utils {
|
||||
@@ -196,10 +190,6 @@ public final class Utils {
|
||||
// Check for game data.
|
||||
if (!fileExists(dataFolder)) createFolder(dataFolder);
|
||||
|
||||
// Make sure the data folder is populated, if there are any missing files copy them from
|
||||
// resources
|
||||
DataLoader.checkAllFiles();
|
||||
|
||||
// Check for Server resources.
|
||||
if (!Files.exists(getResourcePath("Server"))) {
|
||||
logger.info(translate("messages.status.resources.missing_server"));
|
||||
@@ -217,6 +207,9 @@ public final class Utils {
|
||||
|
||||
// Exit if there are any missing files.
|
||||
if (exit) System.exit(1);
|
||||
|
||||
// Validate the data directory.
|
||||
DataLoader.checkAllFiles();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user