From a87d0451c8f850538f8a534b659ad749b601fd3e Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 22 Aug 2012 15:11:43 -0400 Subject: [PATCH] Add in a helper on the server start event for adding commands to the server. --- .../cpw/mods/fml/common/event/FMLServerStartingEvent.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/cpw/mods/fml/common/event/FMLServerStartingEvent.java b/common/cpw/mods/fml/common/event/FMLServerStartingEvent.java index 9cfec4b728..d9c8ff6e5b 100644 --- a/common/cpw/mods/fml/common/event/FMLServerStartingEvent.java +++ b/common/cpw/mods/fml/common/event/FMLServerStartingEvent.java @@ -1,6 +1,8 @@ package cpw.mods.fml.common.event; import net.minecraft.server.MinecraftServer; +import net.minecraft.src.CommandHandler; +import net.minecraft.src.ICommand; import cpw.mods.fml.common.LoaderState.ModState; public class FMLServerStartingEvent extends FMLStateEvent @@ -23,4 +25,10 @@ public class FMLServerStartingEvent extends FMLStateEvent { return server; } + + public void registerServerCommand(ICommand command) + { + CommandHandler ch = (CommandHandler) getServer().func_71187_D(); + ch.func_71560_a(command); + } }