Start migration

This commit is contained in:
Aleksey 2021-04-08 21:55:07 +03:00
parent 6630ce0cab
commit 47ed597358
491 changed files with 12045 additions and 11953 deletions

View file

@ -3,7 +3,7 @@ package ru.betterend.blocks;
import java.util.Random;
import net.minecraft.fluid.Fluids;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.UnderwaterPlantWithAgeBlock;
@ -14,16 +14,19 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
@Override
public void grow(StructureWorldAccess world, Random random, BlockPos pos) {
if (canGrow(world, pos)) {
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.END_LILY.getDefaultState().with(EndLilyBlock.SHAPE, TripleShape.BOTTOM));
BlocksHelper.setWithoutUpdate(world, pos,
EndBlocks.END_LILY.defaultBlockState().with(EndLilyBlock.SHAPE, TripleShape.BOTTOM));
BlockPos up = pos.up();
while (world.getFluidState(up).isStill()) {
BlocksHelper.setWithoutUpdate(world, up, EndBlocks.END_LILY.getDefaultState().with(EndLilyBlock.SHAPE, TripleShape.MIDDLE));
BlocksHelper.setWithoutUpdate(world, up,
EndBlocks.END_LILY.defaultBlockState().with(EndLilyBlock.SHAPE, TripleShape.MIDDLE));
up = up.up();
}
BlocksHelper.setWithoutUpdate(world, up, EndBlocks.END_LILY.getDefaultState().with(EndLilyBlock.SHAPE, TripleShape.TOP));
BlocksHelper.setWithoutUpdate(world, up,
EndBlocks.END_LILY.defaultBlockState().with(EndLilyBlock.SHAPE, TripleShape.TOP));
}
}
private boolean canGrow(StructureWorldAccess world, BlockPos pos) {
BlockPos up = pos.up();
while (world.getBlockState(up).getFluidState().getFluid().equals(Fluids.WATER.getStill())) {