From d506cc799fc9499129eff19377c7471d1c0cb841 Mon Sep 17 00:00:00 2001 From: Keuin Date: Tue, 28 Apr 2020 20:49:46 +0800 Subject: refactor --- src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java | 2 +- src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java | 3 ++- .../com/keuin/kbackupfabric/exception/ZipUtilException.java | 10 ++++++++++ .../com/keuin/kbackupfabric/operation/BackupOperation.java | 2 +- .../com/keuin/kbackupfabric/operation/RestoreOperation.java | 2 +- src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java | 1 + .../java/com/keuin/kbackupfabric/util/ZipUtilException.java | 10 ---------- 7 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 src/main/java/com/keuin/kbackupfabric/exception/ZipUtilException.java delete mode 100644 src/main/java/com/keuin/kbackupfabric/util/ZipUtilException.java (limited to 'src') diff --git a/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java b/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java index 674ac0c..b223e3f 100644 --- a/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java +++ b/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java @@ -10,8 +10,8 @@ import net.minecraft.server.command.ServerCommandSource; public final class KBCommandRegister { // First make method to register public static void registerCommands(CommandDispatcher dispatcher) { - // register /kb and /kb help for help menu + // register /kb and /kb help for help menu dispatcher.register(CommandManager.literal("kb").executes(KBCommands::kb)); dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("help").executes(KBCommands::help))); diff --git a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java index dea79e7..4308a2d 100644 --- a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java +++ b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java @@ -36,7 +36,6 @@ public final class KBPluginEvents implements ModInitializer, ServerStartCallback @Override public void onStartServer(MinecraftServer server) { - PrintUtil.debug("Initializing ..."); // Initialize player manager reference PrintUtil.setPlayerManager(server.getPlayerManager()); @@ -71,5 +70,7 @@ public final class KBPluginEvents implements ModInitializer, ServerStartCallback } } catch (IOException | ClassNotFoundException ignored) { } + + PrintUtil.info("Started."); } } diff --git a/src/main/java/com/keuin/kbackupfabric/exception/ZipUtilException.java b/src/main/java/com/keuin/kbackupfabric/exception/ZipUtilException.java new file mode 100644 index 0000000..c23ce26 --- /dev/null +++ b/src/main/java/com/keuin/kbackupfabric/exception/ZipUtilException.java @@ -0,0 +1,10 @@ +package com.keuin.kbackupfabric.exception; + +public class ZipUtilException extends Exception { + public ZipUtilException() { + } + + public ZipUtilException(String gripe) { + super(gripe); + } +} diff --git a/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java b/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java index 7d3a508..bceca40 100644 --- a/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java +++ b/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java @@ -4,7 +4,7 @@ import com.keuin.kbackupfabric.metadata.BackupMetadata; import com.keuin.kbackupfabric.operation.abstracts.InvokableAsyncBlockingOperation; import com.keuin.kbackupfabric.util.PrintUtil; import com.keuin.kbackupfabric.util.ZipUtil; -import com.keuin.kbackupfabric.util.ZipUtilException; +import com.keuin.kbackupfabric.exception.ZipUtilException; import com.mojang.brigadier.context.CommandContext; import net.minecraft.server.MinecraftServer; import net.minecraft.server.command.ServerCommandSource; diff --git a/src/main/java/com/keuin/kbackupfabric/operation/RestoreOperation.java b/src/main/java/com/keuin/kbackupfabric/operation/RestoreOperation.java index cc19627..42003db 100644 --- a/src/main/java/com/keuin/kbackupfabric/operation/RestoreOperation.java +++ b/src/main/java/com/keuin/kbackupfabric/operation/RestoreOperation.java @@ -3,7 +3,7 @@ package com.keuin.kbackupfabric.operation; import com.keuin.kbackupfabric.operation.abstracts.InvokableBlockingOperation; import com.keuin.kbackupfabric.util.PrintUtil; import com.keuin.kbackupfabric.util.ZipUtil; -import com.keuin.kbackupfabric.util.ZipUtilException; +import com.keuin.kbackupfabric.exception.ZipUtilException; import com.mojang.brigadier.context.CommandContext; import net.minecraft.server.MinecraftServer; import net.minecraft.server.command.ServerCommandSource; diff --git a/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java b/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java index ee2907e..11b912e 100644 --- a/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java +++ b/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java @@ -1,5 +1,6 @@ package com.keuin.kbackupfabric.util; +import com.keuin.kbackupfabric.exception.ZipUtilException; import com.keuin.kbackupfabric.metadata.BackupMetadata; import java.io.*; diff --git a/src/main/java/com/keuin/kbackupfabric/util/ZipUtilException.java b/src/main/java/com/keuin/kbackupfabric/util/ZipUtilException.java deleted file mode 100644 index b31272d..0000000 --- a/src/main/java/com/keuin/kbackupfabric/util/ZipUtilException.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.keuin.kbackupfabric.util; - -public class ZipUtilException extends Exception { - public ZipUtilException() { - } - - public ZipUtilException(String gripe) { - super(gripe); - } -} -- cgit v1.2.3