/*******************************************************************************
* AbyssalCraft
* Copyright (c) 2012 - 2017 Shinoow.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
* Contributors:
* Shinoow - implementation
******************************************************************************/
package com.shinoow.abyssalcraft.common.blocks;
import java.util.Random;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import com.shinoow.abyssalcraft.common.blocks.tile.TileEntityShoggothBiomass;
import com.shinoow.abyssalcraft.common.entity.EntityLesserShoggoth;
import com.shinoow.abyssalcraft.lib.ACTabs;
public class BlockShoggothBiomass extends BlockContainer {
public BlockShoggothBiomass(){
super(Material.GROUND, MapColor.GREEN);
setHardness(1.0F);
setResistance(18.0F);
setSoundType(SoundType.SAND);
setUnlocalizedName("shoggothbiomass");
setCreativeTab(ACTabs.tabBlock);
setLightLevel(0.5F);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityShoggothBiomass();
}
@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
{
float f = 0.15F;
return new AxisAlignedBB(0, 0, 0, 1, 1 - f, 1);
}
@Override
public int quantityDropped(Random par1Random)
{
return 0;
}
@Override
public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player)
{
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
{
if(!(entity instanceof EntityLesserShoggoth)){
entity.motionX *= 0.4D;
entity.motionZ *= 0.4D;
}
}
}