Skip to content

Commit

Permalink
+ 配置文件位置
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlimiter committed Dec 20, 2023
1 parent d4ca63f commit 2e4a3e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions src/main/java/nova/committee/atom/sweep/ISweep.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
import nova.committee.atom.sweep.init.handler.SweepHandler;
import nova.committee.atom.sweep.util.FileUtils;

import static nova.committee.atom.sweep.Static.CONFIG_FOLDER;
import static nova.committee.atom.sweep.Static.ATOM_FOLDER;
import static nova.committee.atom.sweep.Static.SWEEP_FOLDER;

public class ISweep {
public ISweep() {
CONFIG_FOLDER = FMLPaths.GAMEDIR.get().resolve("atom");
FileUtils.checkFolder(CONFIG_FOLDER);
Static.CONFIG_FILE = CONFIG_FOLDER.resolve("config.toml");
ATOM_FOLDER = FMLPaths.GAMEDIR.get().resolve("atom");
FileUtils.checkFolder(ATOM_FOLDER);
SWEEP_FOLDER = ATOM_FOLDER.resolve("sweep");
FileUtils.checkFolder(SWEEP_FOLDER);
Static.CONFIG_FILE = SWEEP_FOLDER.resolve("config.toml");
Static.isLuckPerms = ModList.get().isLoaded("luckperms");
}

Expand All @@ -28,11 +31,11 @@ public void onServerStarted(MinecraftServer server) {
}

public void onServerStopping(MinecraftServer server) {
Sweeper.INSTANCE.stopSweep();

}

public void onServerStopped(MinecraftServer server) {

Sweeper.INSTANCE.stopSweep();
}

public void onServerTick(TickEvent.ServerTickEvent event) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/nova/committee/atom/sweep/Static.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public class Static {
public static final String MOD_ID = "atomsweep";
public static final Logger LOGGER = LogManager.getLogger(MOD_ID);
public static Path CONFIG_FILE;
public static Path CONFIG_FOLDER;
public static Path ATOM_FOLDER;
public static Path SWEEP_FOLDER;
public static MinecraftServer SERVER = ServerLifecycleHooks.getCurrentServer();
public static boolean isLuckPerms = false;

Expand Down

0 comments on commit 2e4a3e3

Please sign in to comment.