mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 01:55:06 +00:00
Add in a helper on the server start event for adding commands to
the server.
This commit is contained in:
1 parent
82e9309d27
commit
a87d0451c8
1 file changed
+8
@@ -1,6 +1,8 @@
|
|||||||
package cpw.mods.fml.common.event;
|
package cpw.mods.fml.common.event;
|
||||||
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.src.CommandHandler;
|
||||||
|
import net.minecraft.src.ICommand;
|
||||||
import cpw.mods.fml.common.LoaderState.ModState;
|
import cpw.mods.fml.common.LoaderState.ModState;
|
||||||
|
|
||||||
public class FMLServerStartingEvent extends FMLStateEvent
|
public class FMLServerStartingEvent extends FMLStateEvent
|
||||||
@@ -23,4 +25,10 @@ public class FMLServerStartingEvent extends FMLStateEvent
|
|||||||
{
|
{
|
||||||
return server;
|
return server;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void registerServerCommand(ICommand command)
|
||||||
|
{
|
||||||
|
CommandHandler ch = (CommandHandler) getServer().func_71187_D();
|
||||||
|
ch.func_71560_a(command);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user