minecraft-source/src/net/minecraft/world/level/levelgen/placement/EndIslandPlacementDecorator...

28 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.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 EndIslandPlacementDecorator extends SimpleFeatureDecorator<NoneDecoratorConfiguration> {
public EndIslandPlacementDecorator(final Function<Dynamic<?>, ? extends NoneDecoratorConfiguration> function) {
super(function);
}
public Stream<BlockPos> place(final Random random, final NoneDecoratorConfiguration cgr, final BlockPos fk) {
Stream<BlockPos> stream5 = Stream.<BlockPos>empty();
if (random.nextInt(14) == 0) {
stream5 = Stream.<BlockPos>concat(stream5, Stream.of((T)fk.offset(random.nextInt(16), 55 + random.nextInt(16), random.nextInt(16))));
if (random.nextInt(4) == 0) {
stream5 = Stream.<BlockPos>concat(stream5, Stream.of((T)fk.offset(random.nextInt(16), 55 + random.nextInt(16), random.nextInt(16))));
}
return stream5;
}
return Stream.<BlockPos>empty();
}
}