Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Oct 23, 2024
1 parent 3544e49 commit 6383ceb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on: [ workflow_dispatch, pull_request, push ]
jobs:
build:
runs-on: ubuntu-latest
env:
JAVA_VERSION: 17
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Java
run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV"
run: echo "JAVA_HOME=$JAVA_HOME_${{ env.JAVA_VERSION }}_X64" >> "$GITHUB_ENV"

- name: Loom Cache
uses: actions/cache@v4
Expand Down Expand Up @@ -75,10 +77,12 @@ 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 }}
regex: .*${{ matrix.loader }}.*
mc-runtime-test: none
java: 17
java: ${{ env.JAVA_VERSION }}
fabric-api: ${{ matrix.loader == 'fabric' && env.FABRIC_API_VERSION || 'none' }}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class FlywheelTestModClient implements ClientModInitializer {

@Override
public void onInitializeClient() {
if (Boolean.getBoolean("flywheel.autoTest")) {
if (Boolean.parseBoolean(System.getProperty("FLYWHEEL_AUTO_TEST"))) {
ClientTickEvents.END_CLIENT_TICK.register(client -> {
if (++ticks == 50) {
MixinEnvironment.getCurrentEnvironment().audit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ public class FlywheelTestModClient {
private int ticks = 0;

public FlywheelTestModClient() {
log("Loading test mod");

if (Boolean.getBoolean("flywheel.autoTest")) {
log("running autotest");
if (Boolean.parseBoolean(System.getProperty("FLYWHEEL_AUTO_TEST"))) {

IEventBus modEventBus = FMLJavaModLoadingContext.get()
.getModEventBus();

modEventBus.addListener((TickEvent.ClientTickEvent e) -> {
if (e.phase == TickEvent.Phase.END) {
log("current ticks" + ticks);
if (++ticks == 50) {
MixinEnvironment.getCurrentEnvironment().audit();
Minecraft.getInstance().stop();
Expand All @@ -32,8 +28,4 @@ public FlywheelTestModClient() {
});
}
}

public static void log(String s) {
System.out.println("[Flywheel Test Mod] " + s);
}
}

0 comments on commit 6383ceb

Please sign in to comment.