()
| 449 | } |
| 450 | |
| 451 | @Override |
| 452 | @NotNull |
| 453 | @Utility |
| 454 | public Map<String, Object> serialize() { |
| 455 | Map<String, Object> result = new LinkedHashMap<String, Object>(); |
| 456 | |
| 457 | result.put("v", Bukkit.getUnsafe().getDataVersion()); // Include version to indicate we are using modern material names (or LEGACY prefix) |
| 458 | result.put("type", getType().name()); |
| 459 | |
| 460 | if (getAmount() != 1) { |
| 461 | result.put("amount", getAmount()); |
| 462 | } |
| 463 | |
| 464 | ItemMeta meta = getItemMeta(); |
| 465 | if (!Bukkit.getItemFactory().equals(meta, null)) { |
| 466 | result.put("meta", meta); |
| 467 | } |
| 468 | |
| 469 | return result; |
| 470 | } |
| 471 | |
| 472 | /** |
| 473 | * Required method for configuration serialization |
nothing calls this directly
no test coverage detected