9
0
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:
LoJoSho
2024-02-23 14:12:33 -06:00
parent 5a5c60cd6a
commit afd81769f4

View File

@@ -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));
}