2018-10-14 16:12:33 +02:00
|
|
|
package de.ellpeck.naturesaura.blocks;
|
|
|
|
|
2019-11-04 19:08:49 +01:00
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.block.Blocks;
|
2018-10-14 16:12:33 +02:00
|
|
|
import net.minecraft.block.SoundType;
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
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() {
|
2019-11-04 19:08:49 +01:00
|
|
|
super("decayed_leaves", ModBlocks.prop(Material.LEAVES).hardnessAndResistance(0.2F).sound(SoundType.PLANT).variableOpacity().tickRandomly());
|
2018-10-14 16:12:33 +02:00
|
|
|
}
|
|
|
|
|
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-11-04 19:08:49 +01:00
|
|
|
public void tick(BlockState state, World world, BlockPos pos, Random random) {
|
|
|
|
if (!world.isRemote) {
|
|
|
|
world.setBlockState(pos, Blocks.AIR.getDefaultState());
|
2018-10-14 16:12:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|