tower-generator #6
@ -14,7 +14,7 @@ tower:
|
|||||||
pitch: 0.0
|
pitch: 0.0
|
||||||
doors: []
|
doors: []
|
||||||
keys: []
|
keys: []
|
||||||
lavaY: 220
|
lavaY: 78
|
||||||
laveSpace: 7
|
laveSpace: 7
|
||||||
|
|
||||||
towerGenerator:
|
towerGenerator:
|
||||||
|
@ -125,21 +125,31 @@ public class WorldConfig {
|
|||||||
|
|
||||||
ESCAPE_HEIGHT = tower.getInt("escapeHeight");
|
ESCAPE_HEIGHT = tower.getInt("escapeHeight");
|
||||||
SPAWN = parseLocation(tower.getConfigurationSection("spawn"));
|
SPAWN = parseLocation(tower.getConfigurationSection("spawn"));
|
||||||
List<ConfigurationSection> doors = tower.getConfigurationSection("doors").getKeys(false).stream()
|
ConfigurationSection doorSection = tower.getConfigurationSection("doors");
|
||||||
|
if (doorSection != null) {
|
||||||
|
List<ConfigurationSection> doors = doorSection.getKeys(false).stream()
|
||||||
.map(tower.getConfigurationSection("doors")::getConfigurationSection)
|
.map(tower.getConfigurationSection("doors")::getConfigurationSection)
|
||||||
.toList();
|
.toList();
|
||||||
DOORS = new Location[doors.size()];
|
DOORS = new Location[doors.size()];
|
||||||
for (int i = 0; i < doors.size(); i++) {
|
for (int i = 0; i < doors.size(); i++) {
|
||||||
DOORS[i] = parseLocation(doors.get(i));
|
DOORS[i] = parseLocation(doors.get(i));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
DOORS = new Location[0];
|
||||||
|
}
|
||||||
|
|
||||||
List<ConfigurationSection> keys = tower.getConfigurationSection("keys").getKeys(false).stream()
|
ConfigurationSection keysSection = tower.getConfigurationSection("keys");
|
||||||
|
if (keysSection != null) {
|
||||||
|
List<ConfigurationSection> keys = keysSection.getKeys(false).stream()
|
||||||
.map(tower.getConfigurationSection("keys")::getConfigurationSection)
|
.map(tower.getConfigurationSection("keys")::getConfigurationSection)
|
||||||
.toList();
|
.toList();
|
||||||
KEYS = new Location[keys.size()];
|
KEYS = new Location[keys.size()];
|
||||||
for (int i = 0; i < keys.size(); i++) {
|
for (int i = 0; i < keys.size(); i++) {
|
||||||
KEYS[i] = parseLocation(keys.get(i));
|
KEYS[i] = parseLocation(keys.get(i));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
KEYS = new Location[0];
|
||||||
|
}
|
||||||
|
|
||||||
LAVA_Y = tower.getInt("lavaY");
|
LAVA_Y = tower.getInt("lavaY");
|
||||||
LAVE_SPACE = tower.getInt("laveSpace");
|
LAVE_SPACE = tower.getInt("laveSpace");
|
||||||
|
@ -84,8 +84,12 @@ public class TowerRunGame {
|
|||||||
for (int z = WorldConfig.MIN_TOWER.getBlockZ(); z < WorldConfig.MAX_TOWER.getBlockZ(); z += WorldConfig.LAVE_SPACE) {
|
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);
|
int offset = WorldConfig.LAVA_Y;
|
||||||
WorldConfig.MIN_TOWER.getWorld().getBlockAt(x, WorldConfig.LAVA_Y - 1, z).setType(Material.BEDROCK, true);
|
if (TowerRun.getTowerGenerator() != null) {
|
||||||
|
offset += TowerRun.getTowerGenerator().getHeight();
|
||||||
|
}
|
||||||
|
WorldConfig.MIN_TOWER.getWorld().getBlockAt(x, offset, z).setType(Material.LAVA, true);
|
||||||
|
WorldConfig.MIN_TOWER.getWorld().getBlockAt(x, offset - 1, z).setType(Material.BEDROCK, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren