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
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user