From 908b53eeb0196ab4d44bfbc5fb131633cd4f062c Mon Sep 17 00:00:00 2001 From: Khisab Kurniawan Date: Mon, 14 Apr 2025 10:54:36 +0700 Subject: [PATCH 1/5] fix: handle empty placeholders in unsafe parse to prevent crash --- pom.xml | 4 +-- src/ParseOtherExpansion.java | 47 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index a9d6321..94dc219 100644 --- a/pom.xml +++ b/pom.xml @@ -31,13 +31,13 @@ org.spigotmc spigot-api - 1.19-R0.1-SNAPSHOT + 1.21.4-R0.1-SNAPSHOT provided me.clip placeholderapi - 2.11.2 + 2.11.6 provided diff --git a/src/ParseOtherExpansion.java b/src/ParseOtherExpansion.java index 509b275..8ec8f42 100644 --- a/src/ParseOtherExpansion.java +++ b/src/ParseOtherExpansion.java @@ -27,39 +27,38 @@ public String getVersion() { @SuppressWarnings("deprecation") @Override public String onRequest(OfflinePlayer p, String s) { - boolean unsafe = false; if (s.startsWith("unsafe_")) { s = s.substring(7); unsafe = true; } - + String[] strings = s.split("(? Date: Wed, 7 May 2025 01:43:49 -0300 Subject: [PATCH 2/5] Update ParseOtherExpansion.java --- src/ParseOtherExpansion.java | 75 +++++++++++++++++------------------- 1 file changed, 36 insertions(+), 39 deletions(-) diff --git a/src/ParseOtherExpansion.java b/src/ParseOtherExpansion.java index 8ec8f42..6f843ed 100644 --- a/src/ParseOtherExpansion.java +++ b/src/ParseOtherExpansion.java @@ -27,57 +27,54 @@ public String getVersion() { @SuppressWarnings("deprecation") @Override public String onRequest(OfflinePlayer p, String s) { - boolean unsafe = false; - if (s.startsWith("unsafe_")) { - s = s.substring(7); - unsafe = true; - } - - String[] strings = s.split("(? Date: Wed, 7 May 2025 01:44:13 -0300 Subject: [PATCH 3/5] Update ParseOtherExpansion.java --- src/ParseOtherExpansion.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ParseOtherExpansion.java b/src/ParseOtherExpansion.java index 6f843ed..5717267 100644 --- a/src/ParseOtherExpansion.java +++ b/src/ParseOtherExpansion.java @@ -54,7 +54,6 @@ public String onRequest(OfflinePlayer p, String s) { target = found; } } catch (IllegalArgumentException e) { - // No es UUID, intentar buscar por nombre entre jugadores ya conocidos for (OfflinePlayer op : Bukkit.getOfflinePlayers()) { if (op.getName() != null && op.getName().equalsIgnoreCase(input)) { target = op; @@ -62,8 +61,6 @@ public String onRequest(OfflinePlayer p, String s) { } } } - - // Si no se encontró jugador válido localmente, abortar if (target == null || !target.hasPlayedBefore()) { return ""; } From c5f36fd9d64d4a045b83ce143abb0d657334d298 Mon Sep 17 00:00:00 2001 From: juancruzdal <35972023+juancruzdal@users.noreply.github.com> Date: Wed, 7 May 2025 01:50:29 -0300 Subject: [PATCH 4/5] Create maven-publish.yml --- .github/workflows/maven-publish.yml | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/maven-publish.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 0000000..267ad25 --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,34 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path + +name: ParseOther + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + env: + GITHUB_TOKEN: ${{ github.token }} From dfab53f85110762cce2bbbc981626e772721f264 Mon Sep 17 00:00:00 2001 From: juancruzdal <35972023+juancruzdal@users.noreply.github.com> Date: Wed, 7 May 2025 01:54:00 -0300 Subject: [PATCH 5/5] Delete .github/workflows/maven-publish.yml --- .github/workflows/maven-publish.yml | 34 ----------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .github/workflows/maven-publish.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml deleted file mode 100644 index 267ad25..0000000 --- a/.github/workflows/maven-publish.yml +++ /dev/null @@ -1,34 +0,0 @@ -# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path - -name: ParseOther - -on: - release: - types: [created] - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 8 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'temurin' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Build with Maven - run: mvn -B package --file pom.xml - - - name: Publish to GitHub Packages Apache Maven - run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml - env: - GITHUB_TOKEN: ${{ github.token }}