Gets the MaterialData for this stack of items @return MaterialData for this item
()
| 169 | * @return MaterialData for this item |
| 170 | */ |
| 171 | @Nullable |
| 172 | public MaterialData getData() { |
| 173 | Material mat = Bukkit.getUnsafe().toLegacy(getType()); |
| 174 | if (data == null && mat != null && mat.getData() != null) { |
| 175 | data = mat.getNewData((byte) this.getDurability()); |
| 176 | } |
| 177 | |
| 178 | return data; |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * Sets the MaterialData for this stack of items |
no test coverage detected