Skip to content

Commit

Permalink
Use FMLServerStartingEvent to register command
Browse files Browse the repository at this point in the history
Conflicts:
	build.gradle
	src/main/java/ljfa/tntutils/TNTUtils.java
  • Loading branch information
ljfa-ag committed May 7, 2016
1 parent 9d12565 commit 87283eb
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/java/ljfa/tntutils/TNTUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
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.FMLServerStartedEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import ljfa.tntutils.command.CommandExplosion;
import ljfa.tntutils.proxy.CommonProxy;
import net.minecraft.command.ServerCommandManager;
import net.minecraft.server.MinecraftServer;

@Mod(modid = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION, acceptableRemoteVersions = "*",
guiFactory = Reference.GUI_FACTORY_CLASS, dependencies = "required-after:tnt_utilities_core")
Expand Down Expand Up @@ -46,11 +44,9 @@ public void postInit(FMLPostInitializationEvent event) {
}

@Mod.EventHandler
public void serverStarted(FMLServerStartedEvent event) {
public void serverStarting(FMLServerStartingEvent event) {
if(Config.explosionCommand) {
MinecraftServer server = MinecraftServer.getServer();
ServerCommandManager commandManager = (ServerCommandManager)server.getCommandManager();
commandManager.registerCommand(new CommandExplosion());
event.registerServerCommand(new CommandExplosion());
}
}
}

0 comments on commit 87283eb

Please sign in to comment.