@Override public void save(DataKey key) { key.removeKey("list"); for (int i = 0; i < anchors.size(); i++) key.setString("list." + String.valueOf(i), anchors.get(i).stringValue()); }
private void saveOrRemove(DataKey key, ItemStack item) { if (item != null) ItemStorage.saveItem(key, item); else { if (key.keyExists("")) key.removeKey(""); } }