39 lines
1.3 KiB
Java
39 lines
1.3 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.mojang.serialization.MapCodec
|
|
*/
|
|
package net.minecraft.world.level.block;
|
|
|
|
import com.mojang.serialization.MapCodec;
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.core.particles.ParticleTypes;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.world.level.Level;
|
|
import net.minecraft.world.level.block.SpreadingSnowyDirtBlock;
|
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
|
import net.minecraft.world.level.block.state.BlockState;
|
|
|
|
public class MyceliumBlock
|
|
extends SpreadingSnowyDirtBlock {
|
|
public static final MapCodec<MyceliumBlock> CODEC = MyceliumBlock.simpleCodec(MyceliumBlock::new);
|
|
|
|
public MapCodec<MyceliumBlock> codec() {
|
|
return CODEC;
|
|
}
|
|
|
|
public MyceliumBlock(BlockBehaviour.Properties properties) {
|
|
super(properties);
|
|
}
|
|
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
super.animateTick(state, level, pos, random);
|
|
if (random.nextInt(10) == 0) {
|
|
level.addParticle(ParticleTypes.MYCELIUM, (double)pos.getX() + random.nextDouble(), (double)pos.getY() + 1.1, (double)pos.getZ() + random.nextDouble(), 0.0, 0.0, 0.0);
|
|
}
|
|
}
|
|
}
|
|
|