ExceptedPrism3 / Logger

Log all Activities from Players or Server Side!
https://www.spigotmc.org/resources/logger.94236/
GNU Affero General Public License v3.0
40 stars 18 forks source link

Error in "Logger" Plugin v1.8.0.15 - ArrayIndexOutOfBoundsException during InventoryClickEvent #56

Open Mikeliro opened 3 weeks ago

Mikeliro commented 3 weeks ago

Describe the bug When a player has more than 27 inventory backups saved, attempting to view the inventory backup using the plugin "Logger" v1.8.0.15 results in an ArrayIndexOutOfBoundsException. The plugin fails to display the inventory backup,

To Reproduce Steps to reproduce the behavior:

  1. Tipe /logger:logger playerinventory
  2. Try to view one of the player's inventory backups by clicking on the player's head with more than 27 backups.
  3. The inventory backup fails to display, and the server log shows an ArrayIndexOutOfBoundsException.

Expected behavior The plugin should be able to handle more than 27 inventory backups and display the inventory backup correctly without throwing exceptions.

Screenshots N/A (The issue is evident in the server logs provided below.)

Server & Version (please complete the following information): Version: 1.21.1 Server Type: Purpur (Build 2296-568a028)

[11:14:47 ERROR]: Could not pass event InventoryClickEvent to Logger v1.8.0.15 java.lang.ArrayIndexOutOfBoundsException: Index 27 out of bounds for length 27 at java.base/java.util.Arrays$ArrayList.set(Arrays.java:4271) ~[?:?] at net.minecraft.core.NonNullList.set(NonNullList.java:50) ~[purpur-1.21.1.jar:1.21.1-2296-568a028] at org.bukkit.craftbukkit.inventory.CraftInventoryCustom$MinecraftInventory.setItem(CraftInventoryCustom.java:167) ~[purpur-1.21.1.jar:1.21.1-2296-568a028] at org.bukkit.craftbukkit.inventory.CraftInventory.setItem(CraftInventory.java:100) ~[purpur-1.21.1.jar:1.21.1-2296-568a028] at Logger-1.8.0.15.jar/me.prism3.logger.commands.subcommands.PlayerInventory.stepTwo(PlayerInventory.java:176) ~[Logger-1.8.0.15.jar:?] at Logger-1.8.0.15.jar/me.prism3.logger.commands.subcommands.PlayerInventory.onClick(PlayerInventory.java:113) ~[Logger-1.8.0.15.jar:?] ... Thank you for addressing this issue. Please let me know if you need any more details or if I can assist further with troubleshooting.