Profile categories splitting and descriptions. (#1375)
* Split spawning and random ticks into separate categories * Split blocks into tile ticks and block events * Fix ambiguous call to tick() method Fix package private warning * fix: add missing sections for tile ticks and block events * fix: wrong profiling order * feat: add descriptions to profiler categories * refactor: replace guava ImmutableMap with jdk Map * fix negative time in "rest" category
This commit is contained in:
1 parent
4662a86121
commit
544c1a8327
4 files changed
+135
-57
No files matched your search
@@ -15,16 +15,16 @@ import net.minecraft.server.level.ServerLevel;
|
||||
@Mixin(ChunkMap.class)
|
||||
public class ChunkMap_tickMixin
|
||||
{
|
||||
@Shadow @Final private ServerLevel level;
|
||||
@Shadow @Final ServerLevel level;
|
||||
CarpetProfiler.ProfilerToken currentSection;
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"))
|
||||
@Inject(method = "tick(Ljava/util/function/BooleanSupplier;)V", at = @At("HEAD"))
|
||||
private void startProfilerSection(BooleanSupplier booleanSupplier_1, CallbackInfo ci)
|
||||
{
|
||||
currentSection = CarpetProfiler.start_section(level, "Unloading", CarpetProfiler.TYPE.GENERAL);
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At("RETURN"))
|
||||
@Inject(method = "tick(Ljava/util/function/BooleanSupplier;)V", at = @At("RETURN"))
|
||||
private void stopProfilerSecion(BooleanSupplier booleanSupplier_1, CallbackInfo ci)
|
||||
{
|
||||
if (currentSection != null)
|
||||
@@ -32,7 +32,4 @@ public class ChunkMap_tickMixin
|
||||
CarpetProfiler.end_current_section(currentSection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user