diff --git a/mcp/mobius/opis/commands/server/CommandStart.java b/mcp/mobius/opis/commands/server/CommandStart.java index 98a5c9e..a6f951c 100644 --- a/mcp/mobius/opis/commands/server/CommandStart.java +++ b/mcp/mobius/opis/commands/server/CommandStart.java @@ -27,6 +27,7 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.util.ChatMessageComponent; import mcp.mobius.mobiuscore.profiler.ProfilerRegistrar; +import mcp.mobius.mobiuscore.profiler_v2.ProfilerSection; public class CommandStart extends CommandBase implements IOpisCommand { @@ -55,6 +56,7 @@ public class CommandStart extends CommandBase implements IOpisCommand { MetaManager.reset(); modOpis.profilerRun = true; ProfilerRegistrar.turnOn(); + ProfilerSection.activateAll(); OpisPacketHandler.sendPacketToAllSwing(NetDataValue.create(Message.STATUS_START, new SerialInt(modOpis.profilerMaxTicks))); icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oOpis started with a tick delay %s.", modOpis.profilerDelay))); diff --git a/mcp/mobius/opis/commands/server/CommandStop.java b/mcp/mobius/opis/commands/server/CommandStop.java index c4e4334..d6000c6 100644 --- a/mcp/mobius/opis/commands/server/CommandStop.java +++ b/mcp/mobius/opis/commands/server/CommandStop.java @@ -17,6 +17,7 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.util.ChatMessageComponent; import mcp.mobius.mobiuscore.profiler.ProfilerRegistrar; +import mcp.mobius.mobiuscore.profiler_v2.ProfilerSection; public class CommandStop extends CommandBase implements IOpisCommand { @@ -39,6 +40,7 @@ public class CommandStop extends CommandBase implements IOpisCommand { public void processCommand(ICommandSender icommandsender, String[] astring) { modOpis.profilerRun = false; ProfilerRegistrar.turnOff(); + ProfilerSection.desactivateAll(); icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oOpis stopped."))); } diff --git a/mcp/mobius/opis/data/managers/MetaManager.java b/mcp/mobius/opis/data/managers/MetaManager.java index 93ce502..e0faa17 100644 --- a/mcp/mobius/opis/data/managers/MetaManager.java +++ b/mcp/mobius/opis/data/managers/MetaManager.java @@ -1,6 +1,7 @@ package mcp.mobius.opis.data.managers; import mcp.mobius.mobiuscore.profiler.ProfilerRegistrar; +import mcp.mobius.mobiuscore.profiler_v2.ProfilerSection; import mcp.mobius.opis.modOpis; import mcp.mobius.opis.data.server.EntUpdateProfiler; import mcp.mobius.opis.data.server.WorldTickProfiler; @@ -20,7 +21,9 @@ public class MetaManager { GlobalTimingManager.INSTANCE.worldTickStats.clear(); GlobalTimingManager.INSTANCE.entUpdateStats.clear(); GlobalTimingManager.INSTANCE.statsDim.clear(); - ProfilerRegistrar.turnOff(); + ProfilerRegistrar.turnOff(); + + ProfilerSection.desactivateAll(); } } diff --git a/mcp/mobius/opis/events/OpisClientTickHandler.java b/mcp/mobius/opis/events/OpisClientTickHandler.java index aaa07f5..3012885 100644 --- a/mcp/mobius/opis/events/OpisClientTickHandler.java +++ b/mcp/mobius/opis/events/OpisClientTickHandler.java @@ -5,6 +5,7 @@ import java.util.logging.Level; import mcp.mobius.mobiuscore.profiler.DummyProfiler; import mcp.mobius.mobiuscore.profiler.ProfilerRegistrar; +import mcp.mobius.mobiuscore.profiler_v2.ProfilerSection; import mcp.mobius.opis.modOpis; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; @@ -36,6 +37,7 @@ public class OpisClientTickHandler implements ITickHandler { profilerRunningTicks = 0; modOpis.profilerRun = false; ProfilerRegistrar.turnOff(); + ProfilerSection.desactivateAll(); //TODO : Print something to the client chat System.out.printf("Profiling done\n"); diff --git a/mcp/mobius/opis/events/OpisServerTickHandler.java b/mcp/mobius/opis/events/OpisServerTickHandler.java index 492b265..6e5f356 100644 --- a/mcp/mobius/opis/events/OpisServerTickHandler.java +++ b/mcp/mobius/opis/events/OpisServerTickHandler.java @@ -45,6 +45,7 @@ import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; import mcp.mobius.mobiuscore.profiler.DummyProfiler; import mcp.mobius.mobiuscore.profiler.ProfilerRegistrar; +import mcp.mobius.mobiuscore.profiler_v2.ProfilerSection; public class OpisServerTickHandler implements ITickHandler { @@ -126,7 +127,8 @@ public class OpisServerTickHandler implements ITickHandler { }else if (profilerRunningTicks >= modOpis.profilerMaxTicks && modOpis.profilerRun){ profilerRunningTicks = 0; modOpis.profilerRun = false; - ProfilerRegistrar.turnOff(); + ProfilerRegistrar.turnOff(); + ProfilerSection.desactivateAll(); OpisPacketHandler.sendPacketToAllSwing(NetDataValue.create(Message.STATUS_STOP, new SerialInt(modOpis.profilerMaxTicks))); diff --git a/mcp/mobius/opis/network/ServerMessageHandler.java b/mcp/mobius/opis/network/ServerMessageHandler.java index 74ed5a1..c555ed8 100644 --- a/mcp/mobius/opis/network/ServerMessageHandler.java +++ b/mcp/mobius/opis/network/ServerMessageHandler.java @@ -11,6 +11,7 @@ import net.minecraftforge.common.DimensionManager; import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; import mcp.mobius.mobiuscore.profiler.ProfilerRegistrar; +import mcp.mobius.mobiuscore.profiler_v2.ProfilerSection; import mcp.mobius.opis.modOpis; import mcp.mobius.opis.commands.server.CommandAmountEntities; import mcp.mobius.opis.data.client.DataCache; @@ -146,6 +147,7 @@ public class ServerMessageHandler { MetaManager.reset(); modOpis.profilerRun = true; ProfilerRegistrar.turnOn(); + ProfilerSection.activateAll(); OpisPacketHandler.sendPacketToAllSwing(NetDataValue.create(Message.STATUS_START, new SerialInt(modOpis.profilerMaxTicks))); } diff --git a/mcp/mobius/opis/proxy/ProxyClient.java b/mcp/mobius/opis/proxy/ProxyClient.java index 4a08e62..8395e4e 100644 --- a/mcp/mobius/opis/proxy/ProxyClient.java +++ b/mcp/mobius/opis/proxy/ProxyClient.java @@ -10,6 +10,7 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.util.ResourceLocation; import mapwriter.api.MwAPI; import mcp.mobius.mobiuscore.profiler.ProfilerRegistrar; +import mcp.mobius.mobiuscore.profiler_v2.ProfilerSection; import mcp.mobius.opis.modOpis; import mcp.mobius.opis.api.IMessageHandler; import mcp.mobius.opis.api.MessageHandlerRegistrar; @@ -147,7 +148,8 @@ public class ProxyClient extends ProxyServer implements IMessageHandler{ modOpis.log.log(Level.INFO, "Started profiling"); MetaManager.reset(); modOpis.profilerRun = true; - ProfilerRegistrar.turnOn(); + ProfilerRegistrar.turnOn(); + ProfilerSection.activateAll(); break; } case CLIENT_SHOW_RENDER_TICK:{