added datapacks to the profiler
This commit is contained in:
1 parent
1c1fb5eb59
commit
f1b1538bcf
4 files changed
+30
-3
No files matched your search
+2
-2
@@ -5,8 +5,8 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
# check these on https://fabricmc.net/use
|
# check these on https://fabricmc.net/use
|
||||||
# or better: https://modmuss50.me/fabric.html
|
# or better: https://modmuss50.me/fabric.html
|
||||||
minecraft_version=1.16.3
|
minecraft_version=1.16.3
|
||||||
yarn_mappings=1.16.3+build.18
|
yarn_mappings=1.16.3+build.30
|
||||||
loader_version=0.10.0+build.208
|
loader_version=0.10.1+build.209
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.4.12+v201001
|
mod_version = 1.4.12+v201001
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.utils.CarpetProfiler;
|
||||||
|
import net.minecraft.server.function.CommandFunctionManager;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(CommandFunctionManager.class)
|
||||||
|
public class CommandFunctionManager_tickMixin
|
||||||
|
{
|
||||||
|
CarpetProfiler.ProfilerToken currentSection;
|
||||||
|
|
||||||
|
@Inject(method = "tick", at = @At("HEAD"))
|
||||||
|
private void beforeDatapacks(CallbackInfo ci)
|
||||||
|
{
|
||||||
|
currentSection = CarpetProfiler.start_section(null, "Datapacks", CarpetProfiler.TYPE.GENERAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "tick", at = @At("RETURN"))
|
||||||
|
private void afterDatapacks(CallbackInfo ci)
|
||||||
|
{
|
||||||
|
CarpetProfiler.end_current_section(currentSection);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,7 +22,7 @@ public class CarpetProfiler
|
|||||||
private static int tick_health_elapsed = 0;
|
private static int tick_health_elapsed = 0;
|
||||||
private static TYPE test_type = TYPE.NONE; //1 for ticks, 2 for entities;
|
private static TYPE test_type = TYPE.NONE; //1 for ticks, 2 for entities;
|
||||||
private static long current_tick_start = 0;
|
private static long current_tick_start = 0;
|
||||||
private static final String[] GENERAL_SECTIONS = {"Network", "Autosave", "Async Tasks"};
|
private static final String[] GENERAL_SECTIONS = {"Network", "Autosave", "Async Tasks", "Datapacks",};
|
||||||
private static final String[] SECTIONS = {
|
private static final String[] SECTIONS = {
|
||||||
"Spawning and Random Ticks", "Ticket Manager","Unloading",
|
"Spawning and Random Ticks", "Ticket Manager","Unloading",
|
||||||
"Blocks", "Entities", "Block Entities",
|
"Blocks", "Entities", "Block Entities",
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
"ServerChunkManager_tickMixin",
|
"ServerChunkManager_tickMixin",
|
||||||
"ThreadedAnvilChunkStorage_tickMixin",
|
"ThreadedAnvilChunkStorage_tickMixin",
|
||||||
"ChunkTicketManager_tickMixin",
|
"ChunkTicketManager_tickMixin",
|
||||||
|
"CommandFunctionManager_tickMixin",
|
||||||
|
|
||||||
"ThreadedAnvilChunkStorage_scarpetChunkCreationMixin",
|
"ThreadedAnvilChunkStorage_scarpetChunkCreationMixin",
|
||||||
"ChunkHolder_scarpetChunkCreationMixin",
|
"ChunkHolder_scarpetChunkCreationMixin",
|
||||||
|
|||||||
Reference in new issue
Block a user