-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
None
-
git-Spigot-fe3ab0d-0611294 (MC: 1.13)
-
Yes
There might be something wrong with the backwards compatibility regarding the item conversion in legacy plugins: A legacy plugin used the following code to check if the player is holding a sign item in hand.
Reproduction code:
@EventHandler(priority = EventPriority.HIGHEST) void onPlayerInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); player.sendMessage("In hand: " + player.getItemInHand().getType()); player.sendMessage("Sign: " + Material.SIGN); player.sendMessage("Same type?: " + (player.getItemInHand().getType() == Material.SIGN)); }
The item in hand will report as 'LEGACY_SIGN_POST', while 'LEGACY_SIGN' would be expected / required for the plugin to continue working.
Edit: Not sure how one would 'fix' this.. since SIGN represents both the sign post block and the item now.. One would probably have to differently handle the legacy conversion for ItemStack#getType and Block#getType (if this isn't the case already).