summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2014-11-03 20:56:35 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2014-11-03 20:56:35 +0000
commitf0dd7be56a979910580db1210ad6058f9ce38457 (patch)
tree0a0d6720e505e8e789ead83df202cf64766cfe39
parentd7ad92712e7cf59806ef04b31935eace33d89046 (diff)
downloadnoctis-f0dd7be56a979910580db1210ad6058f9ce38457.tar.bz2
Fix time command so Noctis doesn't lose days
-rw-r--r--src/main/java/net/flarn/noctis/Noctis.java7
-rw-r--r--src/main/java/net/flarn/noctis/commands/CommandTimeFixed.java9
2 files changed, 6 insertions, 10 deletions
diff --git a/src/main/java/net/flarn/noctis/Noctis.java b/src/main/java/net/flarn/noctis/Noctis.java
index 403130e..1b5d622 100644
--- a/src/main/java/net/flarn/noctis/Noctis.java
+++ b/src/main/java/net/flarn/noctis/Noctis.java
@@ -6,6 +6,7 @@ import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import net.flarn.noctis.client.gui.GuiHandler;
@@ -46,7 +47,6 @@ public class Noctis {
Recipes.init();
Recipes.initCatalysedRecipes();
NetworkRegistry.INSTANCE.registerGuiHandler(Noctis.instance, new GuiHandler());
- CommandTimeFixed.registerReplacementCommand();
}
@Mod.EventHandler
@@ -57,4 +57,9 @@ public class Noctis {
}
}
+ @Mod.EventHandler
+ public void serverLoad(FMLServerStartingEvent event) {
+ event.registerServerCommand(new CommandTimeFixed());
+ }
+
}
diff --git a/src/main/java/net/flarn/noctis/commands/CommandTimeFixed.java b/src/main/java/net/flarn/noctis/commands/CommandTimeFixed.java
index cd5df63..da99506 100644
--- a/src/main/java/net/flarn/noctis/commands/CommandTimeFixed.java
+++ b/src/main/java/net/flarn/noctis/commands/CommandTimeFixed.java
@@ -28,13 +28,4 @@ public class CommandTimeFixed extends CommandTime {
}
}
- public static void registerReplacementCommand() {
- CommandHandler cm = (CommandHandler)FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager();
- if (cm == null) {
- LogHelper.warn("Unable to register replacement time command, server does not have usable command manager.");
- } else {
- cm.registerCommand(new CommandTimeFixed());
- }
- }
-
}