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;
2019-10-20 22:30:49 +02:00
import net.minecraft.block.BlockState;
import net.minecraft.item.Items;
2018-10-18 17:12:20 +02:00
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;
2019-10-20 22:30:49 +02:00
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
2018-10-14 16:12:33 +02:00
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
2019-10-20 22:30:49 +02:00
public boolean isOpaqueCube(BlockState state) {
2018-10-14 16:12:33 +02:00
return false;
}
2018-10-18 17:12:20 +02:00
@Override
2019-10-20 22:30:49 +02:00
@OnlyIn(Dist.CLIENT)
2018-10-14 16:12:33 +02:00
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT_MIPPED;
}
@Override
2019-10-20 22:30:49 +02:00
public void updateTick(World worldIn, BlockPos pos, BlockState state, Random random) {
2018-10-14 16:12:33 +02:00
if (!worldIn.isRemote) {
worldIn.setBlockToAir(pos);
}
}
2018-10-18 17:12:20 +02:00
@Override
2019-10-20 22:30:49 +02:00
public Item getItemDropped(BlockState state, Random rand, int fortune) {
2018-10-18 17:12:20 +02:00
return Items.AIR;
}
2018-10-14 16:12:33 +02:00
}