use of org.bukkit.craftbukkit.v1_13_R2.inventory.tags.CraftCustomItemTagContainer in project MechanicsMain by WeaponMechanics.
the class NBT_1_13_R2 method getBukkitCompound.
private CustomItemTagContainer getBukkitCompound(ItemMeta meta, String plugin) {
if (plugin == null) {
meta.getCustomTagContainer();
}
NamespacedKey key = new NamespacedKey(MechanicsCore.getPlugin(), plugin);
CustomItemTagContainer nbt = meta.getCustomTagContainer().getCustomTag(key, ItemTagType.TAG_CONTAINER);
if (nbt == null) {
nbt = new CraftCustomItemTagContainer(new CraftCustomTagTypeRegistry());
meta.getCustomTagContainer().setCustomTag(key, ItemTagType.TAG_CONTAINER, nbt);
}
return nbt;
}
Aggregations