flokol120 / Spigot-Item-Chest-Sorter

A Spigot/Paper minecraft plugin to sort your messy items into separate chests | 💯% written in Kotlin
GNU General Public License v3.0
5 stars 6 forks source link

1.16.4 error #16

Closed ghost closed 3 years ago

ghost commented 3 years ago

I get the following error when using on Paper 1.16.4

[17:37:35 ERROR]: Could not pass event InventoryCloseEvent to Item-Chest-Sorter v1.7.2 java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_16_R3.block.CraftBlockState cannot be cast to class org.bukkit.block.Container (org.bukkit.craftbukkit.v1_16_R3.block.CraftBlockState and org.bukkit.block.Container are in unnamed module of loader 'app')

I have not been able to figure out the causation or what it is correlated to.

flokol120 commented 3 years ago

This plugin does not support Paper (see #15). If the problem persists with an official spigot build, feel free to re-open this issue.

ghost commented 3 years ago

1.16.4 spigot experiences a similar issue when (I think) breaking or adding chest. I think the best way to replicate the bug is break a double chest and then replace it running the opposite direction. But it seems to occur in a few different instances.

Could not pass event InventoryCloseEvent to Item-Chest-Sorter v1.7.2 org.bukkit.event.EventException: null

...

Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_16_R3.block.CraftBlockState cannot be cast to class org.bukkit.block.Container (org.bukkit.craftbukkit.v1_16_R3.block.CraftBlockState and org.bukkit.block.Container are in unnamed module of loader 'app')

flokol120 commented 3 years ago

@IgnorantMountaineer I just tested the newest version with 1.16.4. I cannot replicate your issue. If the error would be thrown when breaking and relocating the chest without removing it with the right tool, I would say that this is okay, as you are supposed to not break chests without removing them properly. But Even when replacing a double chest with one facing the other direction, everything works as expected. If you were to replace the double chest with a single chest then this error is explainable but as stated above this is not supported.

ghost commented 3 years ago

@flokol120 That's totally fair, and you're right, it doesn't cause any break in functionality that I can tell. I was just trying to thoroughly test the plugin before switching to it. One suggestion for future iterations: prevent individuals from breaking the chest before removing it instead of throwing an error.

But the plugin is great, thank you for all your hard work for free, we all appreciate it.

flokol120 commented 3 years ago

@IgnorantMountaineer thanks! That is indeed a good Feature idea for public servers. I will take a look into it.

flokol120 commented 3 years ago

@IgnorantMountaineer The new version should fix your issue. Could you please test it and report back (https://github.com/flokol120/Spigot-Item-Chest-Sorter/releases/tag/1.7.3)?

ghost commented 3 years ago

Yes, this does appear to fix the issue. Thanks so much!