Block class rename
This commit is contained in:
parent
4b55bf30a8
commit
5f3547de8e
157 changed files with 748 additions and 756 deletions
|
@ -0,0 +1,39 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import ru.betterend.blocks.basis.BaseBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class UmbrellaTreeClusterEmptyBlock extends BaseBlock {
|
||||
public static final BooleanProperty NATURAL = BlockProperties.NATURAL;
|
||||
|
||||
public UmbrellaTreeClusterEmptyBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK)
|
||||
.materialColor(MaterialColor.PURPLE)
|
||||
.ticksRandomly());
|
||||
setDefaultState(stateManager.getDefaultState().with(NATURAL, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> stateManager) {
|
||||
stateManager.add(NATURAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
|
||||
if (state.get(NATURAL) && random.nextInt(16) == 0) {
|
||||
BlocksHelper.setWithUpdate(world, pos, EndBlocks.UMBRELLA_TREE_CLUSTER.getDefaultState().with(UmbrellaTreeClusterBlock.NATURAL, true));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue