Skip to content

Commit

Permalink
Use FMLServerStartingEvent to register command
Browse files Browse the repository at this point in the history
  • Loading branch information
ljfa-ag committed May 7, 2016
1 parent fa0489d commit 5f06c00
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ curseforge {
project {
id = '227449'
changelog = ''
releaseType = 'release'
releaseType = 'beta'
addGameVersion '1.8.9'
}
}
Expand Down
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 @@ -6,14 +6,12 @@

import ljfa.tntutils.command.CommandExplosion;
import ljfa.tntutils.proxy.CommonProxy;
import net.minecraft.command.ServerCommandManager;
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartedEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;

@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 @@ -47,11 +45,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());
}
}
}
7 changes: 0 additions & 7 deletions version.json

This file was deleted.

0 comments on commit 5f06c00

Please sign in to comment.