diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e106b297..01106290b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,8 +77,6 @@ jobs: # Lock to a specific commit, it would be bad if the tag is re-pushed with unwanted changes - name: Run the MC client uses: 3arthqu4ke/mc-runtime-test@e72f8fe1134aabf6fc749a2a8c09bb56dd7d283e - env: - FLYWHEEL_AUTO_TEST: true with: mc: ${{ env.MINECRAFT_VERSION }} modloader: ${{ matrix.loader }} diff --git a/fabric/src/testMod/java/dev/engine_room/flywheel/FlywheelTestModClient.java b/fabric/src/testMod/java/dev/engine_room/flywheel/FlywheelTestModClient.java index 8e192acbf..9d833d9ec 100644 --- a/fabric/src/testMod/java/dev/engine_room/flywheel/FlywheelTestModClient.java +++ b/fabric/src/testMod/java/dev/engine_room/flywheel/FlywheelTestModClient.java @@ -1,22 +1,31 @@ package dev.engine_room.flywheel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.spongepowered.asm.mixin.MixinEnvironment; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; public class FlywheelTestModClient implements ClientModInitializer { + private static final Logger LOGGER = LoggerFactory.getLogger("Flywheel Test Mod"); + private int ticks = 0; @Override public void onInitializeClient() { - if (Boolean.parseBoolean(System.getProperty("FLYWHEEL_AUTO_TEST"))) { - ClientTickEvents.END_CLIENT_TICK.register(client -> { - if (++ticks == 50) { - MixinEnvironment.getCurrentEnvironment().audit(); - client.stop(); - } - }); - } + LOGGER.info("Starting Test Mod"); + + ClientTickEvents.END_CLIENT_TICK.register(client -> { + LOGGER.info("Tick Count: {}", ticks); + + if (++ticks == 50) { + LOGGER.info("Running mixin audit"); + MixinEnvironment.getCurrentEnvironment().audit(); + + LOGGER.info("Ran mixin audit, stopping client."); + client.stop(); + } + }); } } diff --git a/forge/src/testMod/java/dev/engine_room/flywheel/FlywheelTestModClient.java b/forge/src/testMod/java/dev/engine_room/flywheel/FlywheelTestModClient.java index d9c727aa9..96b8c8b76 100644 --- a/forge/src/testMod/java/dev/engine_room/flywheel/FlywheelTestModClient.java +++ b/forge/src/testMod/java/dev/engine_room/flywheel/FlywheelTestModClient.java @@ -1,5 +1,9 @@ package dev.engine_room.flywheel; +import net.minecraftforge.common.MinecraftForge; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.spongepowered.asm.mixin.MixinEnvironment; import net.minecraft.client.Minecraft; @@ -10,22 +14,23 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod("flywheel_testmod") public class FlywheelTestModClient { + private static final Logger LOGGER = LoggerFactory.getLogger("Flywheel Test Mod"); + private int ticks = 0; public FlywheelTestModClient() { - if (Boolean.parseBoolean(System.getProperty("FLYWHEEL_AUTO_TEST"))) { + MinecraftForge.EVENT_BUS.addListener((TickEvent.ClientTickEvent e) -> { + if (e.phase == TickEvent.Phase.END) { + LOGGER.info("Tick Count: {}", ticks); - IEventBus modEventBus = FMLJavaModLoadingContext.get() - .getModEventBus(); + if (++ticks == 50) { + LOGGER.info("Running mixin audit"); + MixinEnvironment.getCurrentEnvironment().audit(); - modEventBus.addListener((TickEvent.ClientTickEvent e) -> { - if (e.phase == TickEvent.Phase.END) { - if (++ticks == 50) { - MixinEnvironment.getCurrentEnvironment().audit(); - Minecraft.getInstance().stop(); - } + LOGGER.info("Ran mixin audit, stopping client."); + Minecraft.getInstance().stop(); } - }); - } + } + }); } }