Skip to content

fix: npc version parsing#1865

Open
0utplay wants to merge 5 commits into
nightlyfrom
fix/npc-version-parsing
Open

fix: npc version parsing#1865
0utplay wants to merge 5 commits into
nightlyfrom
fix/npc-version-parsing

Conversation

@0utplay

@0utplay 0utplay commented Jun 18, 2026

Copy link
Copy Markdown
Member

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-adapter

Result

NPC version parsing works again

@0utplay 0utplay added this to the 4.0.0-RC17 milestone Jun 18, 2026
@0utplay 0utplay self-assigned this Jun 18, 2026
@0utplay 0utplay added v: 4.X This pull should be included in the 4.0 release t: fix A pull request introducing a fix for a bug. t: improvement The pull request improves existing code in: module An issue/pull request releated to one of the internal modules labels Jun 18, 2026
@github-actions

Copy link
Copy Markdown

Test Results

 56 files  ±0   56 suites  ±0   4m 24s ⏱️ +20s
571 tests ±0  571 ✅ ±0  0 💤 ±0  0 ❌ ±0 
938 runs  ±0  938 ✅ ±0  0 💤 ±0  0 ❌ ±0 

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.
eu.cloudnetservice.driver.impl.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"this":"is","insane":"!","hello":"world"}}, PRETTY
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [14] 2026-04-28
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [23] 13:33:45.008868332
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [28] 13:33:45.018531302Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [29] 13:33:45.018575835Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [30] 13:33:45.018634686+05:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [31] 13:33:45.018687154-03:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [34] 2026-04-28T13:33:45.018854418
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [39] 2026-04-28T13:33:45.019034306Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [4] 2026-04-28T13:33:44.994075202Z
…
eu.cloudnetservice.driver.impl.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"insane":"!","hello":"world","this":"is"}}, PRETTY
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [14] 2026-06-18
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [23] 17:07:41.295589388
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [28] 17:07:41.295716776Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [29] 17:07:41.295738116Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [30] 17:07:41.295771959+05:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [31] 17:07:41.295804680-03:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [34] 2026-06-18T17:07:41.295943920
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [39] 2026-06-18T17:07:41.296110560Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [4] 2026-06-18T17:07:41.285658289Z
…

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 BukkitPacketAdapterUtil to resolve the PlatformPacketAdapter using safer version parsing and an optional system-property override.
  • Updated BukkitPlatformNPCManagement to 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: module An issue/pull request releated to one of the internal modules t: fix A pull request introducing a fix for a bug. t: improvement The pull request improves existing code v: 4.X This pull should be included in the 4.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants