blob: ed4abcacd1e48caf8fb22e4f3c49b4854ac2158e [file] [log] [blame] [raw]
package us.myles.ViaVersion2.api.item;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.bukkit.inventory.ItemStack;
import org.spacehq.opennbt.tag.builtin.CompoundTag;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class Item {
private short id;
private byte amount;
private short data;
private CompoundTag tag;
public static Item getItem(ItemStack stack) {
if(stack == null) return null;
return new Item((short) stack.getTypeId(), (byte) stack.getAmount(), stack.getDurability(), null);
}
}