package com.mrcrayfish.furniture.blocks; import com.mrcrayfish.furniture.MrCrayfishFurnitureMod; import com.mrcrayfish.furniture.tileentity.TileEntityDoorMat; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class BlockDoorMat extends BlockFurniture implements ITileEntityProvider { public BlockDoorMat(Material material) { super(material); this.setHardness(0.5F); this.setCreativeTab(MrCrayfishFurnitureMod.tabFurniture); } @Override public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { setBlockBounds(0F, 0F, 0F, 1F, 0.0625F, 1F); } @Override public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) { return null; } @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { if(placer instanceof EntityPlayer) { ((EntityPlayer) placer).openGui(MrCrayfishFurnitureMod.instance, 0, worldIn, pos.getX(), pos.getY(), pos.getZ()); } } @SideOnly(Side.CLIENT) public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityDoorMat(); } }