Archiviert
13
0
Dieser Commit ist enthalten in:
Chaoscaot 2023-08-16 23:10:02 +02:00
Ursprung bb3142078f
Commit 625f39fba4
Signiert von: Chaoscaot
GPG-Schlüssel-ID: BDF8FADD7D5EDB7A
3 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -42,6 +42,7 @@ public class WorldConfig {
public static final Region[] REGIONS; public static final Region[] REGIONS;
public static final Location[] DOORS; public static final Location[] DOORS;
public static final int LAVA_Y; public static final int LAVA_Y;
public static final int LAVE_SPACE;
public static final Location SPAWN; public static final Location SPAWN;
public static final int ESCAPE_HEIGHT; public static final int ESCAPE_HEIGHT;
public static final Location MIN_TOWER; public static final Location MIN_TOWER;
@ -126,6 +127,7 @@ public class WorldConfig {
} }
LAVA_Y = tower.getInt("lavaY"); LAVA_Y = tower.getInt("lavaY");
LAVE_SPACE = tower.getInt("laveSpace");
ACTIVE_WINCONDITIONS = config.getStringList("winconditions"); ACTIVE_WINCONDITIONS = config.getStringList("winconditions");
WINCONDITIONS.stream().filter(winCondition -> ACTIVE_WINCONDITIONS.contains(winCondition.getName())).forEach(winCondition -> winCondition.setActive(true)); WINCONDITIONS.stream().filter(winCondition -> ACTIVE_WINCONDITIONS.contains(winCondition.getName())).forEach(winCondition -> winCondition.setActive(true));
} }

Datei anzeigen

@ -56,8 +56,8 @@ public class TowerRunGame {
} }
private static void generateLava() { private static void generateLava() {
for (int x = WorldConfig.MIN_TOWER.getBlockX(); x < WorldConfig.MAX_TOWER.getBlockX(); x += 7) { for (int x = WorldConfig.MIN_TOWER.getBlockX(); x < WorldConfig.MAX_TOWER.getBlockX(); x += WorldConfig.LAVE_SPACE) {
for (int z = WorldConfig.MIN_TOWER.getBlockZ(); z < WorldConfig.MAX_TOWER.getBlockZ(); z += 7) { for (int z = WorldConfig.MIN_TOWER.getBlockZ(); z < WorldConfig.MAX_TOWER.getBlockZ(); z += WorldConfig.LAVE_SPACE) {
Vector pos = new Vector(x, 0, z); Vector pos = new Vector(x, 0, z);
if (Arrays.stream(WorldConfig.REGIONS).anyMatch(region -> region.contains(pos))) { if (Arrays.stream(WorldConfig.REGIONS).anyMatch(region -> region.contains(pos))) {
WorldConfig.MIN_TOWER.getWorld().getBlockAt(x, WorldConfig.LAVA_Y, z).setType(Material.LAVA, true); WorldConfig.MIN_TOWER.getWorld().getBlockAt(x, WorldConfig.LAVA_Y, z).setType(Material.LAVA, true);

Datei anzeigen

@ -27,6 +27,7 @@ tower:
y: 167 y: 167
z: 309 z: 309
lavaY: 220 lavaY: 220
laveSpace: 7
winconditions: winconditions:
- LAST_REMAINING - LAST_REMAINING