Removed color provider
This commit is contained in:
parent
2c8862a37b
commit
4040597a6d
475 changed files with 5411 additions and 7521 deletions
|
@ -40,7 +40,6 @@ import ru.bclib.blocks.BlockProperties;
|
|||
import ru.bclib.util.BlocksHelper;
|
||||
import ru.betterend.blocks.entities.BlockEntityHydrothermalVent;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
@ -49,42 +48,38 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
|||
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
||||
private static final VoxelShape SHAPE = Block.box(1, 1, 1, 15, 16, 15);
|
||||
|
||||
|
||||
public HydrothermalVentBlock() {
|
||||
super(FabricBlockSettings.of(Material.STONE)
|
||||
.breakByTool(FabricToolTags.PICKAXES)
|
||||
.sound(SoundType.STONE)
|
||||
.noCollission()
|
||||
.requiresCorrectToolForDrops());
|
||||
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sound(SoundType.STONE).noCollission().requiresCorrectToolForDrops());
|
||||
this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, true).setValue(ACTIVATED, false));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
builder.add(WATERLOGGED, ACTIVATED);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean placeLiquid(LevelAccessor world, BlockPos pos, BlockState state, FluidState fluidState) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
state = world.getBlockState(pos.below());
|
||||
return state.is(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
if (!canSurvive(state, world, pos)) {
|
||||
|
@ -95,24 +90,24 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
|||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
LevelAccessor worldAccess = ctx.getLevel();
|
||||
BlockPos blockPos = ctx.getClickedPos();
|
||||
return this.defaultBlockState().setValue(WATERLOGGED, worldAccess.getFluidState(blockPos).getType() == Fluids.WATER);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public FluidState getFluidState(BlockState state) {
|
||||
return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
|
||||
return new BlockEntityHydrothermalVent(pos, state);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void tick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
||||
BlockPos up = pos.above();
|
||||
|
@ -121,14 +116,14 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
|||
world.getBlockTicks().scheduleTick(up, EndBlocks.VENT_BUBBLE_COLUMN, 5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {
|
||||
if (world instanceof ServerLevel && state.getValue(WATERLOGGED) && world.getBlockState(pos.above()).is(Blocks.WATER)) {
|
||||
tick(state, (ServerLevel) world, pos, world.random);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(BlockState state, Level world, BlockPos pos, Random random) {
|
||||
super.animateTick(state, world, pos, random);
|
||||
|
@ -139,7 +134,7 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
|||
world.addParticle(ParticleTypes.LARGE_SMOKE, x, y, z, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> blockEntityType) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue