mirror of
https://github.com/HibiscusMC/HibiscusCommons.git
synced 2025-12-30 04:19:17 +00:00
feat: make nbt data added to itemstack
This commit is contained in:
@@ -333,6 +333,12 @@ public class ItemBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
if (!nbtData.isEmpty()) {
|
||||
for (String key : nbtData.keySet()) {
|
||||
meta.getPersistentDataContainer().set(NamespacedKey.minecraft(key), PersistentDataType.STRING, nbtData.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
if (meta instanceof Colorable colorable) {
|
||||
if (color != null) colorable.setColor(DyeColor.getByColor(color));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user