From e1daf58d429f68e8af420966ed3cee68d57d1211 Mon Sep 17 00:00:00 2001 From: MulverineX Date: Wed, 7 Oct 2026 18:36:00 -0600 Subject: [PATCH 1/2] Add logging for passing tests --- .../packtest/mixin/LogTestReporterMixin.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/io/github/misode/packtest/mixin/LogTestReporterMixin.java b/src/main/java/io/github/misode/packtest/mixin/LogTestReporterMixin.java index 9a9f80d..dd226b0 100644 --- a/src/main/java/io/github/misode/packtest/mixin/LogTestReporterMixin.java +++ b/src/main/java/io/github/misode/packtest/mixin/LogTestReporterMixin.java @@ -1,8 +1,11 @@ package io.github.misode.packtest.mixin; import io.github.misode.packtest.PackTestException; +import io.github.misode.packtest.PackTestFunction; +import io.github.misode.packtest.PackTestLibrary; import io.github.misode.packtest.PackTest; import net.minecraft.util.Util; +import net.minecraft.core.BlockPos; import net.minecraft.gametest.framework.GameTestInfo; import net.minecraft.gametest.framework.LogTestReporter; import org.slf4j.Logger; @@ -46,4 +49,15 @@ private void onTestFailed(GameTestInfo testInfo, CallbackInfo ci) { ci.cancel(); } } + + @SuppressWarnings("DataFlowIssue") + @Inject(method = "onTestSuccess", at = @At(value = "HEAD"), cancellable = true) + private void onTestSuccess(GameTestInfo testInfo, CallbackInfo ci) { + BlockPos blockPos = testInfo.getTestBlockPos(); + if (blockPos == null) { + LOGGER.info("{} passed on tick {}!" , testInfo.id(), testInfo.getTick()); + } else { + LOGGER.info("{} passed at {} on tick {}!" , testInfo.id(), blockPos.toShortString(), testInfo.getTick()); + } + } } From 88ae2845a228fe9e6630e6e4978dcea1ae29d905 Mon Sep 17 00:00:00 2001 From: MulverineX Date: Thu, 8 Oct 2026 15:47:41 -0600 Subject: [PATCH 2/2] Clean up unnecessary mixin code --- .../io/github/misode/packtest/mixin/LogTestReporterMixin.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/io/github/misode/packtest/mixin/LogTestReporterMixin.java b/src/main/java/io/github/misode/packtest/mixin/LogTestReporterMixin.java index dd226b0..8104b58 100644 --- a/src/main/java/io/github/misode/packtest/mixin/LogTestReporterMixin.java +++ b/src/main/java/io/github/misode/packtest/mixin/LogTestReporterMixin.java @@ -50,8 +50,7 @@ private void onTestFailed(GameTestInfo testInfo, CallbackInfo ci) { } } - @SuppressWarnings("DataFlowIssue") - @Inject(method = "onTestSuccess", at = @At(value = "HEAD"), cancellable = true) + @Inject(method = "onTestSuccess", at = @At(value = "HEAD")) private void onTestSuccess(GameTestInfo testInfo, CallbackInfo ci) { BlockPos blockPos = testInfo.getTestBlockPos(); if (blockPos == null) {