[SPIGOT-8031] ItemMeta#setBlocksAttacks always sets the BlocksAttacksComponent to null Created: 30/Mar/25  Updated: 31/Mar/25  Resolved: 31/Mar/25

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

Type: Bug Priority: Minor
Reporter: Javier Flores Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.21.5, bug, craftbukkit
Environment:

not relevant


Issue Links:
Duplicate
is duplicated by BUILDTOOLS-726 ItemMeta#setBlocksAttacks always sets... Resolved
Version: CraftBukkit version 4473-Spigot-e339edc-20401f1 (MC: 1.21.5) (Implementing API version 1.21.5-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

The ItemMeta#setBlocksAttacks implementation checks whether the blocksAttacks field is null, and if so, it sets it to null, making it impossible to actually set the BlocksAttacksComponent of the ItemMeta, see:
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java#1628

I assume it was meant to reference the parameter blocksAttacks instead of the field,  removing the this keyword should be enough to fix this.


Generated at Tue Apr 15 09:41:34 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.