[SPIGOT-4122] Two equal items are not equal if the plugin is running in "compatibility mode" Created: 23/Jul/18  Updated: 23/Jul/18  Resolved: 23/Jul/18

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Simon Brungs Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.13, InventoryClickEvent, itemstack

Version: git-Spigot-a85f7ec-5870145 (MC: 1.13)

 Description   

This bug only exists if the plugin is using in "compatibility mode" ("api-version: 1.13" was not added to the plugin.yml). If it is not running in "compatibility mode" everything is working correctly.

If I am putting an item into the inventory and the user clicks on it and my plugin is listening to the InventoryClickEvent and I am using equal to check if the item, which the player clicked on, is equal with the item, which I did put into the inventory, it tells me that they are not equal even though they obviously are equal.

To prove that the bug exists I created a very small plugin which opens up an inventory with one item. If you click onto the item it is checking if the item you clicked on is equal to the one which was placed into the inventory, by using the equal method. It can be dowloaded from https://github.com/Simonsator/ItemDoesNotEqualItself/releases and the src code can be found here https://github.com/Simonsator/ItemDoesNotEqualItself 



 Comments   
Comment by md_5 [ 23/Jul/18 ]

I think this is practically impossible to fix in the general case.
I have solved this instance, but it will probably still fall over if you use for example a stone with data values.

Take this as a sign to update, c.f. "best effort".

Generated at Sat Dec 13 11:49:55 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.