MCPcopy Create free account
hub / github.com/Bukkit/Bukkit / serialize

Method serialize

src/main/java/org/bukkit/inventory/ItemStack.java:216–230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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"));

Callers

nothing calls this directly

Calls 1

getTypeMethod · 0.95

Tested by

no test coverage detected