-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
33 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 17 additions & 8 deletions
25
fabric/src/testMod/java/dev/engine_room/flywheel/FlywheelTestModClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters