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

@ -2,11 +2,11 @@ package ru.betterend.world.features;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.AttachedBlock;
import ru.betterend.blocks.basis.EndWallPlantBlock;
@ -14,7 +14,7 @@ import ru.betterend.util.BlocksHelper;
public class WallPlantFeature extends WallScatterFeature {
private final Block block;
public WallPlantFeature(Block block, int radius) {
super(radius);
this.block = block;
@ -23,23 +23,21 @@ public class WallPlantFeature extends WallScatterFeature {
@Override
public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos pos, Direction dir) {
if (block instanceof EndWallPlantBlock) {
BlockState state = block.getDefaultState().with(EndWallPlantBlock.FACING, dir);
BlockState state = block.defaultBlockState().with(EndWallPlantBlock.FACING, dir);
return block.canPlaceAt(state, world, pos);
} else if (block instanceof AttachedBlock) {
BlockState state = block.defaultBlockState().with(Properties.FACING, dir);
return block.canPlaceAt(state, world, pos);
}
else if (block instanceof AttachedBlock) {
BlockState state = block.getDefaultState().with(Properties.FACING, dir);
return block.canPlaceAt(state, world, pos);
}
return block.canPlaceAt(block.getDefaultState(), world, pos);
return block.canPlaceAt(block.defaultBlockState(), world, pos);
}
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos pos, Direction dir) {
BlockState state = block.getDefaultState();
BlockState state = block.defaultBlockState();
if (block instanceof EndWallPlantBlock) {
state = state.with(EndWallPlantBlock.FACING, dir);
}
else if (block instanceof AttachedBlock) {
} else if (block instanceof AttachedBlock) {
state = state.with(Properties.FACING, dir);
}
BlocksHelper.setWithoutUpdate(world, pos, state);