From 19ad8cfbf3a0d92eb0d133eaf4fb15bf808034d7 Mon Sep 17 00:00:00 2001 From: gnembon Date: Sat, 24 Jul 2021 22:40:33 -0300 Subject: [PATCH] Mixin mixup, borken profiler sections. Fixes #1027 --- .../carpet/mixins/ServerWorld_tickMixin.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/java/carpet/mixins/ServerWorld_tickMixin.java b/src/main/java/carpet/mixins/ServerWorld_tickMixin.java index 1ac73b71..e3c5445d 100644 --- a/src/main/java/carpet/mixins/ServerWorld_tickMixin.java +++ b/src/main/java/carpet/mixins/ServerWorld_tickMixin.java @@ -79,18 +79,27 @@ public abstract class ServerWorld_tickMixin extends World currentSection = CarpetProfiler.start_section((World) (Object) this, "Village", CarpetProfiler.TYPE.GENERAL); } } + @Inject(method = "tick", at = @At( + value = "CONSTANT", + args = "stringValue=chunkSource" + )) + private void stopVillageSection(BooleanSupplier booleanSupplier_1, CallbackInfo ci) + { + if (currentSection != null) + { + CarpetProfiler.end_current_section(currentSection); + currentSection = null; + } + } + @Inject(method = "tick", at = @At( value = "CONSTANT", args = "stringValue=blockEvents" )) - private void stopVillageStartBlockAgainSection(BooleanSupplier booleanSupplier_1, CallbackInfo ci) + private void startBlockAgainSection(BooleanSupplier booleanSupplier_1, CallbackInfo ci) { - if (currentSection != null) - { - CarpetProfiler.end_current_section(currentSection); - currentSection = CarpetProfiler.start_section((World) (Object) this, "Blocks", CarpetProfiler.TYPE.GENERAL); - } + currentSection = CarpetProfiler.start_section((World) (Object) this, "Blocks", CarpetProfiler.TYPE.GENERAL); } @Inject(method = "tick", at = @At(