diff --git a/client/cpw/mods/fml/client/FMLClientHandler.java b/client/cpw/mods/fml/client/FMLClientHandler.java index b390dd5ba4..92ae980a54 100644 --- a/client/cpw/mods/fml/client/FMLClientHandler.java +++ b/client/cpw/mods/fml/client/FMLClientHandler.java @@ -230,9 +230,7 @@ public class FMLClientHandler implements IFMLSidedHandler { if (client.field_6324_e != null) { FMLCommonHandler.instance().worldTickStart(); - if (client.field_6313_p !=null) { - FMLCommonHandler.instance().tickStart(TickType.WORLDGUI, 0.0f, client.field_6313_p); - } + FMLCommonHandler.instance().tickStart(TickType.WORLDGUI, 0.0f, client.field_6313_p); } } @@ -243,12 +241,18 @@ public class FMLClientHandler implements IFMLSidedHandler { if (client.field_6324_e != null) { FMLCommonHandler.instance().worldTickEnd(); - if (client.field_6313_p!=null) { - FMLCommonHandler.instance().tickEnd(TickType.WORLDGUI, 0.0f, client.field_6313_p); - } + FMLCommonHandler.instance().tickEnd(TickType.WORLDGUI, 0.0f, client.field_6313_p); } } + public void onWorldLoadTick() + { + if (client.field_6324_e != null) { + FMLCommonHandler.instance().tickStart(TickType.WORLDLOADTICK); + FMLCommonHandler.instance().tickStart(TickType.GUILOADTICK); + } + } + public void onRenderTickStart(float partialTickTime) { if (client.field_6324_e != null) { @@ -257,11 +261,8 @@ public class FMLClientHandler implements IFMLSidedHandler loadTextures(fallbackTexturePack); firstTick = false; } - FMLCommonHandler.instance().tickStart(TickType.RENDER, partialTickTime); - if (client.field_6324_e!=null) - { - FMLCommonHandler.instance().tickStart(TickType.GUI, partialTickTime, client.field_6313_p); - } + FMLCommonHandler.instance().tickStart(TickType.RENDER, partialTickTime); + FMLCommonHandler.instance().tickStart(TickType.GUI, partialTickTime, client.field_6313_p); } } @@ -269,9 +270,7 @@ public class FMLClientHandler implements IFMLSidedHandler { if (client.field_6324_e != null) { FMLCommonHandler.instance().tickEnd(TickType.RENDER, partialTickTime); - if (client.field_6324_e!=null) { - FMLCommonHandler.instance().tickEnd(TickType.GUI, partialTickTime, client.field_6313_p); - } + FMLCommonHandler.instance().tickEnd(TickType.GUI, partialTickTime, client.field_6313_p); } } /** diff --git a/client/net/minecraft/src/BaseMod.java b/client/net/minecraft/src/BaseMod.java index 09641e9b16..179f2d49e4 100644 --- a/client/net/minecraft/src/BaseMod.java +++ b/client/net/minecraft/src/BaseMod.java @@ -42,6 +42,10 @@ public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDisp return onTickInGame((Float) data[0], mc); } else if (((tickEnd && tick==TickType.WORLDGUI) || (tickEnd && tick==TickType.GUI))) { return onTickInGUI((Float) data[0], mc, (GuiScreen)data[1]); + } else if (tick == TickType.WORLDLOADTICK) { + return onTickInGame(0.0f, mc); + } else if (tick == TickType.GUILOADTICK) { + return onTickInGUI(0.0f, mc, mc.field_6313_p); } return true; } diff --git a/common/cpw/mods/fml/common/ModContainer.java b/common/cpw/mods/fml/common/ModContainer.java index 414137e898..a58bba0fdc 100644 --- a/common/cpw/mods/fml/common/ModContainer.java +++ b/common/cpw/mods/fml/common/ModContainer.java @@ -14,6 +14,7 @@ package cpw.mods.fml.common; import java.io.File; +import java.util.EnumSet; import java.util.List; import java.util.Map; @@ -206,17 +207,19 @@ public interface ModContainer IPlayerTracker getPlayerTracker(); public enum TickType { - WORLD, RENDER, GUI, WORLDGUI; + WORLD, RENDER, GUI, WORLDGUI,WORLDLOADTICK, GUILOADTICK; /** * @return */ - public TickType partnerTick() + public EnumSet partnerTicks() { - if (this==WORLD) return RENDER; - if (this==RENDER) return WORLD; - if (this==GUI) return WORLDGUI; - if (this==WORLDGUI) return GUI; + if (this==WORLD) return EnumSet.of(RENDER,WORLDLOADTICK); + if (this==RENDER) return EnumSet.of(WORLD, WORLDLOADTICK); + if (this==GUI) return EnumSet.of(WORLDGUI, GUILOADTICK); + if (this==WORLDGUI) return EnumSet.of(GUI, GUILOADTICK); + if (this==WORLDLOADTICK) return EnumSet.of(WORLD, RENDER); + if (this==GUILOADTICK) return EnumSet.of(GUI, WORLDGUI); return null; } } diff --git a/common/cpw/mods/fml/common/modloader/ModLoaderHelper.java b/common/cpw/mods/fml/common/modloader/ModLoaderHelper.java index 2beb47e64d..e6c2f5048a 100644 --- a/common/cpw/mods/fml/common/modloader/ModLoaderHelper.java +++ b/common/cpw/mods/fml/common/modloader/ModLoaderHelper.java @@ -46,6 +46,10 @@ public class ModLoaderHelper } else { ticks.remove(TickType.WORLD); } + + if (enable) { + ticks.add(TickType.WORLDLOADTICK); + } } public static void updateGUITicks(BaseMod mod, boolean enable, boolean useClock) @@ -64,6 +68,9 @@ public class ModLoaderHelper } else { ticks.remove(TickType.WORLDGUI); } + if (enable) { + ticks.add(TickType.GUILOADTICK); + } } /** diff --git a/common/cpw/mods/fml/common/modloader/ModLoaderModContainer.java b/common/cpw/mods/fml/common/modloader/ModLoaderModContainer.java index cd4b27a824..caa85f06cf 100644 --- a/common/cpw/mods/fml/common/modloader/ModLoaderModContainer.java +++ b/common/cpw/mods/fml/common/modloader/ModLoaderModContainer.java @@ -332,7 +332,7 @@ public class ModLoaderModContainer implements ModContainer boolean keepTicking=mod.doTickInGame(tick, false, FMLCommonHandler.instance().getMinecraftInstance(), data); if (!keepTicking) { ticks.remove(tick); - ticks.remove(tick.partnerTick()); + ticks.removeAll(tick.partnerTicks()); } } } @@ -344,7 +344,7 @@ public class ModLoaderModContainer implements ModContainer boolean keepTicking=mod.doTickInGame(tick, true, FMLCommonHandler.instance().getMinecraftInstance(), data); if (!keepTicking) { ticks.remove(tick); - ticks.remove(tick.partnerTick()); + ticks.removeAll(tick.partnerTicks()); } } } diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index 8e2afba00e..7cae1bfaab 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -55,7 +55,15 @@ this.field_6287_N = System.currentTimeMillis(); } -@@ -2250,7 +2260,11 @@ +@@ -1985,6 +1995,7 @@ + + System.gc(); + this.field_6287_N = 0L; ++ FMLClientHandler.instance().onWorldLoadTick(); + } + + private void func_22002_b(String p_22002_1_, String p_22002_2_) +@@ -2250,7 +2261,11 @@ { var2 = p_main_0_[1]; }