mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-22 05:02:17 +00:00
Added activate/desactivate everywhere the old ProfilerRegistrar was called.
This commit is contained in:
1 parent
a9f4f7bea6
commit
812a9e29f5
7 files changed
+18
-3
No files matched your search
@@ -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)));
|
||||
|
||||
@@ -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.")));
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
@@ -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)));
|
||||
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
|
||||
@@ -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:{
|
||||
|
||||
Reference in new issue
Block a user