package de.ellpeck.naturesaura.blocks; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.util.Random; public class BlockDecayedLeaves extends BlockImpl { public BlockDecayedLeaves() { super("decayed_leaves", Material.LEAVES); this.setTickRandomly(true); this.setHardness(0.2F); this.setLightOpacity(1); this.setSoundType(SoundType.PLANT); } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override @SideOnly(Side.CLIENT) public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT_MIPPED; } @Override public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random random) { if (!worldIn.isRemote) { worldIn.setBlockToAir(pos); } } @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Items.AIR; } }