Skip to content

Commit

Permalink
chore: use github pkg for dough
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Jul 19, 2024
1 parent 2377299 commit e0b036a
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -56,9 +56,6 @@ jobs:
echo "JAR_VERSION=$JAR_VERSION" >> "$GITHUB_ENV"
sed -i "s/<version>5.0-SNAPSHOT<\/version>/<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:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/.vscode/
/data-storage/
/javadocs/
/local-deps/

.classpath
.factorypath
Expand Down
12 changes: 12 additions & 0 deletions .mvn/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>dough-downstream</id>
<username>StarWishsama</username>
<password>&#103;&#104;&#112;&#95;&#110;&#84;&#77;&#99;&#122;&#76;&#121;&#102;&#53;&#110;&#69;&#65;&#82;&#68;&#80;&#51;&#87;&#120;&#70;&#80;&#51;&#84;&#122;&#118;&#68;&#66;&#74;&#110;&#48;&#75;&#48;&#105;&#81;&#109;&#110;&#88;</password>
</server>
</servers>
</settings>
14 changes: 12 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>

<maven.settings.file>${project.basedir}/.mvn/settings.xml</maven.settings.file>

<!-- Spigot properties -->
<spigot.version>1.20.6</spigot.version>
<spigot.javadocs>https://hub.spigotmc.org/javadocs/spigot/</spigot.javadocs>
Expand All @@ -48,6 +50,14 @@
<!-- Repositories that host our dependencies -->
<!-- Well, any that aren't found on maven-central. -->
<repositories>
<!-- Public dough downstream repo -->
<repository>
<id>dough-downstream</id>
<url>https://maven.pkg.github.com/StarWishsama/dough</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<!-- Spigot-API -->
<id>spigot-repo</id>
Expand Down Expand Up @@ -275,9 +285,9 @@

<!-- Shaded packages -->
<dependency>
<groupId>com.github.starwishsama.dough</groupId>
<groupId>io.github.baked-libs</groupId>
<artifactId>dough-api</artifactId>
<version>d783252831</version>
<version>1.3.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e0b036a

Please sign in to comment.