()
| 214 | } |
| 215 | |
| 216 | public Map<String, Object> serialize() { |
| 217 | Map<String, Object> result = new LinkedHashMap<String, Object>(); |
| 218 | |
| 219 | result.put("type", getType()); |
| 220 | |
| 221 | if (durability != 0) { |
| 222 | result.put("damage", durability); |
| 223 | } |
| 224 | |
| 225 | if (amount != 1) { |
| 226 | result.put("amount", amount); |
| 227 | } |
| 228 | |
| 229 | return result; |
| 230 | } |
| 231 | |
| 232 | public static ItemStack deserialize(Map<String, Object> args) { |
| 233 | Material type = Material.getMaterial((String)args.get("type")); |