package io.github.vayleryn.vaylerynessentials;

import io.github.vayleryn.vaylerynlib.plugin.essentials.Kit;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

public class KitImpl implements Kit, ConfigurationSerializable {
	
	private Collection<ItemStack> items = new ArrayList<ItemStack>();
	
	@Override
	public void give(Player player) {
		player.getInventory().addItem((ItemStack[]) items.toArray());
	}

	@Override
	public Collection<ItemStack> getItems() {
		return items;
	}
	
	@Override
	public Map<String, Object> serialize() {
		Map<String, Object> serialised = new HashMap<String, Object>();
		serialised.put("items", items);
		return serialised;
	}
	
	@SuppressWarnings("unchecked")
	public static KitImpl deserialize(Map<String, Object> serialised) {
		KitImpl deserialised = new KitImpl();
		deserialised.items = (Collection<ItemStack>) serialised.get("items");
		return deserialised;
	}
	
}

@@ -542,69 +542,82 @@
 %7B%0A%09%09
-player.getInventory().addItem((ItemStack%5B%5D) items.toArray());
+for (ItemStack item : items) %7B%0A%09%09%09player.getInventory().addItem(item);%0A%09%09%7D
 %0A%09%7D%0A

Remove impossible downcast