use of org.bukkit.Utility in project Bukkit by Bukkit.
the class ItemStack method serialize.
@Utility
public Map<String, Object> serialize() {
Map<String, Object> result = new LinkedHashMap<String, Object>();
result.put("type", getType().name());
if (getDurability() != 0) {
result.put("damage", getDurability());
}
if (getAmount() != 1) {
result.put("amount", getAmount());
}
ItemMeta meta = getItemMeta();
if (!Bukkit.getItemFactory().equals(meta, null)) {
result.put("meta", meta);
}
return result;
}
Aggregations