Fix/fix folia issues and persistentce#39
Merged
Keviro merged 6 commits intoversion/1.21.11from Feb 24, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses Folia compatibility issues and fixes NPC persistence bugs in the surf-npc plugin. The changes include adding proper persistence checks before saving NPCs, fixing a missing entityType field in the save method, improving listener architecture by converting them to Kotlin objects, and adding Folia support through the Canvas API.
Changes:
- Fixed NPC persistence to prevent non-persistent NPCs from being saved to disk
- Fixed missing entityType field in NPC save method
- Added Folia support through Canvas API with conditional listener registration
- Converted Bukkit event listeners from classes to objects (Kotlin best practice)
- Improved example plugin robustness by using dynamic world name instead of hardcoded value
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| surf-npc-paper/src/main/kotlin/dev/slne/surf/npc/paper/service/StorageService.kt | Added persistence check guard and fixed missing entityType field in save method |
| surf-npc-paper/src/main/kotlin/dev/slne/surf/npc/paper/listener/WorldChangeListener.kt | Converted from class to object for singleton pattern |
| surf-npc-paper/src/main/kotlin/dev/slne/surf/npc/paper/listener/InternalNpcEventListener.kt | Converted from class to object for singleton pattern |
| surf-npc-paper/src/main/kotlin/dev/slne/surf/npc/paper/listener/FoliaAdditionsListener.kt | New listener for handling Folia-specific teleport events through Canvas API |
| surf-npc-paper/src/main/kotlin/dev/slne/surf/npc/paper/listener/ConnectionListener.kt | Converted from class to object for singleton pattern |
| surf-npc-paper/src/main/kotlin/dev/slne/surf/npc/paper/PaperMain.kt | Updated listener registration, added Canvas server detection, and conditional Folia listener registration |
| surf-npc-paper/build.gradle.kts | Added Canvas API dependency and repository with proper capability resolution |
| surf-npc-example-dsl/src/main/kotlin/dev/slne/surf/npc/example/SurfNpcExamplePlugin.kt | Changed hardcoded world name to dynamic retrieval for better robustness |
| gradle.properties | Bumped version from 1.6.0 to 1.6.1 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.