30 lines
1.2 KiB
Java
30 lines
1.2 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 com.mojang.datafixers.Dynamic;
|
|
import java.util.function.Function;
|
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneDecoratorConfiguration;
|
|
|
|
public class EmeraldPlacementDecorator extends SimpleFeatureDecorator<NoneDecoratorConfiguration> {
|
|
public EmeraldPlacementDecorator(final Function<Dynamic<?>, ? extends NoneDecoratorConfiguration> function) {
|
|
super(function);
|
|
}
|
|
|
|
public Stream<BlockPos> place(final Random random, final NoneDecoratorConfiguration cgr, final BlockPos fk) {
|
|
final int integer5 = 3 + random.nextInt(6);
|
|
final int integer6;
|
|
final int integer7;
|
|
final int integer8;
|
|
return IntStream.range(0, integer5).<BlockPos>mapToObj(integer -> {
|
|
integer6 = random.nextInt(16) + fk.getX();
|
|
integer7 = random.nextInt(16) + fk.getZ();
|
|
integer8 = random.nextInt(28) + 4;
|
|
return new BlockPos(integer6, integer8, integer7);
|
|
});
|
|
}
|
|
}
|