From e0b036a3329c61d35479c1518fc1ae9755be6cd6 Mon Sep 17 00:00:00 2001 From: StarWishsama Date: Fri, 19 Jul 2024 21:58:36 +0800 Subject: [PATCH] chore: use github pkg for dough --- .github/workflows/build-ci.yml | 4 ++-- .github/workflows/dev-ci.yml | 4 ++-- .github/workflows/pr-checker.yml | 7 ++----- .gitignore | 1 + .mvn/settings.xml | 12 +++++++++++ pom.xml | 14 +++++++++++-- .../general/Inventory/ChestMenu.java | 20 +++++++++---------- 7 files changed, 41 insertions(+), 21 deletions(-) create mode 100644 .mvn/settings.xml diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 4b2c0fabfb..e4e90802f3 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -28,9 +28,9 @@ jobs: architecture: x64 cache: maven - name: Codestyle Check - run: mvn -B spotless:check --errors + run: mvn -s .mvn/settings.xml -B spotless:check --errors - name: Build Slimefun - run: mvn -B package --errors + run: mvn -s .mvn/settings.xml -B package --errors - uses: actions/upload-artifact@v2 name: Upload Beta artifact with: diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 054556c0c7..bfcc9baa88 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -25,9 +25,9 @@ jobs: architecture: x64 cache: maven - name: Codestyle check - run: mvn -B spotless:check --errors + run: mvn -s .mvn/settings.xml -B spotless:check --errors - name: Build Slimefun - run: mvn -B package --errors + run: mvn -s .mvn/settings.xml -B package --errors - name: Mask Output run: | echo "::add-mask::$CF_API_TOKEN" diff --git a/.github/workflows/pr-checker.yml b/.github/workflows/pr-checker.yml index 9b09d247d7..0a91e9c360 100644 --- a/.github/workflows/pr-checker.yml +++ b/.github/workflows/pr-checker.yml @@ -40,10 +40,10 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Codestyle Check - run: mvn -B spotless:check compile --errors + run: mvn -s .mvn/settings.xml -B spotless:check compile --errors - name: Build with Maven - run: mvn package + run: mvn -s .mvn/settings.xml package --errors # Setup for the preview build - name: Environment Setup @@ -56,9 +56,6 @@ jobs: echo "JAR_VERSION=$JAR_VERSION" >> "$GITHUB_ENV" sed -i "s/5.0-SNAPSHOT<\/version>/$JAR_VERSION<\/version>/g" pom.xml - - name: Build with Maven - run: mvn clean package - - name: Upload the artifact uses: actions/upload-artifact@v3 with: diff --git a/.gitignore b/.gitignore index 66b05d87e2..5185500aca 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /.vscode/ /data-storage/ /javadocs/ +/local-deps/ .classpath .factorypath diff --git a/.mvn/settings.xml b/.mvn/settings.xml new file mode 100644 index 0000000000..8679032c89 --- /dev/null +++ b/.mvn/settings.xml @@ -0,0 +1,12 @@ + + + + dough-downstream + StarWishsama + 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 + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 178fc9f707..be19ab4f24 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,8 @@ 17 17 + ${project.basedir}/.mvn/settings.xml + 1.20.6 https://hub.spigotmc.org/javadocs/spigot/ @@ -48,6 +50,14 @@ + + + dough-downstream + https://maven.pkg.github.com/StarWishsama/dough + + true + + spigot-repo @@ -275,9 +285,9 @@ - com.github.starwishsama.dough + io.github.baked-libs dough-api - d783252831 + 1.3.1-SNAPSHOT compile diff --git a/src/main/java/me/mrCookieSlime/CSCoreLibPlugin/general/Inventory/ChestMenu.java b/src/main/java/me/mrCookieSlime/CSCoreLibPlugin/general/Inventory/ChestMenu.java index c58a643b42..1bb2b07f7b 100644 --- a/src/main/java/me/mrCookieSlime/CSCoreLibPlugin/general/Inventory/ChestMenu.java +++ b/src/main/java/me/mrCookieSlime/CSCoreLibPlugin/general/Inventory/ChestMenu.java @@ -127,17 +127,17 @@ public ChestMenu addPlayerInventoryClickHandler(MenuClickHandler handler) { * @return The ChestMenu Instance */ public ChestMenu addItem(int slot, ItemStack item) { - // do shallow copy due to Paper ItemStack system change - // See also: https://github.com/PaperMC/Paper/pull/10852 - ItemStack clone = item == null ? null : new ItemStack(item.getType(), item.getAmount()); - - if (clone != null && item.hasItemMeta()) { - clone.setItemMeta(item.getItemMeta()); - } - + /** + * // do shallow copy due to Paper ItemStack system change + * // See also: https://github.com/PaperMC/Paper/pull/10852 + * ItemStack clone = item == null ? null : new ItemStack(item.getType(), item.getAmount()); + * + * if (clone != null && item.hasItemMeta()) { + * clone.setItemMeta(item.getItemMeta()); + * }*/ setSize((int) (Math.max(getSize(), Math.ceil((slot + 1) / 9d) * 9))); - this.items.set(slot, clone); - this.inventory.setItem(slot, clone); + this.items.set(slot, item); + this.inventory.setItem(slot, item); return this; }