Continue mapping migration

This commit is contained in:
Aleksey 2021-04-12 21:38:22 +03:00
parent 99ade39404
commit f03fd03bd0
499 changed files with 12567 additions and 12723 deletions

View file

@ -1,12 +1,11 @@
package ru.betterend.blocks;
import java.util.Random;
import net.minecraft.world.level.block.AbstractBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
import ru.betterend.blocks.basis.FurBlock;
@ -22,40 +21,34 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
if (h < height + 1) {
return;
}
BlocksHelper.setWithoutUpdate(world, pos,
EndBlocks.BLUE_VINE.defaultBlockState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM));
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM));
for (int i = 1; i < height; i++) {
BlocksHelper.setWithoutUpdate(world, pos.up(i),
EndBlocks.BLUE_VINE.defaultBlockState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE));
BlocksHelper.setWithoutUpdate(world, pos.above(i), EndBlocks.BLUE_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE));
}
BlocksHelper.setWithoutUpdate(world, pos.up(height),
EndBlocks.BLUE_VINE.defaultBlockState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP));
placeLantern(world, pos.up(height + 1));
BlocksHelper.setWithoutUpdate(world, pos.above(height), EndBlocks.BLUE_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP));
placeLantern(world, pos.above(height + 1));
}
private void placeLantern(WorldGenLevel world, BlockPos pos) {
BlocksHelper.setWithoutUpdate(world, pos,
EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().with(BlueVineLanternBlock.NATURAL, true));
for (Direction dir : BlocksHelper.HORIZONTAL) {
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true));
for (Direction dir: BlocksHelper.HORIZONTAL) {
BlockPos p = pos.relative(dir);
if (world.isAir(p)) {
BlocksHelper.setWithoutUpdate(world, p,
EndBlocks.BLUE_VINE_FUR.defaultBlockState().with(FurBlock.FACING, dir));
if (world.isEmptyBlock(p)) {
BlocksHelper.setWithoutUpdate(world, p, EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, dir));
}
}
if (world.isAir(pos.up())) {
BlocksHelper.setWithoutUpdate(world, pos.up(),
EndBlocks.BLUE_VINE_FUR.defaultBlockState().with(FurBlock.FACING, Direction.UP));
if (world.isEmptyBlock(pos.above())) {
BlocksHelper.setWithoutUpdate(world, pos.above(), EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.UP));
}
}
@Override
protected boolean isTerrain(BlockState state) {
return state.is(EndBlocks.END_MOSS) || state.is(EndBlocks.END_MYCELIUM);
}
@Override
public AbstractBlock.OffsetType getOffsetType() {
return AbstractBlock.OffsetType.NONE;
public BlockBehaviour.OffsetType getOffsetType() {
return BlockBehaviour.OffsetType.NONE;
}
}