Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a7be2fb
feat: init folia support
StarWishsama May 5, 2025
ee65c10
feat(ticker): run asyncable task by location in folia
StarWishsama May 6, 2025
e750eb4
fix(folia): `runSync` delay min value should > 0
StarWishsama May 6, 2025
0c61cb0
refactor: replace some scheduler usage
StarWishsama May 11, 2025
742f76d
Merge branch 'dev' into feature/folia
StarWishsama Jul 2, 2025
9d1437d
fix(deps): update `FoliaLib` maven repo
StarWishsama Jul 2, 2025
94f61b6
Merge branch 'dev' into feature/folia
StarWishsama Jul 6, 2025
529ca4a
feat(ticker): introduced `AsyncTickerService`
StarWishsama Jul 6, 2025
d089f10
feat(ticker): shutdown async ticker gracefully
StarWishsama Jul 7, 2025
fa49cd7
fix(energy): use concurrent-safe set for discovering network
StarWishsama Jul 9, 2025
7cd0a8f
fix(task): `TaskQueue` should handle runAtLoc/Entity properly
StarWishsama Jul 12, 2025
7e03f83
chore: fully use our async ticker service
StarWishsama Jul 16, 2025
b0469ca
fix: use `teleportAsync`
StarWishsama Jul 16, 2025
9ff6129
Merge branch 'dev' into feature/folia
StarWishsama Jul 16, 2025
660f472
fix: enforced concurrency safe
StarWishsama Jul 28, 2025
bc85e7f
Merge branch 'dev' into feature/folia
StarWishsama Jul 28, 2025
489a68f
Merge branch 'dev' into feature/folia
StarWishsama Jul 31, 2025
3b76350
feat(ticker): introduced custom async ticker config
StarWishsama Jul 31, 2025
68fdf11
Merge branch 'dev' into feature/folia
StarWishsama Aug 2, 2025
dc8af50
fix(soulbound): soulbound not working in folia
StarWishsama Aug 2, 2025
5fd00db
fix: async chunk retrieval
StarWishsama Aug 2, 2025
b66e23e
Merge branch 'dev' into feature/folia
StarWishsama Aug 2, 2025
1ad4fd3
chore: adjust async ticker thread pool rule
StarWishsama Aug 4, 2025
ad72100
ci: only replace first `<version>`
StarWishsama Aug 5, 2025
f73d588
fix(ci): bad pattern
StarWishsama Aug 5, 2025
f124484
fix(ci): env var not be filled
StarWishsama Aug 5, 2025
b2832fc
Merge branch 'dev' into feature/folia
StarWishsama Aug 13, 2025
b261642
Merge branch 'dev' into feature/folia
StarWishsama Sep 15, 2025
d8a7e24
feat(api): introduced `isConcurrentSafe` for identify concurrent-safe…
StarWishsama Sep 15, 2025
06f2d5f
refactor: adjust ticker thread pool reject strategy
StarWishsama Sep 17, 2025
f84248c
fix: add fallback ticker service graceful shutdown
StarWishsama Sep 17, 2025
feb14b6
Merge branch 'dev' into feature/folia
StarWishsama Nov 4, 2025
1193a7e
refactor(api): update method signature
StarWishsama Nov 4, 2025
f292b35
Merge branch 'dev' into feature/folia
StarWishsama Dec 25, 2025
6a2c653
chore: followup merge fix
StarWishsama Dec 25, 2025
6441f7c
Merge branch 'dev' into feature/folia
StarWishsama Dec 26, 2025
41e3460
fix(config): inconsistent config mapping
StarWishsama Dec 26, 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
2 changes: 1 addition & 1 deletion .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
echo "SHORT_COMMIT_HASH=$SHORT_COMMIT_HASH" >> "$GITHUB_ENV"
echo "SHORT_COMMIT_HASH=$SHORT_COMMIT_HASH" >> "$GITHUB_OUTPUT"
echo "JAR_VERSION=$JAR_VERSION" >> "$GITHUB_ENV"
sed -i "s/<version>DEV-SNAPSHOT<\/version>/<version>$JAR_VERSION<\/version>/g" pom.xml
sed -i "0,/<version>[^<]*<\/version>/{s/<version>[^<]*<\/version>/<version>$JAR_VERSION<\/version>/}" pom.xml

- name: Build with Maven
run: mvn package -Dversioning.disable --errors
Expand Down
14 changes: 14 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
<id>codemc-repo</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
</repository>
<repository>
<id>tcoded-releases</id>
<url>https://repo.tcoded.com/releases</url>
</repository>
</repositories>

<build>
Expand Down Expand Up @@ -175,6 +179,10 @@
<pattern>net.guizhanss.guizhanlib</pattern>
<shadedPattern>io.github.thebusybiscuit.slimefun4.libraries.guizhanlib</shadedPattern>
</relocation>
<relocation>
<pattern>com.tcoded.folialib</pattern>
<shadedPattern>io.github.thebusybiscuit.slimefun4.libraries.folialib</shadedPattern>
</relocation>
</relocations>

<!-- Exclude unneeded metadata files from shaded dependencies -->
Expand Down Expand Up @@ -421,6 +429,12 @@
<version>42.7.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.tcoded</groupId>
<artifactId>FoliaLib</artifactId>
<version>0.5.1</version>
<scope>compile</scope>
</dependency>

<!-- Third party plugin integrations / soft dependencies -->
<dependency>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/city/norain/slimefun4/EnvironmentChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ static boolean checkHybridServer() {
}

static void scheduleSlimeGlueCheck(@Nonnull Slimefun sf) {
Bukkit.getScheduler()
.runTaskLater(
sf,
sf.getPlatformScheduler()
.runLater(
() -> {
if (Bukkit.getPluginManager().getPlugin("SlimeGlue") == null) {
sf.getLogger().log(Level.WARNING, "检测到没有安装 SlimeGlue (粘液胶), 你将缺失对一些插件的额外保护检查!");
Expand Down
64 changes: 64 additions & 0 deletions src/main/java/city/norain/slimefun4/dough/TaskNode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package city.norain.slimefun4.dough;

import java.util.function.IntConsumer;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.Validate;
import org.bukkit.Location;
import org.bukkit.entity.Entity;

class TaskNode {

private final IntConsumer runnable;

@Getter
private final boolean asynchronous;

@Getter
private int delay = 0;

@Nullable @Getter
@Setter
private Location location;

@Nullable @Getter
@Setter
private Entity entity;

private TaskNode nextNode;

protected TaskNode(@Nonnull IntConsumer consumer, boolean async) {
this.runnable = consumer;
this.asynchronous = async;
}

protected TaskNode(@Nonnull IntConsumer consumer, int delay, boolean async) {
this.runnable = consumer;
this.delay = delay;
this.asynchronous = async;
}

protected boolean hasNextNode() {
return nextNode != null;
}

public @Nullable TaskNode getNextNode() {
return nextNode;
}

public void setNextNode(@Nullable TaskNode node) {
this.nextNode = node;
}

public void execute(int index) {
runnable.accept(index);
}

public void setDelay(int delay) {
Validate.isTrue(delay >= 0, "The delay cannot be negative.");

this.delay = delay;
}
}
Loading