Reorganized Imports/Packages
This commit is contained in:
parent
a8beba9196
commit
770a5b4046
854 changed files with 42775 additions and 41811 deletions
|
@ -0,0 +1,47 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
public class UmbrellaTreeClusterEmptyBlock extends BaseBlock {
|
||||
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
|
||||
|
||||
public UmbrellaTreeClusterEmptyBlock() {
|
||||
super(FabricBlockSettings
|
||||
.copyOf(Blocks.NETHER_WART_BLOCK)
|
||||
.mapColor(MaterialColor.COLOR_PURPLE)
|
||||
.randomTicks()
|
||||
);
|
||||
registerDefaultState(stateDefinition.any().setValue(NATURAL, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||
stateManager.add(NATURAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
if (state.getValue(NATURAL) && random.nextInt(16) == 0) {
|
||||
BlocksHelper.setWithUpdate(
|
||||
world,
|
||||
pos,
|
||||
EndBlocks.UMBRELLA_TREE_CLUSTER.defaultBlockState().setValue(UmbrellaTreeClusterBlock.NATURAL, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue