From c265dd072c1bd08ea8fc8363ed9d44d2c4ca8f1b Mon Sep 17 00:00:00 2001 From: MrButtersDev Date: Fri, 8 Aug 2025 23:30:17 -0400 Subject: [PATCH 1/7] Bump Version + Fixes --- pom.xml | 2 +- .../autopickup/listeners/PlayerFishEventListener.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 09ad3d6..4d6fb2b 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ Automatically picks up the blocks you mine! - 1.4.7-DEVBUILD.4 + 1.4.7-DEVBUILD.5 UTF-8 https://discord.gg/ncHH4FP diff --git a/src/main/java/us/thezircon/play/autopickup/listeners/PlayerFishEventListener.java b/src/main/java/us/thezircon/play/autopickup/listeners/PlayerFishEventListener.java index 51fd557..86a5ef0 100644 --- a/src/main/java/us/thezircon/play/autopickup/listeners/PlayerFishEventListener.java +++ b/src/main/java/us/thezircon/play/autopickup/listeners/PlayerFishEventListener.java @@ -1,6 +1,5 @@ package us.thezircon.play.autopickup.listeners; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Item; import org.bukkit.entity.Player; @@ -9,6 +8,7 @@ import org.bukkit.event.player.PlayerFishEvent; import org.bukkit.inventory.ItemStack; import us.thezircon.play.autopickup.AutoPickup; +import us.thezircon.play.autopickup.utils.SchedulerUtils; import java.util.HashMap; import java.util.List; @@ -25,7 +25,7 @@ public void onFish(PlayerFishEvent e) { if (!PLUGIN.autopickup_list_fishing.contains(player)) return; - Bukkit.getScheduler().runTaskAsynchronously(PLUGIN, new Runnable() { + SchedulerUtils.runTaskAsynchronously(new Runnable() { @Override public void run() { boolean requirePermsAUTO = PLUGIN.getConfig().getBoolean("requirePerms.autopickup"); @@ -45,7 +45,7 @@ public void run() { return; } - Bukkit.getScheduler().runTask(PLUGIN, () -> { + SchedulerUtils.runTask(e.getPlayer().getLocation(), () -> { Item caught = (Item) e.getCaught(); if (PLUGIN.getBlacklistConf().contains("BlacklistedFishing", true)) { @@ -79,4 +79,4 @@ public void run() { } }); } -} +} \ No newline at end of file From 097cc8863f9dd4646472f8936c28105596a5248e Mon Sep 17 00:00:00 2001 From: MrButtersDev Date: Fri, 8 Aug 2025 23:33:28 -0400 Subject: [PATCH 2/7] Change autofishing Changed auto fishing sub command and main command to better parity other commands --- src/main/java/us/thezircon/play/autopickup/AutoPickup.java | 2 +- .../thezircon/play/autopickup/commands/AutoPickup/Auto.java | 4 ++-- .../subcommands/{fishingdrops.java => fishing.java} | 6 +++--- src/main/resources/plugin.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/subcommands/{fishingdrops.java => fishing.java} (92%) diff --git a/src/main/java/us/thezircon/play/autopickup/AutoPickup.java b/src/main/java/us/thezircon/play/autopickup/AutoPickup.java index 73b8113..0f05838 100644 --- a/src/main/java/us/thezircon/play/autopickup/AutoPickup.java +++ b/src/main/java/us/thezircon/play/autopickup/AutoPickup.java @@ -158,7 +158,7 @@ public void onEnable() { // Commands getCommand("autopickup").setExecutor(new Auto()); getCommand("autodrops").setExecutor(new AutoDrops()); - getCommand("autofishingdrops").setExecutor(new AutoFishingDrops()); + getCommand("autofish").setExecutor(new AutoFishingDrops()); getCommand("autosmelt").setExecutor(new AutoSmelt()); // Crops by version diff --git a/src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/Auto.java b/src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/Auto.java index e009a89..6146e90 100644 --- a/src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/Auto.java +++ b/src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/Auto.java @@ -7,7 +7,7 @@ import org.bukkit.entity.Player; import us.thezircon.play.autopickup.AutoPickup; import us.thezircon.play.autopickup.commands.AutoPickup.subcommands.drops; -import us.thezircon.play.autopickup.commands.AutoPickup.subcommands.fishingdrops; +import us.thezircon.play.autopickup.commands.AutoPickup.subcommands.fishing; import us.thezircon.play.autopickup.commands.AutoPickup.subcommands.reload; import us.thezircon.play.autopickup.commands.AutoPickup.subcommands.smelt; import us.thezircon.play.autopickup.commands.CMDManager; @@ -25,7 +25,7 @@ public class Auto implements TabExecutor{ public Auto(){ subcommands.add(new reload()); subcommands.add(new drops()); - subcommands.add(new fishingdrops()); + subcommands.add(new fishing()); subcommands.add(new smelt()); } diff --git a/src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/subcommands/fishingdrops.java b/src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/subcommands/fishing.java similarity index 92% rename from src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/subcommands/fishingdrops.java rename to src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/subcommands/fishing.java index f1e84c4..eae007f 100644 --- a/src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/subcommands/fishingdrops.java +++ b/src/main/java/us/thezircon/play/autopickup/commands/AutoPickup/subcommands/fishing.java @@ -8,13 +8,13 @@ import java.util.List; -public class fishingdrops extends CMDManager { +public class fishing extends CMDManager { private static final AutoPickup PLUGIN = AutoPickup.getPlugin(AutoPickup.class); @Override public String getName() { - return "fishingdrops"; + return "fishing"; } @Override @@ -24,7 +24,7 @@ public String getDescription() { @Override public String getSyntax() { - return "/auto fishingdrops"; + return "/auto fishing"; } @Override diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 3c7bc98..1396104 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -15,9 +15,9 @@ commands: autodrops: description: Toggles the ability to automaticly pickup drops from killed entities. aliases: [drops, autod] - autofishingdrops: + autofish: description: Toggles the ability to automaticly pickup drops from fishing. - aliases: [fishingdrops, autofd] + aliases: [fishingdrops, autofd, autofishingdrops] autosmelt: description: Toggles the ability to automaticly smelt mined blocks. aliases: [asmelt] From b35f66cdcac36347c109a54d26261744871e611a Mon Sep 17 00:00:00 2001 From: MrButtersDev Date: Fri, 8 Aug 2025 23:37:29 -0400 Subject: [PATCH 3/7] Update build.yml --- .github/workflows/build.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7b1e5a..d37c131 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,24 +26,19 @@ jobs: echo "BASE_VERSION=${BASE_VERSION%%-DEVBUILD*}" >> $GITHUB_ENV echo "base_version=${BASE_VERSION%%-DEVBUILD*}" >> $GITHUB_OUTPUT - - name: 🔢 Get last dev build number + - name: 🔢 Get dev build number from commit count id: get-devbuild run: | - VERSION_FILE=".github/devbuild-count.txt" - VERSION="${{ steps.version.outputs.base_version }}" - mkdir -p .github - touch "$VERSION_FILE" - - CURRENT=$(grep "^$VERSION=" "$VERSION_FILE" | cut -d= -f2) - if [ -z "$CURRENT" ]; then - CURRENT=1 + LAST_TAG=$(git describe --tags --match "${{ env.BASE_VERSION }}*" --abbrev=0 2>/dev/null || echo "") + if [ -n "$LAST_TAG" ]; then + BUILD_NUM=$(git rev-list --count "$LAST_TAG"..HEAD) else - CURRENT=$((CURRENT + 1)) + BUILD_NUM=$(git rev-list --count HEAD) fi - echo "$VERSION=$CURRENT" > "$VERSION_FILE" - echo "DEVBUILD=$CURRENT" >> $GITHUB_ENV - echo "build_num=$CURRENT" >> $GITHUB_OUTPUT + echo "DEVBUILD=$BUILD_NUM" >> $GITHUB_ENV + echo "build_num=$BUILD_NUM" >> $GITHUB_OUTPUT + - name: 🛠 Build with Maven run: | From 317fb29a4ac389d9fefc937c7295132eca65525e Mon Sep 17 00:00:00 2001 From: MrButtersDev Date: Fri, 8 Aug 2025 23:39:44 -0400 Subject: [PATCH 4/7] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4d6fb2b..b5f87f1 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ Automatically picks up the blocks you mine! - 1.4.7-DEVBUILD.5 + 1.4.7-DEVBUILD.6 UTF-8 https://discord.gg/ncHH4FP From 6aa180e70d122af3d4d02947f536a80c47fa16e7 Mon Sep 17 00:00:00 2001 From: MrButtersDev Date: Fri, 8 Aug 2025 23:43:28 -0400 Subject: [PATCH 5/7] Update PickupPlayer.java --- .../java/us/thezircon/play/autopickup/utils/PickupPlayer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/us/thezircon/play/autopickup/utils/PickupPlayer.java b/src/main/java/us/thezircon/play/autopickup/utils/PickupPlayer.java index d862623..5e56818 100644 --- a/src/main/java/us/thezircon/play/autopickup/utils/PickupPlayer.java +++ b/src/main/java/us/thezircon/play/autopickup/utils/PickupPlayer.java @@ -91,7 +91,7 @@ public void run() { } public void setEnabledFishing(boolean e) { - new BukkitRunnable() { + SchedulerUtils.runTaskLater(player.getLocation(), new BukkitRunnable() { @Override public void run() { if (!fileExists()) {createFile();} @@ -107,7 +107,7 @@ public void run() { log.warning("[AutoPickup] Unable to update "+uuid+"'s data file."); } } - }.runTaskLater(plugin, 1); + }, 1); } public void setEnabledAutoSmelt(boolean e) { From 1f78ef231693be587ce4691e237e5a642bd5c467 Mon Sep 17 00:00:00 2001 From: BUTTERFIELD8 Date: Fri, 8 Aug 2025 23:47:07 -0400 Subject: [PATCH 6/7] Update build.yml --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d37c131..257bc40 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,8 @@ jobs: steps: - name: 📦 Checkout Code uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: ☕ Set up Java 21 uses: actions/setup-java@v3 From 125a8d324e0b5d821c0f24b5b5628cfff32fbf16 Mon Sep 17 00:00:00 2001 From: BUTTERFIELD8 Date: Tue, 31 Mar 2026 18:17:39 -0400 Subject: [PATCH 7/7] Add GitHub Actions workflow for release builds --- .github/workflows/release.yml | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3983bca --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Release Build + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: 📦 Checkout Code + uses: actions/checkout@v4 + + - name: ☕ Set up Java 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + cache: 'maven' + + - name: 🏷 Get Version from pom.xml + id: version + run: | + # Extracts the version defined in or property + PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "VERSION=$PROJECT_VERSION" >> $GITHUB_ENV + echo "version=$PROJECT_VERSION" >> $GITHUB_OUTPUT + + - name: 🛠 Build Production JAR + run: | + echo "Building Release version: ${{ env.VERSION }}" + mvn clean package -Drevision=${{ env.VERSION }} + + - name: 📦 Prepare Release Artifacts + run: | + mkdir -p dist + # Find the main JAR (excluding original/shaded duplicates if they exist) + JAR=$(find target -name "AutoPickup-${{ env.VERSION }}.jar" | head -n1) + + if [ -z "$JAR" ]; then + echo "❌ Expected JAR target/AutoPickup-${{ env.VERSION }}.jar not found" + ls -l target + exit 1 + fi + + cp "$JAR" "dist/AutoPickup-${{ env.VERSION }}.jar" + + - name: 📥 Upload Release Artifact + uses: actions/upload-artifact@v4 + with: + name: AutoPickup-${{ env.VERSION }}-RELEASE + path: dist/*.jar