Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8e77f1e
feat(WoodcutterAndroid): 支持苍白橡木 (#1084)
ybw0014 Jul 27, 2025
5f8841e
fix(comp): fallback check for `isConnected` for 1.20-
StarWishsama Jul 27, 2025
1e04032
chore(dev): introduced `javadoc-deploy`
StarWishsama Jul 27, 2025
aa64288
fix: javadoc
StarWishsama Jul 27, 2025
f136450
chore: separate javadoc deployer to single repo
StarWishsama Jul 27, 2025
ab23777
fix: javadoc output dir
StarWishsama Jul 27, 2025
a88d527
chore(javadoc): fix scope
StarWishsama Jul 28, 2025
a94d9f7
chore(doc): update javadoc
StarWishsama Jul 29, 2025
cec0fb0
fix(unidata): closes #1085
StarWishsama Jul 30, 2025
d40774b
chore(ci): set timezone to utf-8
StarWishsama Jul 30, 2025
c1e08fd
fix(unidata): init location info after uni record saved (#1086)
StarWishsama Jul 31, 2025
2894b00
feat(api): introduce `createUniversalData(UUID)`
StarWishsama Jul 31, 2025
372d6a3
chore: cleanup code
StarWishsama Jul 31, 2025
c4639e9
fix(unidata): check uuid before create data
StarWishsama Jul 31, 2025
8cf6860
fix: Sound 兼容
ybw0014 Jul 31, 2025
9622c41
fix: Biome 兼容
ybw0014 Jul 31, 2025
41ee47d
chore: update workflow
ybw0014 Jul 31, 2025
d9ef6ba
chore: spotless
ybw0014 Jul 31, 2025
8867007
fix(integrate): removeBlock trigger multiple times in `EditSession`
StarWishsama Aug 1, 2025
f9626a5
Merge pull request #1089 from SlimefunGuguProject/fix/1-21-backard-co…
ybw0014 Aug 1, 2025
6ef59be
chore(ci): introduced `spotless-apply` workflow
StarWishsama Aug 2, 2025
dde7d42
fix(ci): use inherit secrets properly
StarWishsama Aug 2, 2025
88223dd
fix(ci): wrong condition on validate next ci
StarWishsama Aug 2, 2025
7cd30b4
chore: fix jitpack build
ybw0014 Aug 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Slimefun Builder
name: Slimefun Beta Builder

on:
push:
branches:
- master
paths:
- 'src/**'
- 'pom.xml'
workflow_call:
workflow_dispatch:

env:
TZ: 'Asia/Shanghai'

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -28,9 +26,9 @@ jobs:
architecture: x64
cache: maven
- name: Codestyle Check
run: mvn -s .mvn/settings.xml -B spotless:check --errors
run: mvn -B spotless:check --errors
- name: Build Slimefun
run: mvn -s .mvn/settings.xml -B package --errors
run: mvn -B package --errors
- uses: actions/upload-artifact@v4
name: Upload Beta artifact
with:
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Slimefun DEV
name: Slimefun Dev CI

on:
push:
branches:
- dev
paths:
- 'src/**'
- 'pom.xml'
workflow_call:
workflow_dispatch:

env:
TZ: 'Asia/Shanghai'

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -24,8 +22,6 @@ jobs:
java-package: jdk
architecture: x64
cache: maven
- name: Codestyle check
run: mvn -s .mvn/settings.xml -B spotless:check --errors
- name: Publish snapshots
run: |
echo "::add-mask::$MAVEN_ACCOUNT"
Expand All @@ -35,7 +31,7 @@ jobs:
MAVEN_ACCOUNT: '${{ vars.MAVEN_ACCOUNT }}'
MAVEN_PASSWORD: '${{ secrets.MAVEN_PASSWORD }}'
- name: Build Slimefun
run: mvn -s .mvn/settings.xml -B clean package --errors
run: mvn -B clean package --errors
- name: Mask Output
run: |
echo "::add-mask::$CF_API_TOKEN"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/e2e-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ jobs:
javaVersion: '18'
- mcVersion: '1.19.4'
javaVersion: '19'
- mcVersion: '1.20.6'
javaVersion: '21'
- mcVersion: '1.21.4'
javaVersion: '21'
- mcVersion: 'latest'
javaVersion: '21'

Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
name: Pull Request Checker

on:
pull_request_target:
types: [opened, synchronize, reopened]
paths:
- '.github/workflows/**'
- 'src/**'
- 'pom.xml'
workflow_call:
env:
TZ: 'Asia/Shanghai'

permissions:
contents: read
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/spotless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: spotless.yml
on:
push:
branches: [ master, dev ]
paths:
- 'src/**'
- 'pom.xml'
pull_request:
types: [ opened, synchronize, reopened ]
paths:
- 'src/**'
- 'pom.xml'

env:
TZ: 'Asia/Shanghai'

jobs:
spotless:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
java-package: jdk
architecture: x64
cache: maven

- name: Spotless check
id: spotless-check
run: mvn -B spotless:check --errors
continue-on-error: ${{ github.event_name == 'push' }}

- name: Spotless apply (if needed)
id: spotless-apply
if: ${{ github.github.event_name == 'push' && failure() && steps.spotless-check.outcome == 'failure' }}
run: mvn -B spotless:apply --errors

- name: Push changes
uses: EndBug/add-and-commit@v9.1.4
if: ${{ github.github.event_name == 'push'}}
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
add: '.'
push: true
message: 'chore(ci): spotless'
author_name: 'noraincity-bot'
author_email: ${{ secrets.BOT_EMAIL }}
committer_name: 'noraincity-bot'
committer_email: ${{ secrets.BOT_EMAIL }}
call-dev-ci:
needs: [ spotless ]
if: ${{ github.event_name == 'PushEvent' && github.ref_name == 'dev' }}
uses: ./.github/workflows/dev-ci.yml
secrets: inherit
call-beta-ci:
needs: [ spotless ]
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
uses: ./.github/workflows/build-ci.yml
secrets: inherit
call-pr-checker:
needs: [ spotless ]
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/workflows/pr-checker.yml
secrets: inherit
4 changes: 2 additions & 2 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
before_install:
- sdk install java 17.0.15-zulu
- sdk use java 17.0.15-zulu
- sdk install java 21.0.8-zulu
- sdk use java 21.0.8-zulu
- sdk install maven

install:
Expand Down
66 changes: 65 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<maven.settings.file>${project.basedir}/.mvn/settings.xml</maven.settings.file>

<!-- Paper properties -->
<paper.version>1.21</paper.version>
<paper.version>1.21.4</paper.version>
<paper.javadocs>https://papermc.io/javadocs</paper.javadocs>
</properties>

Expand Down Expand Up @@ -247,6 +247,70 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>

<plugin>
<!-- Javadocs -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>

<configuration>
<outputDirectory>${project.basedir}/javadocs</outputDirectory>

<doctitle>Slimefun4 - Javadocs</doctitle>
<windowtitle>Slimefun4 - Javadocs</windowtitle>
<detectOfflineLinks>false</detectOfflineLinks>
<additionalJOption>-html5</additionalJOption>

<!-- We can group packages together in our Javadocs -->
<groups>
<group>
<title>Slimefun4 - API</title>
<packages>io.github.thebusybiscuit.slimefun4.api*</packages>
</group>
<group>
<title>Slimefun4 - 核心类</title>
<packages>io.github.thebusybiscuit.slimefun4.core*</packages>
</group>
<group>
<title>Slimefun4 - 实现类</title>
<packages>io.github.thebusybiscuit.slimefun4.implementation*</packages>
</group>
<group>
<title>Slimefun4 - 插件兼容相关类</title>
<packages>io.github.thebusybiscuit.slimefun4.integrations*</packages>
</group>
<group>
<title>Slimefun4 - 工具类</title>
<packages>io.github.thebusybiscuit.slimefun4.utils*</packages>
</group>
<group>
<title>Slimefun4 - 物品</title>
<packages>io.github.thebusybiscuit.slimefun4.implementation.items*</packages>
</group>
<group>
<title>Slimefun4 - 多方块结构</title>
<packages>io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks*</packages>
</group>
<group>
<title>Slimefun4 - 电器</title>
<packages>io.github.thebusybiscuit.slimefun4.implementation.items.electric*</packages>
</group>
<group>
<title>Slimefun4 - 过时包</title>
<packages>me.mrCookieSlime.Slimefun*</packages>
</group>
<group>
<title>数据库相关实现</title>
<packages>com.xzavier0722.mc.plugin.slimefun4.storage*</packages>
</group>
<group>
<title>汉化版额外实现</title>
<packages>city.norain.slimefun4.api*</packages>
</group>
</groups>
</configuration>
</plugin>
</plugins>

<!-- 私有 Maven Repo 发布相关组件 -->
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/city/norain/slimefun4/VaultIntegration.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import org.bukkit.OfflinePlayer;

/**
* Vault 集成类, 用于处理游戏币相关的操作.
*
* @author StarWishsama
*/
public class VaultIntegration {
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/city/norain/slimefun4/api/menu/UniversalMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.UUID;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import lombok.Getter;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu;
Expand All @@ -20,7 +21,7 @@ public UniversalMenu(@Nonnull UniversalMenuPreset preset, @Nonnull UUID uuid) {
this(preset, uuid, (Location) null);
}

public UniversalMenu(@Nonnull UniversalMenuPreset preset, @Nonnull UUID uuid, Location lastPresent) {
public UniversalMenu(@Nonnull UniversalMenuPreset preset, @Nonnull UUID uuid, @Nullable Location lastPresent) {
super(preset);
this.uuid = uuid;

Expand All @@ -29,7 +30,10 @@ public UniversalMenu(@Nonnull UniversalMenuPreset preset, @Nonnull UUID uuid, Lo
}

public UniversalMenu(
@Nonnull UniversalMenuPreset preset, @Nonnull UUID uuid, Location lastPresent, ItemStack[] contents) {
@Nonnull UniversalMenuPreset preset,
@Nonnull UUID uuid,
@Nullable Location lastPresent,
ItemStack[] contents) {
super(preset);
this.uuid = uuid;

Expand All @@ -49,7 +53,7 @@ public UniversalMenu(@Nonnull UniversalMenuPreset preset, @Nonnull UUID uuid, It
this(preset, uuid, null, contents);
}

public void update(@Nonnull Location lastPresent) {
public void update(@Nullable Location lastPresent) {
((UniversalMenuPreset) preset).clone(this, lastPresent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ public UniversalMenuPreset(@Nonnull String id, @Nonnull String title) {
super(id, title);
}

public void newInstance(@Nonnull UniversalMenu menu, @Nonnull Block b) {
/**
* 创建一个新的菜单实例
*
* @param menu {@link UniversalMenu} 通用菜单
* @param b 当前实例对应的方块,方块可能为空
*/
public void newInstance(@Nonnull UniversalMenu menu, @Nullable Block b) {
// This method can optionally be overridden by implementations
}

Expand All @@ -37,7 +43,7 @@ protected void clone(@Nonnull DirtyChestMenu menu) {
}
}

protected void clone(@Nonnull UniversalMenu menu, @Nonnull Location lastPresent) {
protected void clone(@Nonnull UniversalMenu menu, @Nullable Location lastPresent) {
menu.setPlayerInventoryClickable(true);

for (int slot : occupiedSlots) {
Expand All @@ -48,7 +54,13 @@ protected void clone(@Nonnull UniversalMenu menu, @Nonnull Location lastPresent)
menu.addItem(getSize() - 1, null);
}

newInstance(menu, lastPresent.getBlock());
Block b = null;

if (lastPresent != null) {
b = lastPresent.getBlock();
}

newInstance(menu, b);

for (int slot = 0; slot < 54; slot++) {
if (getMenuClickHandler(slot) != null) {
Expand Down
Loading
Loading