NaturesAura/src/main/java/de/ellpeck/naturesaura/blocks/BlockDecayedLeaves.java

40 lines
1.1 KiB
Java
Raw Normal View History

2018-10-14 16:12:33 +02:00
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.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);
}
public boolean isOpaqueCube(IBlockState state) {
return false;
}
@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);
}
}
}