Repository navigation
v2.8.1 - Critical Threading Fix for Paper 1.21.8
v2.8.1 - Critical Threading Fix for Paper 1.21.8
π§ What's Fixed
This release fixes a critical threading issue that prevented pattern detection events from working correctly on Paper 1.21.8 and broke external API integration.
The Problem
- Pattern detection events were fired asynchronously, causing
IllegalStateExceptionon Paper 1.21.8 - External plugins using
api.registerPatternDetectionListener()never received events - Console showed repeated threading exceptions during pattern detection
The Solution
- β All events now fire synchronously on main thread (Paper 1.21.8 compliant)
- β Thread-safe data structures (ConcurrentHashMap/ConcurrentLinkedDeque)
- β Proper async/sync separation for optimal performance
- β Full Folia compatibility maintained
π¦ For Developers
Update your dependency to use this version:
Maven
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.koyere</groupId>
<artifactId>AntiAFKPlus</artifactId>
<version>2.8.1</version>
<scope>provided</scope>
</dependency>
</dependencies>Gradle
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compileOnly 'com.github.koyere:AntiAFKPlus:2.8.1'
}Gradle (Kotlin DSL)
repositories {
maven("https://jitpack.io")
}
dependencies {
compileOnly("com.github.koyere:AntiAFKPlus:2.8.1")
}π― API Usage
Pattern detection listeners now work correctly:
AntiAFKPlusAPI api = AntiAFKPlusAPI.getInstance();
api.registerPatternDetectionListener(event -> {
Player player = event.getPlayer();
DetectedPattern pattern = event.getPattern();
if (pattern.getConfidence() > 0.8) {
// High confidence detection - take action
System.out.println(player.getName() + " detected with pattern: " + pattern.getType());
}
});π Compatibility
- β Paper 1.21.8 (strict threading mode)
- β Spigot 1.16-1.21.8
- β Folia 1.19.4-1.21.8
- β Purpur 1.16-1.21.8
- β Bukkit 1.16-1.21.8
π Upgrade Notes
- 100% compatible with v2.8 - no breaking changes
- No configuration changes required
- Drop-in replacement - just update the JAR
π Documentation
π Acknowledgments
Thanks to the community for reporting this issue and helping validate the fix!
Full Changelog: CHANGELOG_2.8.1.md
β οΈ Important for Jitpack
After creating this release, wait 2-5 minutes for Jitpack to build. Then verify at:
π https://jitpack.io/#koyere/AntiAFKPlus/2.8.1
The build should show green β . If it shows red β, check the build logs.