All is good.

This commit is contained in:
Szum123321 2020-05-08 23:13:34 +02:00
parent c8c370cec0
commit 7e1fe5a602
4 changed files with 15 additions and 3 deletions

View File

@ -9,6 +9,6 @@ loader_version=0.8.2+build.194
fabric_version=0.10.7+build.344-1.16 fabric_version=0.10.7+build.344-1.16
# Mod Properties # Mod Properties
mod_version = 1.2.0-1.15 mod_version = 1.2.0-20w19a
maven_group = net.szum123321 maven_group = net.szum123321
archives_base_name = textile_backup archives_base_name = textile_backup

View File

@ -23,12 +23,17 @@ import io.github.cottonmc.cotton.config.ConfigManager;
import io.github.cottonmc.cotton.logging.ModLogger; import io.github.cottonmc.cotton.logging.ModLogger;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.server.ServerStartCallback;
import net.fabricmc.fabric.api.registry.CommandRegistry; import net.fabricmc.fabric.api.registry.CommandRegistry;
import net.minecraft.class_5218;
import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.level.storage.LevelStorage;
import net.szum123321.textile_backup.commands.BlacklistCommand; import net.szum123321.textile_backup.commands.BlacklistCommand;
import net.szum123321.textile_backup.commands.CleanupCommand; import net.szum123321.textile_backup.commands.CleanupCommand;
import net.szum123321.textile_backup.commands.StartBackupCommand; import net.szum123321.textile_backup.commands.StartBackupCommand;
import net.szum123321.textile_backup.commands.WhitelistCommand; import net.szum123321.textile_backup.commands.WhitelistCommand;
import net.szum123321.textile_backup.mixin.MinecraftServerSessionAccessor;
public class TextileBackup implements ModInitializer { public class TextileBackup implements ModInitializer {
public static final String MOD_ID = "textile_backup"; public static final String MOD_ID = "textile_backup";
@ -45,6 +50,13 @@ public class TextileBackup implements ModInitializer {
config = ConfigManager.loadConfig(ConfigHandler.class); config = ConfigManager.loadConfig(ConfigHandler.class);
registerCommands(); registerCommands();
ServerStartCallback.EVENT.register(server -> {
LevelStorage.Session session = ((MinecraftServerSessionAccessor)server).getSession();
System.out.println(session.getDirectory(class_5218.field_24188).toAbsolutePath());
System.out.println(session.method_27424(DimensionType.OVERWORLD).toPath().toAbsolutePath());
});
} }
private void registerCommands(){ private void registerCommands(){

View File

@ -50,7 +50,7 @@ public class MakeBackupThread implements Runnable {
public void run() { public void run() {
File world = ((MinecraftServerSessionAccessor)server) File world = ((MinecraftServerSessionAccessor)server)
.getSession() .getSession()
.getDirectory(class_5218.field_24188).toFile(); .method_27424(DimensionType.OVERWORLD);
File outFile = BackupHelper File outFile = BackupHelper
.getBackupRootPath(Utilities.getLevelName(server)) .getBackupRootPath(Utilities.getLevelName(server))

View File

@ -29,6 +29,6 @@
"depends": { "depends": {
"fabricloader": ">=0.7.2", "fabricloader": ">=0.7.2",
"fabric": "*", "fabric": "*",
"minecraft": "1.15.*" "minecraft": "1.16.*"
} }
} }