Fixed 'place'-Methods
This commit is contained in:
parent
4bf09362be
commit
a82f30b95d
17 changed files with 103 additions and 52 deletions
|
@ -8,6 +8,7 @@ import net.minecraft.core.Direction;
|
|||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.util.BlocksHelper;
|
||||
import ru.bclib.util.MHelper;
|
||||
|
@ -26,7 +27,10 @@ public abstract class WallScatterFeature extends DefaultFeature {
|
|||
public abstract void generate(WorldGenLevel world, Random random, BlockPos pos, Direction dir);
|
||||
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos center, NoneFeatureConfiguration featureConfig) {
|
||||
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
|
||||
Random random = featureConfig.random();
|
||||
BlockPos center = featureConfig.origin();
|
||||
WorldGenLevel world = featureConfig.level();
|
||||
int maxY = world.getHeight(Heightmap.Types.WORLD_SURFACE, center.getX(), center.getZ());
|
||||
int minY = BlocksHelper.upRay(world, new BlockPos(center.getX(), 0, center.getZ()), maxY);
|
||||
if (maxY < 10 || maxY < minY) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue