From 2b54c2d5d3c494ebc76e966758d5a482454276cd Mon Sep 17 00:00:00 2001 From: half_drop <1097982745@qq.com> Date: Tue, 5 Nov 2024 15:31:04 +0800 Subject: [PATCH 1/4] Update Autofish.java --- src/main/java/troy/autofish/Autofish.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/troy/autofish/Autofish.java b/src/main/java/troy/autofish/Autofish.java index 4df3aeb..a075cd6 100644 --- a/src/main/java/troy/autofish/Autofish.java +++ b/src/main/java/troy/autofish/Autofish.java @@ -47,7 +47,10 @@ public Autofish(FabricModAutofish modAutofish) { modAutofish.getScheduler().scheduleRepeatingAction(10000, () -> { if(!modAutofish.getConfig().isPersistentMode()) return; if(!isHoldingFishingRod()) return; - if(hookExists && isBobberInWater()) return; + if(hookExists){ + if(isBobberInWater()) return; + else useRod(); + } if(modAutofish.getScheduler().isRecastQueued()) return; useRod(); @@ -234,7 +237,7 @@ public void switchToFirstRod(ClientPlayerEntity player) { public boolean isBobberInWater(){ if(client.player != null && client.world != null && client.player.fishHook != null) { - return client.player.fishHook.isTouchingWater(); + return client.world.getBlockState(client.player.fishHook.getBlockPos()).getBlock() == Blocks.WATER; } else{ return false; } From 39d63011d6e0b593a83742c40fb065ea906dca04 Mon Sep 17 00:00:00 2001 From: half_drop <1097982745@qq.com> Date: Tue, 5 Nov 2024 15:32:11 +0800 Subject: [PATCH 2/4] Update FabricModAutofish.java --- src/main/java/troy/autofish/FabricModAutofish.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/troy/autofish/FabricModAutofish.java b/src/main/java/troy/autofish/FabricModAutofish.java index b1c8730..9fbe645 100644 --- a/src/main/java/troy/autofish/FabricModAutofish.java +++ b/src/main/java/troy/autofish/FabricModAutofish.java @@ -42,11 +42,13 @@ public void onInitializeClient() { } public void tick(MinecraftClient client) { - if (autofishGuiKey.wasPressed()) { - client.setScreen(AutofishScreenBuilder.buildScreen(this, client.currentScreen)); + if (this.autofish != null){ + if (autofishGuiKey.wasPressed()) { + client.setScreen(AutofishScreenBuilder.buildScreen(this, client.currentScreen)); + } + autofish.tick(client); + scheduler.tick(client); } - autofish.tick(client); - scheduler.tick(client); } /** From b10584c9cc8a5f5ee1091165a33779dfba0904bb Mon Sep 17 00:00:00 2001 From: half_drop <1097982745@qq.com> Date: Tue, 5 Nov 2024 15:34:40 +0800 Subject: [PATCH 3/4] Create gradle-publish.yml --- .github/workflows/gradle-publish.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/gradle-publish.yml diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml new file mode 100644 index 0000000..358712f --- /dev/null +++ b/.github/workflows/gradle-publish.yml @@ -0,0 +1,23 @@ +name: Auto Gradle Build +on: [push, pull_request] + +jobs: + gradle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + + - name: Execute Gradle build + run: ./gradlew build + + - name: Save Artifact + uses: actions/upload-artifact@v3 + with: + path: build/libs/*.jar From 485ca7944aa55ea5f8e5a2d8f7e0117449951420 Mon Sep 17 00:00:00 2001 From: half_drop <1097982745@qq.com> Date: Tue, 5 Nov 2024 15:54:17 +0800 Subject: [PATCH 4/4] Delete .github/workflows/gradle-publish.yml --- .github/workflows/gradle-publish.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/gradle-publish.yml diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml deleted file mode 100644 index 358712f..0000000 --- a/.github/workflows/gradle-publish.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Auto Gradle Build -on: [push, pull_request] - -jobs: - gradle: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 17 - - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - - - name: Execute Gradle build - run: ./gradlew build - - - name: Save Artifact - uses: actions/upload-artifact@v3 - with: - path: build/libs/*.jar