(@Nullable ItemMeta itemMeta, @NotNull Material material)
| 575 | * Cannot be overridden, so it's safe for constructor call |
| 576 | */ |
| 577 | private boolean setItemMeta0(@Nullable ItemMeta itemMeta, @NotNull Material material) { |
| 578 | if (itemMeta == null) { |
| 579 | this.meta = null; |
| 580 | return true; |
| 581 | } |
| 582 | if (!Bukkit.getItemFactory().isApplicable(itemMeta, material)) { |
| 583 | return false; |
| 584 | } |
| 585 | this.meta = Bukkit.getItemFactory().asMetaFor(itemMeta, material); |
| 586 | |
| 587 | Material newType = Bukkit.getItemFactory().updateMaterial(meta, material); |
| 588 | if (this.type != newType) { |
| 589 | this.type = newType; |
| 590 | } |
| 591 | |
| 592 | if (this.meta == itemMeta) { |
| 593 | this.meta = itemMeta.clone(); |
| 594 | } |
| 595 | |
| 596 | return true; |
| 597 | } |
| 598 | } |
no test coverage detected