use of net.minecraft.server.v1_16_R3.NBTTagLong in project WildLoaders by BG-Software-LLC.
the class NMSAdapter_v1_8_R3 method setTag.
@Override
public org.bukkit.inventory.ItemStack setTag(org.bukkit.inventory.ItemStack itemStack, String key, long value) {
ItemStack nmsItem = CraftItemStack.asNMSCopy(itemStack);
NBTTagCompound tagCompound = nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound();
tagCompound.set(key, new NBTTagLong(value));
nmsItem.setTag(tagCompound);
return CraftItemStack.asBukkitCopy(nmsItem);
}
use of net.minecraft.server.v1_16_R3.NBTTagLong in project custom-items-gradle by knokko.
the class ItemAttributes method setAttribute.
private static void setAttribute(NBTTagList modifiers, String name, double value, String slot, int operation) {
NBTTagCompound damage = new NBTTagCompound();
damage.set("AttributeName", new NBTTagString(name));
damage.set("Name", new NBTTagString(name));
damage.set("Amount", new NBTTagDouble(value));
damage.set("Operation", new NBTTagInt(operation));
long most = modifiers.size() + 1 + slot.hashCode() * name.hashCode();
long least = modifiers.size() + 1 + slot.hashCode() + name.hashCode();
if (most == 0)
most = -8;
if (least == 0)
least = 12;
damage.set("UUIDLeast", new NBTTagLong(least));
damage.set("UUIDMost", new NBTTagLong(most));
damage.set("Slot", new NBTTagString(slot));
modifiers.add(damage);
}
use of net.minecraft.server.v1_16_R3.NBTTagLong in project WildLoaders by BG-Software-LLC.
the class NMSAdapter_v1_7_R4 method setTag.
@Override
public org.bukkit.inventory.ItemStack setTag(org.bukkit.inventory.ItemStack itemStack, String key, long value) {
ItemStack nmsItem = CraftItemStack.asNMSCopy(itemStack);
NBTTagCompound tagCompound = nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound();
tagCompound.set(key, new NBTTagLong(value));
nmsItem.setTag(tagCompound);
return CraftItemStack.asBukkitCopy(nmsItem);
}
use of net.minecraft.server.v1_16_R3.NBTTagLong in project WildLoaders by BG-Software-LLC.
the class NMSAdapter_v1_12_R1 method setTag.
@Override
public org.bukkit.inventory.ItemStack setTag(org.bukkit.inventory.ItemStack itemStack, String key, long value) {
ItemStack nmsItem = CraftItemStack.asNMSCopy(itemStack);
NBTTagCompound tagCompound = nmsItem.hasTag() ? nmsItem.getTag() : new NBTTagCompound();
tagCompound.set(key, new NBTTagLong(value));
nmsItem.setTag(tagCompound);
return CraftItemStack.asBukkitCopy(nmsItem);
}
Aggregations