package common.block;

import common.entity.Entity;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.material.Material;
import common.model.BlockLayer;
import common.model.Model;
import common.model.ModelProvider;
import common.rng.Random;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.world.State;
import common.world.World;

public class BlockWeb extends Block
{
    public BlockWeb()
    {
        super(Material.web);
        this.setTab(CheatTab.tabDeco);
    }

    /**
     * Called When an Entity Collided with the Block
     */
    public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
    {
        entityIn.setInWeb();
    }

    /**
     * Used to determine ambient occlusion and culling when rebuilding chunks for render
     */
    public boolean isOpaqueCube()
    {
        return false;
    }

    public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
    {
        return null;
    }

    public boolean isFullCube()
    {
        return false;
    }

    /**
     * Get the Item that this Block should drop when harvested.
     */
    public Item getItemDropped(State state, Random rand, int fortune)
    {
        return Items.string;
    }

    public boolean canSilkHarvest()
    {
        return true;
    }

    public BlockLayer getBlockLayer()
    {
        return BlockLayer.CUTOUT;
    }

    public Model getModel(ModelProvider provider, String name, State state) {
    	return provider.getModel("web").cross();
    }
}
