package projectzombie.items;

import projectzombie.entity.EntityTnt;
import projectzombie.entity.player.EntityPlayer;
import projectzombie.init.Models;
import projectzombie.model.ModelItem;
import projectzombie.util.math.ItemStack;
import projectzombie.world.chunk.Chunk;
import projectzombie.world.layer.Layer;

public class ItemTnt extends Item
{
	@Override
	public ModelItem getModel(short meta) {
		return Models.ITEM_TNT;
	}

	@Override
	public String getName(short meta) {
		return "TNT";
	}
	
	@Override
	public boolean onPlayerRightClick(ItemStack stack, Layer layer, Chunk chunk, EntityPlayer player) {
		layer.spawnEntity(new EntityTnt(player.getPos(), player.getVelocity(), player.angle, stack.meta, 5000));
		stack.count -= 1;
		return true;
	}

}
