32 lines
1.3 KiB
Java
32 lines
1.3 KiB
Java
package net.minecraft.world.level.levelgen.placement;
|
|
|
|
import net.minecraft.world.level.levelgen.feature.configurations.DecoratorConfiguration;
|
|
import java.util.stream.IntStream;
|
|
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;
|
|
|
|
public class CountHeight64Decorator extends FeatureDecorator<FrequencyDecoratorConfiguration> {
|
|
public CountHeight64Decorator(final Function<Dynamic<?>, ? extends FrequencyDecoratorConfiguration> function) {
|
|
super(function);
|
|
}
|
|
|
|
@Override
|
|
public Stream<BlockPos> getPositions(final LevelAccessor bju, final ChunkGenerator<? extends ChunkGeneratorSettings> bzx, final Random random, final FrequencyDecoratorConfiguration cka, final BlockPos fk) {
|
|
final int integer4;
|
|
final int integer5;
|
|
final int integer6;
|
|
return IntStream.range(0, cka.count).<BlockPos>mapToObj(integer -> {
|
|
integer4 = random.nextInt(16) + fk.getX();
|
|
integer5 = random.nextInt(16) + fk.getZ();
|
|
integer6 = 64;
|
|
return new BlockPos(integer4, 64, integer5);
|
|
});
|
|
}
|
|
}
|