added fastbridge terrain generator
This commit is contained in:
@@ -27,7 +27,7 @@ public class Fastbridge extends StatelessGame {
|
||||
Player player = playerMoveEvent.getPlayer();
|
||||
Pos newPos = playerMoveEvent.getNewPosition();
|
||||
if(this.getScore().hasResult(player)) return;
|
||||
if(newPos.y() < -65) {
|
||||
if(newPos.y() < 0) {
|
||||
player.teleport(getSpawn());
|
||||
if(!isBeforeBeginning) this.resetPlayer(player);
|
||||
}
|
||||
@@ -59,6 +59,6 @@ public class Fastbridge extends StatelessGame {
|
||||
|
||||
@Override
|
||||
public synchronized Pos getSpawn() {
|
||||
return new Pos(24, -60, currentSpawn++*Chunk.CHUNK_SIZE_Z*2-8, -90, 0);
|
||||
return new Pos(24, 1, currentSpawn++*Chunk.CHUNK_SIZE_Z*2-8, -90, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,29 @@
|
||||
package eu.mhsl.minenet.minigames.instance.game.stateless.types.fastbridge;
|
||||
|
||||
import eu.mhsl.minenet.minigames.world.generator.featureEnriched.ValeGenerator;
|
||||
import eu.mhsl.minenet.minigames.world.generator.terrain.BaseGenerator;
|
||||
import net.minestom.server.instance.block.Block;
|
||||
import net.minestom.server.instance.generator.GenerationUnit;
|
||||
import net.minestom.server.instance.generator.Generator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class FastbridgeChunkgenerator implements Generator {
|
||||
@Override
|
||||
public void generate(@NotNull GenerationUnit unit) {
|
||||
if (unit.absoluteStart().chunkZ() % 2 == 0) {
|
||||
unit.modifier().fill(Block.BARRIER);
|
||||
return;
|
||||
}
|
||||
|
||||
if (unit.absoluteStart().chunkX() != 1 && unit.absoluteStart().chunkX() != 3) return;
|
||||
for (int x = 5; x <= 10; x++){
|
||||
for (int z = 5; z <= 10; z++){
|
||||
unit.modifier().setRelative(x, 2, z, unit.absoluteStart().chunkX() == 3 ? Block.GOLD_BLOCK : Block.GRASS_BLOCK);
|
||||
public class FastbridgeChunkgenerator extends BaseGenerator {
|
||||
public FastbridgeChunkgenerator() {
|
||||
this.addMixIn(unit -> {
|
||||
if (unit.absoluteStart().chunkZ() % 2 == 0) {
|
||||
unit.modifier().fill(Block.BARRIER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (unit.absoluteStart().chunkX() != 1 && unit.absoluteStart().chunkX() != 3) return;
|
||||
for (int x = 5; x <= 10; x++){
|
||||
for (int z = 5; z <= 10; z++){
|
||||
unit.modifier().setRelative(x, 64, z, unit.absoluteStart().chunkX() == 3 ? Block.GOLD_BLOCK : Block.GRASS_BLOCK);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ValeGenerator vale = new ValeGenerator();
|
||||
vale.setXShiftMultiplier(integer -> 0.5d);
|
||||
vale.setHeightNoiseMultiplier(integer -> 2);
|
||||
vale.setXShiftOffset(integer -> 40d);
|
||||
this.addMixIn(vale);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user