A proper console command handler, also fix ordering of loaded mods

This commit is contained in:
Christian Weeks committed 2012-04-08 09:55:56 -04:00
1 parent b0774b89c7
commit 05ff62d85f
5 files changed
+18 -17

No files matched your search

@@ -26,6 +26,7 @@ import net.minecraft.src.CommonRegistry;
import net.minecraft.src.EntityItem;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.ICommandListener;
import net.minecraft.src.IInventory;
import net.minecraft.src.ItemStack;
import net.minecraft.src.NetworkManager;
@@ -445,10 +446,10 @@ public class FMLServerHandler implements IFMLSidedHandler
* @param var2
* @return
*/
public boolean handleServerCommand(String command)
public boolean handleServerCommand(String command, String player, ICommandListener listener)
{
for (ModContainer mod : Loader.getModList()) {
if (mod.wantsConsoleCommands() && mod.getConsoleHandler().handleCommand(command)) {
if (mod.wantsConsoleCommands() && mod.getConsoleHandler().handleCommand(command, player, listener)) {
return true;
}
}
@@ -450,7 +450,7 @@ public class ModLoaderModContainer implements ModContainer
}
@Override
public List<String> getPreDepends()
public List<String> getPostDepends()
{
if (dependencies == null)
{
@@ -461,7 +461,7 @@ public class ModLoaderModContainer implements ModContainer
}
@Override
public List<String> getPostDepends()
public List<String> getPreDepends()
{
if (dependencies == null)
{
+11 -11
View File
@@ -84,19 +84,10 @@ public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDisp
}
@Override
public final boolean handleCommand(String command)
public final boolean handleCommand(String command, Object... data)
{
return onServerCommand(command);
return onServerCommand(command, (String)data[0], (ICommandListener)data[1]);
}
/**
* @param command
* @return
*/
private boolean onServerCommand(String command)
{
return false;
}
// BASEMOD API
/**
* Override if you wish to provide a fuel item for the furnace and return the fuel value of the item
@@ -281,6 +272,15 @@ public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDisp
{
return false;
}
/**
* @param command
* @return
*/
public boolean onServerCommand(String command, String sender, ICommandListener listener)
{
return false;
}
// Spare client junk
// -------
// void addRenderer(Map<Class<? extends Entity>, Render> renderers);