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

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

Type: New Feature Priority: Minor
Reporter: Javier Flores Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: 1.21.5, bug, craftbukkit
Environment:

Not relevant


Issue Links:
Duplicate
duplicates SPIGOT-8031 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.

Meant to open this in the CraftBukkit project, apologies


Generated at Tue Apr 22 14:11:42 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.