mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-06-01 19:23:36 +02:00
32 lines
1.2 KiB
Java
32 lines
1.2 KiB
Java
package de.ellpeck.naturesaura.blocks;
|
|
|
|
import de.ellpeck.naturesaura.data.BlockStateGenerator;
|
|
import de.ellpeck.naturesaura.reg.ICustomBlockState;
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.server.level.ServerLevel;
|
|
import net.minecraft.util.RandomSource;
|
|
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;
|
|
|
|
public class BlockDecayedLeaves extends BlockImpl implements ICustomBlockState {
|
|
|
|
public BlockDecayedLeaves() {
|
|
super("decayed_leaves", Properties.of(Material.LEAVES).strength(0.2F).sound(SoundType.GRASS).noOcclusion().randomTicks());
|
|
}
|
|
|
|
@Override
|
|
@SuppressWarnings("deprecation")
|
|
public void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
|
|
if (!level.isClientSide) {
|
|
level.setBlockAndUpdate(pos, Blocks.AIR.defaultBlockState());
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void generateCustomBlockState(BlockStateGenerator generator) {
|
|
generator.simpleBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName())));
|
|
}
|
|
}
|