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.world.features;
import java.util.Random;
import net.minecraft.state.property.Properties;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.betterend.blocks.BlockProperties;
@ -31,15 +30,16 @@ public class NeonCactusFeature extends DefaultFeature {
break;
}
int size = (h - i) >> 2;
BlocksHelper.setWithUpdate(world, mut, EndBlocks.NEON_CACTUS.defaultBlockState()
.with(BlockProperties.TRIPLE_SHAPE, getBySize(size)).with(Properties.FACING, Direction.UP));
BlocksHelper.setWithUpdate(world, mut,
EndBlocks.NEON_CACTUS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, getBySize(size))
.setValue(BlockStateProperties.FACING, Direction.UP));
if (i > 2 && i < (h - 1) && random.nextBoolean()) {
int length = h - i - MHelper.randRange(1, 2, random);
if (length > 0) {
Direction dir2 = hor;
hor = hor.getClockWise();
int bsize = i > ((h << 1) / 3) ? 0 : size > 1 ? 1 : size;
branch(world, mut.offset(dir2), dir2, random, length, bsize);
branch(world, mut.relative(dir2), dir2, random, length, bsize);
}
}
mut.move(Direction.UP);
@ -56,8 +56,9 @@ public class NeonCactusFeature extends DefaultFeature {
if (!world.getBlockState(mut).getMaterial().isReplaceable()) {
return;
}
BlocksHelper.setWithUpdate(world, mut, EndBlocks.NEON_CACTUS.defaultBlockState()
.with(BlockProperties.TRIPLE_SHAPE, getBySize(size)).with(Properties.FACING, dir));
BlocksHelper.setWithUpdate(world, mut,
EndBlocks.NEON_CACTUS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, getBySize(size))
.setValue(BlockStateProperties.FACING, dir));
if (i == rotIndex) {
dir = Direction.UP;
size--;
@ -65,7 +66,7 @@ public class NeonCactusFeature extends DefaultFeature {
if (i > 1 && i < (length - 1) && random.nextBoolean()) {
Direction dir2 = dir == Direction.UP ? hor : Direction.UP;
hor = hor.getClockWise();
branch(world, mut.offset(dir2), dir2, random, MHelper.randRange(length / 4, length / 2, random),
branch(world, mut.relative(dir2), dir2, random, MHelper.randRange(length / 4, length / 2, random),
size > 0 ? size - 1 : size);
}
mut.move(dir);