fix: npc version parsing#1865
Conversation
Test Results 56 files ±0 56 suites ±0 4m 24s ⏱️ +20s Results for commit 90f0009. ± Comparison against base commit c019e30. This pull request removes 33 and adds 33 tests. Note that renamed tests count towards both. |
There was a problem hiding this comment.
Pull request overview
This PR fixes NPC packet-adapter selection on newer Paper/Minecraft versions by making the Bukkit version parsing more robust (handling version strings without -... suffixes) and centralizing adapter resolution behind a reusable utility. It also introduces a system-property override (cloudnet.npcs.packet-adapter) to explicitly choose between ProtocolLib and PacketEvents.
Changes:
- Added
BukkitPacketAdapterUtilto resolve thePlatformPacketAdapterusing safer version parsing and an optional system-property override. - Updated
BukkitPlatformNPCManagementto delegate packet-adapter resolution to the new utility.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| modules/npcs/impl/src/main/java/eu/cloudnetservice/modules/npc/impl/platform/bukkit/util/BukkitPacketAdapterUtil.java | New utility that resolves the NPC packet adapter via override and safer Bukkit version parsing. |
| modules/npcs/impl/src/main/java/eu/cloudnetservice/modules/npc/impl/platform/bukkit/BukkitPlatformNPCManagement.java | Switches adapter resolution to use the new shared utility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Motivation
Never minecraft versions (paper) use different naming which can only be retrieved using getBukkitVersion.
Modification
Allow setting the npc packet adapter using
cloudnet.npcs.packet-adapterResult
NPC version parsing works again