Fix up tick management outside of mod loading phases for ModLoader mods.
This commit is contained in:
parent
5197e98fb1
commit
17d1f1f157
|
@ -32,6 +32,7 @@ import net.minecraft.src.IAnimals;
|
||||||
import net.minecraft.src.ICommand;
|
import net.minecraft.src.ICommand;
|
||||||
import net.minecraft.src.TradeEntry;
|
import net.minecraft.src.TradeEntry;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.common.FMLLog;
|
||||||
import cpw.mods.fml.common.ICraftingHandler;
|
import cpw.mods.fml.common.ICraftingHandler;
|
||||||
import cpw.mods.fml.common.IDispenseHandler;
|
import cpw.mods.fml.common.IDispenseHandler;
|
||||||
import cpw.mods.fml.common.IDispenserHandler;
|
import cpw.mods.fml.common.IDispenserHandler;
|
||||||
|
@ -63,7 +64,12 @@ public class ModLoaderHelper
|
||||||
|
|
||||||
public static void updateStandardTicks(BaseModProxy mod, boolean enable, boolean useClock)
|
public static void updateStandardTicks(BaseModProxy mod, boolean enable, boolean useClock)
|
||||||
{
|
{
|
||||||
ModLoaderModContainer mlmc = (ModLoaderModContainer) Loader.instance().activeModContainer();
|
ModLoaderModContainer mlmc = (ModLoaderModContainer) Loader.instance().getReversedModObjectList().get(mod);
|
||||||
|
if (mlmc==null)
|
||||||
|
{
|
||||||
|
FMLLog.severe("Attempted to register ModLoader ticking for invalid BaseMod %s",mod);
|
||||||
|
return;
|
||||||
|
}
|
||||||
BaseModTicker ticker = mlmc.getGameTickHandler();
|
BaseModTicker ticker = mlmc.getGameTickHandler();
|
||||||
EnumSet<TickType> ticks = ticker.ticks();
|
EnumSet<TickType> ticks = ticker.ticks();
|
||||||
// If we're enabled we get render ticks
|
// If we're enabled we get render ticks
|
||||||
|
@ -84,7 +90,12 @@ public class ModLoaderHelper
|
||||||
|
|
||||||
public static void updateGUITicks(BaseModProxy mod, boolean enable, boolean useClock)
|
public static void updateGUITicks(BaseModProxy mod, boolean enable, boolean useClock)
|
||||||
{
|
{
|
||||||
ModLoaderModContainer mlmc = (ModLoaderModContainer) Loader.instance().activeModContainer();
|
ModLoaderModContainer mlmc = (ModLoaderModContainer) Loader.instance().getReversedModObjectList().get(mod);
|
||||||
|
if (mlmc==null)
|
||||||
|
{
|
||||||
|
FMLLog.severe("Attempted to register ModLoader ticking for invalid BaseMod %s",mod);
|
||||||
|
return;
|
||||||
|
}
|
||||||
EnumSet<TickType> ticks = mlmc.getGUITickHandler().ticks();
|
EnumSet<TickType> ticks = mlmc.getGUITickHandler().ticks();
|
||||||
// If we're enabled and we don't want clock ticks we get render ticks
|
// If we're enabled and we don't want clock ticks we get render ticks
|
||||||
if (enable && !useClock) {
|
if (enable && !useClock) {
|
||||||
|
|
Loading…
Reference in New Issue