28 lines
1.4 KiB
Java
28 lines
1.4 KiB
Java
package net.minecraft.world.level.levelgen.placement;
|
|
|
|
import net.minecraft.world.level.levelgen.feature.configurations.DecoratorConfiguration;
|
|
import net.minecraft.world.level.levelgen.Heightmap;
|
|
import java.util.stream.Stream;
|
|
import net.minecraft.core.BlockPos;
|
|
import java.util.Random;
|
|
import net.minecraft.world.level.levelgen.ChunkGeneratorSettings;
|
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
|
import net.minecraft.world.level.LevelAccessor;
|
|
import com.mojang.datafixers.Dynamic;
|
|
import java.util.function.Function;
|
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneDecoratorConfiguration;
|
|
|
|
public class TopSolidHeightMapDecorator extends FeatureDecorator<NoneDecoratorConfiguration> {
|
|
public TopSolidHeightMapDecorator(final Function<Dynamic<?>, ? extends NoneDecoratorConfiguration> function) {
|
|
super(function);
|
|
}
|
|
|
|
@Override
|
|
public Stream<BlockPos> getPositions(final LevelAccessor bju, final ChunkGenerator<? extends ChunkGeneratorSettings> bzx, final Random random, final NoneDecoratorConfiguration cgr, final BlockPos fk) {
|
|
final int integer7 = random.nextInt(16) + fk.getX();
|
|
final int integer8 = random.nextInt(16) + fk.getZ();
|
|
final int integer9 = bju.getHeight(Heightmap.Types.OCEAN_FLOOR_WG, integer7, integer8);
|
|
return Stream.<BlockPos>of(new BlockPos(integer7, integer9, integer8));
|
|
}
|
|
}
|