retrooper / packetevents

Precision meets performance—a powerful tool for mastering Minecraft packet manipulation with speed and finesse.
GNU General Public License v3.0
528 stars 152 forks source link

IndexOutOfBoundsException in PacketEvents while using Matrix #1029

Open thisisaef opened 4 days ago

thisisaef commented 4 days ago

Describe the bug When executing the /ecoenchants gui command and I select the special enchantment book, I get kicked off the server when clicking the special enchantment book. Matrix throws an IndexOutOfBoundsException related to packet handling, which seems to occur when handling the window event when clicking the enchantment book, causing the Netty buffer to crash during the processing of the item data.

Software brand Paper version 1.21.1-120-master@57c75a4

Velocity Version Velocity 3.3.0-SNAPSHOT (git-2016d148-b436)

Plugins Spark profile#1: https://spark.lucko.me/bDBUBmexU8

1 packetevents (v2.5.0)

Spark profile#2: https://spark.lucko.me/cur98ZyVSd

2 packetevents (v2.5.1+e13632774-SNAPSHOT)

How To Reproduce Steps to reproduce the behavior:

  1. Install the Matrix plugin alongside EcoEnchants.
  2. Execute the /ecoenchants gui command.
  3. When selecting the special enchantment book in the GUI window,
  4. Observe the server logs for the IndexOutOfBoundsException error.

Expected behavior The plugin should open /ecoenchants gui and use the special enchantment book without crashing or throwing any exceptions, allowing the game to run smoothly.

Actual Behavior The server throws IndexOutOfBoundsException and logs an error stack trace when trying to read from the packet buffer, resulting in the inability to use the special enchantment book in the EcoEnchants GUI window properly.

Screenshots https://github.com/user-attachments/assets/fcc23773-7901-4c25-adfd-f351e51d3674

Additional context It seems to be a problem when Matrix interacts with packets related to the interaction of items in EcoEnchants custom configuration integration. I have tested with Matrix developer, he helped me fully with the Matrix protection plugin. He said that this has a problem with packetevents-spigot-2.5.0 & packetevents-velocity-2.5.0, you guys who developed packetevents need to help fix this.

thisisaef commented 4 days ago

When I bounce out of this issue, I get a notification in the chat box like this:

image

thisisaef commented 4 days ago

report the bug to packetevents Matrix is using packetevents 2.5.1 snapshot bug error: https://paste.helpch.at/ledoyeveyi.css

booky10 commented 2 days ago

I can't reproduce this issue using the latest packetevents build and latest ecoenchants version I can't test this using Matrix, as Matrix is not available for free and also closed-source

https://github.com/user-attachments/assets/f57105d0-445c-4c53-9b4e-4267c2e47b8d

Are you running the latest Matrix version and does Matrix use the latest packetevents build?