Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
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 1_17_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>16</source>
<target>16</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_18_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_18_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_19_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_19_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_19_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_20_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_20_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_20_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_20_R4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand Down
13 changes: 9 additions & 4 deletions 1_21_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
Expand All @@ -29,13 +29,18 @@
<scope>provided</scope>
</dependency>
</dependencies>

<repositories>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_21_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_21_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_21_R4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand Down
2 changes: 1 addition & 1 deletion 1_21_R5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand Down
4 changes: 2 additions & 2 deletions Mojang1_20_R4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
<plugin>
<groupId>ca.bkaw</groupId>
<artifactId>paper-nms-maven-plugin</artifactId>
<version>1.4.7</version>
<version>1.4.10</version>
</plugin>
</plugins>
</build>
</project>
</project>
4 changes: 2 additions & 2 deletions Mojang1_21_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand All @@ -52,7 +52,7 @@
<plugin>
<groupId>ca.bkaw</groupId>
<artifactId>paper-nms-maven-plugin</artifactId>
<version>1.4.7</version>
<version>1.4.10</version>
</plugin>
</plugins>
</build>
Expand Down
4 changes: 2 additions & 2 deletions Mojang1_21_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand All @@ -52,7 +52,7 @@
<plugin>
<groupId>ca.bkaw</groupId>
<artifactId>paper-nms-maven-plugin</artifactId>
<version>1.4.7</version>
<version>1.4.10</version>
</plugin>
</plugins>
</build>
Expand Down
4 changes: 2 additions & 2 deletions Mojang1_21_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand All @@ -52,7 +52,7 @@
<plugin>
<groupId>ca.bkaw</groupId>
<artifactId>paper-nms-maven-plugin</artifactId>
<version>1.4.7</version>
<version>1.4.10</version>
</plugin>
</plugins>
</build>
Expand Down
4 changes: 2 additions & 2 deletions Mojang1_21_R4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand All @@ -52,7 +52,7 @@
<plugin>
<groupId>ca.bkaw</groupId>
<artifactId>paper-nms-maven-plugin</artifactId>
<version>1.4.7</version>
<version>1.4.10</version>
</plugin>
</plugins>
</build>
Expand Down
4 changes: 2 additions & 2 deletions Mojang1_21_R5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<source>21</source>
<target>21</target>
Expand All @@ -52,7 +52,7 @@
<plugin>
<groupId>ca.bkaw</groupId>
<artifactId>paper-nms-maven-plugin</artifactId>
<version>1.4.7</version>
<version>1.4.10</version>
</plugin>
</plugins>
</build>
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ An api to get input text via a sign in Minecraft.
The api supports the Minecraft versions from `1.8` to `1.21`.
Also supports adventure text and mojang-mapped Paper plugins (1.20.5+).

## ✨ Full Platform Support
- ✅ **Bukkit / Spigot / Paper** - Full support
- ✅ **Folia** - Complete regionized multithreading support
- ✅ **CanvasMC** - Full support
- ✅ **Archlight** - Full support (Forge+Bukkit hybrid)

SignGUI automatically detects your server platform and uses the appropriate scheduler for thread-safe operation!

## Integration

Maven dependency:
Expand Down Expand Up @@ -120,6 +128,10 @@ try {
return Collections.emptyList();
})

// RECOMMENDED: Call handler synchronously for thread safety
// REQUIRED for Folia, CanvasMC, and Archlight
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The statement "REQUIRED for Folia, CanvasMC, and Archlight" is somewhat misleading. Based on the PlatformDetector implementation, CanvasMC and Archlight are detected but both use the BukkitSchedulerAdapter, not a special scheduler. So while using callHandlerSynchronously is good practice for thread safety, it's technically not "REQUIRED" specifically for CanvasMC and Archlight in the same way it is for Folia. Consider revising to "REQUIRED for Folia; RECOMMENDED for CanvasMC, Archlight, and other platforms".

Suggested change
// REQUIRED for Folia, CanvasMC, and Archlight
// REQUIRED for Folia; RECOMMENDED for CanvasMC, Archlight, and other platforms

Copilot uses AI. Check for mistakes.
.callHandlerSynchronously(this) // "this" = your JavaPlugin instance

// build the SignGUI
.build();

Expand All @@ -135,6 +147,8 @@ try {

You don't have to call all methods. Only `setHandler` is mandatory.

**Important for Folia/CanvasMC/Archlight:** Always use `callHandlerSynchronously(plugin)` to ensure thread-safe operation on all platforms. On Folia, this ensures tasks run on the correct region thread. On other platforms, it ensures tasks run on the main thread.
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The statement "REQUIRED for Folia, CanvasMC, and Archlight" is somewhat misleading. Based on the PlatformDetector implementation, CanvasMC and Archlight use the BukkitSchedulerAdapter, not a Folia-specific scheduler. While using callHandlerSynchronously is good practice for thread safety, it's not technically "REQUIRED" for CanvasMC and Archlight in the same way it is for Folia. Consider revising to "REQUIRED for Folia; RECOMMENDED for all other platforms for thread safety".

Suggested change
**Important for Folia/CanvasMC/Archlight:** Always use `callHandlerSynchronously(plugin)` to ensure thread-safe operation on all platforms. On Folia, this ensures tasks run on the correct region thread. On other platforms, it ensures tasks run on the main thread.
**Important:** `callHandlerSynchronously(plugin)` is **REQUIRED for Folia** and **RECOMMENDED for all other platforms for thread safety**. On Folia, this ensures tasks run on the correct region thread. On other platforms, it ensures tasks run on the main thread.

Copilot uses AI. Check for mistakes.

By default, the handler is called by an asynchronous thread. You can change that behaviour by calling the method `callHandlerSynchronously` of the builder.
An explanation for the different methods can be found on the [Javadoc](https://javadoc.io/doc/de.rapha149.signgui/signgui).

Expand Down
6 changes: 6 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
<version>1.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dev.folia</groupId>
<artifactId>folia-api</artifactId>
<version>1.21.11-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.rapha149.signgui</groupId>
<artifactId>signgui-wrapper</artifactId>
Expand Down
9 changes: 6 additions & 3 deletions api/src/main/java/de/rapha149/signgui/SignGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import de.rapha149.signgui.SignGUIAction.SignGUIActionInfo;
import de.rapha149.signgui.exception.SignGUIException;
import de.rapha149.signgui.exception.SignGUIVersionException;
import de.rapha149.signgui.util.scheduler.SchedulerFactory;
import de.rapha149.signgui.version.VersionMatcher;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -107,10 +108,12 @@ public void open(Player player) throws SignGUIException {
action.execute(this, signEditor, player);
};

if (callHandlerSynchronously)
Bukkit.getScheduler().runTask(plugin, runnable);
else
if (callHandlerSynchronously) {
// Use platform-aware scheduler that works on Folia, CanvasMC, Archlight, and Bukkit
SchedulerFactory.getScheduler().runTask(plugin, player, runnable);
} else {
runnable.run();
}
});
} catch (Exception e) {
throw new SignGUIException("Failed to open sign gui", e);
Expand Down
5 changes: 4 additions & 1 deletion api/src/main/java/de/rapha149/signgui/SignGUIBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ public SignGUIBuilder setHandler(SignGUIFinishHandler handler) {
}

/**
* If called the handler will be called synchronously by calling the method {@link org.bukkit.scheduler.BukkitScheduler#runTask(Plugin, Runnable)}
* If called the handler will be called synchronously by using the appropriate scheduler.
* This is required for Folia, CanvasMC, and Archlight support and ensures thread-safe execution.
* On Folia, tasks are scheduled on the player's region thread.
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation states that on Folia "tasks are scheduled on the player's region thread," but the actual implementation in SignGUI.java line 113 calls runTask(plugin, player, runnable). This correctly schedules on the player's entity scheduler. However, the SignGUIBuilder documentation should be consistent and mention "entity scheduler" to align with Folia's terminology, or verify that "region thread" accurately describes where entity-scheduled tasks execute.

Suggested change
* On Folia, tasks are scheduled on the player's region thread.
* On Folia, tasks are scheduled via the player's entity scheduler (on the thread owning the player's region).

Copilot uses AI. Check for mistakes.
* On Bukkit/Spigot/Paper, tasks are scheduled on the main thread.
*
* @param plugin Your {@link org.bukkit.plugin.java.JavaPlugin} instance.
* @return The {@link SignGUIBuilder} instance
Expand Down
Loading