package fr.xephi.authme.events;

import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

import cn.citycraft.AuthMe.cache.backup.JsonCache;

/**
 * This event is call just before write inventory content to cache
 *
 * @author Xephi59
 */
public class StoreInventoryEvent extends CustomEvent {

	private ItemStack[] armor;
	private ItemStack[] inventory;
	private Player player;

	public StoreInventoryEvent(Player player) {
		this.player = player;
		this.inventory = player.getInventory().getContents();
		this.armor = player.getInventory().getArmorContents();
	}

	public StoreInventoryEvent(Player player, JsonCache jsonCache) {
		this.player = player;
		this.inventory = player.getInventory().getContents();
		this.armor = player.getInventory().getArmorContents();
	}

	public ItemStack[] getArmor() {
		return this.armor;
	}

	public ItemStack[] getInventory() {
		return this.inventory;
	}

	public Player getPlayer() {
		return this.player;
	}

	public void setArmor(ItemStack[] armor) {
		this.armor = armor;
	}

	public void setInventory(ItemStack[] inventory) {
		this.inventory = inventory;
	}

	public void setPlayer(Player player) {
		this.player = player;
	}
}
