Add optional PacketEvents-backed client-only item lore event#5
Conversation
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/8822c59a-59a9-45ee-a72d-512375ae2f3f Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/8822c59a-59a9-45ee-a72d-512375ae2f3f Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/8822c59a-59a9-45ee-a72d-512375ae2f3f Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/8822c59a-59a9-45ee-a72d-512375ae2f3f Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/8822c59a-59a9-45ee-a72d-512375ae2f3f Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/8822c59a-59a9-45ee-a72d-512375ae2f3f Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
ericlmao
left a comment
There was a problem hiding this comment.
@copilot remove the optional Proxy bridge and purely keep this on the Paper module and remove the reflection and use the actual library
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/d295e053-2e1a-41c9-96a5-35b0484b0876 Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/d295e053-2e1a-41c9-96a5-35b0484b0876 Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/d295e053-2e1a-41c9-96a5-35b0484b0876 Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Updated in 64e73da — the reflection/proxy bridge is removed, and the Paper module now uses the direct PacketEvents API with a real PacketEvents dependency. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Adds a new Paper-side Bukkit event to mutate item lore only in the client view by intercepting outgoing inventory packets via PacketEvents and rewriting the packet item copy before send.
Changes:
- Introduces
ClientItemLoreEventfor client-only lore mutation APIs (setLore,addLoreLine,clearLore). - Adds a PacketEvents-backed outgoing packet bridge to fire the event for
SET_SLOTandWINDOW_ITEMSand rewrite packet items. - Wires PacketEvents dependency + CodeMC repos, and hooks bridge lifecycle into
PaperPlugin.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
paper/src/main/java/games/negative/engine/paper/PaperPlugin.java |
Instantiates/enables the PacketEvents bridge on enable and disables it on shutdown. |
paper/src/main/java/games/negative/engine/paper/event/ClientItemLorePacketBridge.java |
Implements PacketEvents listener to intercept outgoing inventory packets, fire Bukkit event, and rewrite packet item lore. |
paper/src/main/java/games/negative/engine/paper/event/ClientItemLoreEvent.java |
Defines the Bukkit event contract and client-lore mutation API. |
paper/build.gradle.kts |
Adds packetevents-spigot as a compileOnly dependency for the Paper module. |
build.gradle.kts |
Adds CodeMC repositories to resolve PacketEvents artifacts. |
gradlew |
Adds the Gradle wrapper shell script to the repository. |
…emLorePacketBridge.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot Make it so PacketEvents is NOT required but loads another class manually if packetevents is present. That class will contain the actual PacketEvents logic |
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/9184cf9a-05f1-48d2-bf80-cb7d6d220afb Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/9184cf9a-05f1-48d2-bf80-cb7d6d220afb Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Updated in 6db09c6 — Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Remove the use of reflection |
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/3328740a-1875-4942-b701-9c0abcbefeb1 Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/3328740a-1875-4942-b701-9c0abcbefeb1 Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/3328740a-1875-4942-b701-9c0abcbefeb1 Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/3328740a-1875-4942-b701-9c0abcbefeb1 Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
Updated in b587bdb — the optional PacketEvents bridge no longer uses reflection and now directly instantiates the PacketEvents-specific loader behind guarded runtime checks. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot bump the version of the paper module please to 1.2.0 |
Agent-Logs-Url: https://github.com/negative-games/plugin-engine/sessions/3a26caa5-0cd4-4424-bdcf-3b45a6d52b26 Co-authored-by: ericlmao <60104846+ericlmao@users.noreply.github.com>
This adds a Bukkit event for mutating item lore in the client view only. When PacketEvents is present, outgoing inventory item packets are intercepted, exposed through the Bukkit event bus, and rewritten without modifying the server-side
ItemStack.New client-view lore event
ClientItemLoreEventin the Paper module.PlayersetLore,addLoreLine,clearLore)Optional PacketEvents bridge
ClientItemLorePacketBridge.SET_SLOTandWINDOW_ITEMSpackets.ItemStack, firesClientItemLoreEvent, then rewrites only the packet copy.Dependency wiring
Plugin lifecycle integration
PaperPluginenable/disable lifecycle.Server/client item separation
Example listener:
> [!WARNING]
>
>