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

49 lines
1.3 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;
2018-10-18 17:12:20 +02:00
import net.minecraft.init.Items;
import net.minecraft.item.Item;
2018-10-14 16:12:33 +02:00
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);
}
2018-10-18 17:12:20 +02:00
@Override
2018-10-14 16:12:33 +02:00
public boolean isOpaqueCube(IBlockState state) {
return false;
}
2018-10-18 17:12:20 +02:00
@Override
2018-10-14 16:12:33 +02:00
@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);
}
}
2018-10-18 17:12:20 +02:00
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return Items.AIR;
}
2018-10-14 16:12:33 +02:00
}