From 9b281f0a3c3322985037e166fd6e528af2327fc3 Mon Sep 17 00:00:00 2001 From: Christian Weeks Date: Mon, 14 May 2012 11:38:54 -0400 Subject: [PATCH] Fix millinaire support. Fix Portal eating rendering time. add in profile visibility for mod stuff. --- client/cpw/mods/fml/client/FMLClientHandler.java | 11 +++++++++++ client/net/minecraft/src/ModLoader.java | 3 ++- common/cpw/mods/fml/common/FMLCommonHandler.java | 16 ++++++++++++++++ common/cpw/mods/fml/common/IFMLSidedHandler.java | 2 ++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/client/cpw/mods/fml/client/FMLClientHandler.java b/client/cpw/mods/fml/client/FMLClientHandler.java index 90d758a6d6..dedf41f497 100644 --- a/client/cpw/mods/fml/client/FMLClientHandler.java +++ b/client/cpw/mods/fml/client/FMLClientHandler.java @@ -51,6 +51,7 @@ import net.minecraft.src.Packet; import net.minecraft.src.Packet1Login; import net.minecraft.src.Packet250CustomPayload; import net.minecraft.src.Packet3Chat; +import net.minecraft.src.Profiler; import net.minecraft.src.Render; import net.minecraft.src.RenderBlocks; import net.minecraft.src.RenderEngine; @@ -829,4 +830,14 @@ public class FMLClientHandler implements IFMLSidedHandler } animationSet.add(info); } + + @Override + public void profileStart(String profileLabel) { + Profiler.func_40663_a(profileLabel); + } + + @Override + public void profileEnd() { + Profiler.func_40662_b(); + } } diff --git a/client/net/minecraft/src/ModLoader.java b/client/net/minecraft/src/ModLoader.java index 26bc93a636..4b099a3304 100644 --- a/client/net/minecraft/src/ModLoader.java +++ b/client/net/minecraft/src/ModLoader.java @@ -34,7 +34,8 @@ import cpw.mods.fml.common.modloader.ModLoaderModContainer; public class ModLoader { // TODO dirty workaround for millinaire - public static final Map> languageProperties=Collections.emptyMap(); + @Deprecated + public static final Map> localizedStrings=Collections.emptyMap(); /** * Not used on the server. * diff --git a/common/cpw/mods/fml/common/FMLCommonHandler.java b/common/cpw/mods/fml/common/FMLCommonHandler.java index 72fb5ceccf..991b10d0e6 100644 --- a/common/cpw/mods/fml/common/FMLCommonHandler.java +++ b/common/cpw/mods/fml/common/FMLCommonHandler.java @@ -108,26 +108,42 @@ public class FMLCommonHandler public void tickStart(TickType type, Object ... data) { + sidedDelegate.profileStart("modTickStart"); + sidedDelegate.profileStart(type.name()); for (ModContainer mod : Loader.getModList()) { + sidedDelegate.profileStart(mod.getName()); mod.tickStart(type, data); + sidedDelegate.profileEnd(); } for (ModContainer mod : auxilliaryContainers) { + sidedDelegate.profileStart(mod.getMod().getClass().getSimpleName()); mod.tickStart(type, data); + sidedDelegate.profileEnd(); } + sidedDelegate.profileEnd(); + sidedDelegate.profileEnd(); } public void tickEnd(TickType type, Object ... data) { + sidedDelegate.profileStart("modTickEnd"); + sidedDelegate.profileStart(type.name()); for (ModContainer mod : Loader.getModList()) { + sidedDelegate.profileStart(mod.getName()); mod.tickEnd(type, data); + sidedDelegate.profileEnd(); } for (ModContainer mod : auxilliaryContainers) { + sidedDelegate.profileStart(mod.getMod().getClass().getSimpleName()); mod.tickEnd(type, data); + sidedDelegate.profileEnd(); } + sidedDelegate.profileEnd(); + sidedDelegate.profileEnd(); } public List gatherKeyBindings() { diff --git a/common/cpw/mods/fml/common/IFMLSidedHandler.java b/common/cpw/mods/fml/common/IFMLSidedHandler.java index bf33364d98..d02a8f71df 100644 --- a/common/cpw/mods/fml/common/IFMLSidedHandler.java +++ b/common/cpw/mods/fml/common/IFMLSidedHandler.java @@ -18,4 +18,6 @@ public interface IFMLSidedHandler Properties getCurrentLanguageTable(); String getObjectName(Object minecraftObject); ModMetadata readMetadataFrom(InputStream input, ModContainer mod) throws Exception; + void profileStart(String profileLabel); + void profileEnd(); }