added playerrace and updated to version 26.2 #14
+21
-18
@@ -1,12 +1,15 @@
|
|||||||
package eu.mhsl.minenet.minigames.instance.game.stateless.types.playerRace;
|
package eu.mhsl.minenet.minigames.instance.game.stateless.types.playerRace;
|
||||||
|
|
||||||
import eu.mhsl.minenet.minigames.instance.game.stateless.types.playerRace.obstacles.Obstacle;
|
import eu.mhsl.minenet.minigames.instance.game.stateless.types.playerRace.obstacles.Obstacle;
|
||||||
|
import eu.mhsl.minenet.minigames.util.GeneratorUtils;
|
||||||
import eu.mhsl.minenet.minigames.world.BlockPallet;
|
import eu.mhsl.minenet.minigames.world.BlockPallet;
|
||||||
import eu.mhsl.minenet.minigames.world.generator.featureEnriched.ValeGenerator;
|
import eu.mhsl.minenet.minigames.world.generator.featureEnriched.ValeGenerator;
|
||||||
import eu.mhsl.minenet.minigames.world.generator.terrain.BaseGenerator;
|
import eu.mhsl.minenet.minigames.world.generator.terrain.BaseGenerator;
|
||||||
import net.minestom.server.coordinate.Point;
|
import net.minestom.server.coordinate.Point;
|
||||||
import net.minestom.server.instance.block.Block;
|
import net.minestom.server.instance.block.Block;
|
||||||
|
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
public class PlayerRaceChunkgenerator extends BaseGenerator {
|
public class PlayerRaceChunkgenerator extends BaseGenerator {
|
||||||
public PlayerRaceChunkgenerator(int height) {
|
public PlayerRaceChunkgenerator(int height) {
|
||||||
ValeGenerator vale = new ValeGenerator();
|
ValeGenerator vale = new ValeGenerator();
|
||||||
@@ -21,26 +24,26 @@ public class PlayerRaceChunkgenerator extends BaseGenerator {
|
|||||||
unit.absoluteStart().chunkZ() > 16
|
unit.absoluteStart().chunkZ() > 16
|
||||||
) return;
|
) return;
|
||||||
|
|
||||||
Point start = unit.absoluteStart();
|
Point start = unit.absoluteStart().withY(height);
|
||||||
|
|
||||||
for(int x = 0; x <= 15; x++) {
|
if(unit.absoluteStart().chunkZ() % 2 == 1) {
|
||||||
for(int z = 0; z <= 15; z++) {
|
Obstacle.getRandomObstacle().generate(unit, start);
|
||||||
Point blockPosition = start.add(x, height, z);
|
return;
|
||||||
if(unit.absoluteStart().chunkZ() == 0) {
|
|
||||||
unit.modifier().setBlock(blockPosition, Block.AMETHYST_BLOCK);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if(unit.absoluteStart().chunkZ() == 16) {
|
|
||||||
unit.modifier().setBlock(blockPosition, Block.DIAMOND_BLOCK);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if(unit.absoluteStart().chunkZ() % 2 == 1) {
|
|
||||||
Obstacle.getRandomObstacle().generate(unit, blockPosition);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
unit.modifier().setBlock(blockPosition, BlockPallet.GROUND.rnd());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BiConsumer<Point, Block> setBlock = (Point point, Block block) -> unit.modifier().setBlock(point.withY(height), block);
|
||||||
|
|
||||||
|
if(unit.absoluteStart().chunkZ() == 0) {
|
||||||
|
GeneratorUtils.foreachXZ(unit, point -> setBlock.accept(point, Block.AMETHYST_BLOCK));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(unit.absoluteStart().chunkZ() == 16) {
|
||||||
|
GeneratorUtils.foreachXZ(unit, point -> setBlock.accept(point, Block.DIAMOND_BLOCK));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GeneratorUtils.foreachXZ(unit, point -> setBlock.accept(point, BlockPallet.GROUND.rnd()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-5
@@ -14,10 +14,12 @@ class Mudpit extends Obstacle {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generate(GenerationUnit unit, Point start) {
|
public void generate(GenerationUnit unit, Point start) {
|
||||||
GeneratorUtils.foreachXZ(unit, point -> {
|
unit.modifier().setBlock(start, Block.BAMBOO_BLOCK);
|
||||||
int modifier = point.blockX()/16 * -3;
|
|
||||||
double heightAtBlock = this.curves.getNoise(point.blockX(), point.blockY(), point.blockZ()) * modifier;
|
// GeneratorUtils.foreachXZ(unit, point -> {
|
||||||
unit.modifier().setBlock(point.withY(v -> heightAtBlock), Block.SOUL_SAND);
|
// int modifier = point.blockX() / 16 * 5;
|
||||||
});
|
// double heightAtBlock = this.curves.getNoise(point.blockX(), point.blockY(), point.blockZ()) * modifier;
|
||||||
|
// unit.modifier().setBlock(point.withY(v -> heightAtBlock), Block.SOUL_SAND);
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user