Skip to content

v2.8.1 - Critical Threading Fix for Paper 1.21.8

Choose a tag to compare

@koyere koyere released this 20 Oct 14:42
· 30 commits to main since this release

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 IllegalStateException on 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.