2018-10-14 16:12:33 +02:00
|
|
|
package de.ellpeck.naturesaura.blocks;
|
|
|
|
|
2020-01-29 00:40:28 +01:00
|
|
|
import de.ellpeck.naturesaura.data.BlockStateGenerator;
|
|
|
|
import de.ellpeck.naturesaura.reg.ICustomBlockState;
|
2021-12-15 14:26:42 +01:00
|
|
|
import net.minecraft.core.BlockPos;
|
|
|
|
import net.minecraft.server.level.ServerLevel;
|
2022-06-27 15:24:04 +02:00
|
|
|
import net.minecraft.util.RandomSource;
|
2021-12-15 14:26:42 +01:00
|
|
|
import net.minecraft.world.level.block.Blocks;
|
|
|
|
import net.minecraft.world.level.block.SoundType;
|
|
|
|
import net.minecraft.world.level.block.state.BlockState;
|
|
|
|
import net.minecraft.world.level.material.Material;
|
2018-10-14 16:12:33 +02:00
|
|
|
|
2022-08-01 16:14:37 +02:00
|
|
|
public class BlockDecayedLeaves extends BlockImpl implements ICustomBlockState {
|
2018-10-14 16:12:33 +02:00
|
|
|
|
|
|
|
public BlockDecayedLeaves() {
|
2021-12-15 14:26:42 +01:00
|
|
|
super("decayed_leaves", Properties.of(Material.LEAVES).strength(0.2F).sound(SoundType.GRASS).noOcclusion().randomTicks());
|
2018-10-14 16:12:33 +02:00
|
|
|
}
|
|
|
|
|
2018-10-18 17:12:20 +02:00
|
|
|
@Override
|
2022-06-27 15:24:04 +02:00
|
|
|
public void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
|
2021-12-04 15:40:09 +01:00
|
|
|
if (!level.isClientSide) {
|
2021-12-15 14:26:42 +01:00
|
|
|
level.setBlockAndUpdate(pos, Blocks.AIR.defaultBlockState());
|
2018-10-14 16:12:33 +02:00
|
|
|
}
|
|
|
|
}
|
2020-01-28 18:08:56 +01:00
|
|
|
|
2020-01-29 00:40:28 +01:00
|
|
|
@Override
|
|
|
|
public void generateCustomBlockState(BlockStateGenerator generator) {
|
|
|
|
generator.simpleBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName())));
|
|
|
|
}
|
2018-10-14 16:12:33 +02:00
|
|
|
}
|