From 978e67ac50cd7a9797c0cb3b11cd93893f659300 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 19 Aug 2023 10:28:46 +0200 Subject: [PATCH] Revert "Fix stuff" This reverts commit 67376fc5a447911c5ab8a873c64899f27fc89384. --- configs/steamtower.yml | 2 +- .../steamwar/towerrun/config/WorldConfig.java | 34 +++++++------------ .../steamwar/towerrun/game/TowerRunGame.java | 8 ++--- 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/configs/steamtower.yml b/configs/steamtower.yml index de69118..e25a261 100644 --- a/configs/steamtower.yml +++ b/configs/steamtower.yml @@ -14,7 +14,7 @@ tower: pitch: 0.0 doors: [] keys: [] - lavaY: 78 + lavaY: 220 laveSpace: 7 towerGenerator: diff --git a/src/de/steamwar/towerrun/config/WorldConfig.java b/src/de/steamwar/towerrun/config/WorldConfig.java index 9b48e76..c888197 100644 --- a/src/de/steamwar/towerrun/config/WorldConfig.java +++ b/src/de/steamwar/towerrun/config/WorldConfig.java @@ -125,30 +125,20 @@ public class WorldConfig { ESCAPE_HEIGHT = tower.getInt("escapeHeight"); SPAWN = parseLocation(tower.getConfigurationSection("spawn")); - ConfigurationSection doorSection = tower.getConfigurationSection("doors"); - if (doorSection != null) { - List doors = doorSection.getKeys(false).stream() - .map(tower.getConfigurationSection("doors")::getConfigurationSection) - .toList(); - DOORS = new Location[doors.size()]; - for (int i = 0; i < doors.size(); i++) { - DOORS[i] = parseLocation(doors.get(i)); - } - } else { - DOORS = new Location[0]; + List doors = tower.getConfigurationSection("doors").getKeys(false).stream() + .map(tower.getConfigurationSection("doors")::getConfigurationSection) + .toList(); + DOORS = new Location[doors.size()]; + for (int i = 0; i < doors.size(); i++) { + DOORS[i] = parseLocation(doors.get(i)); } - ConfigurationSection keysSection = tower.getConfigurationSection("keys"); - if (keysSection != null) { - List keys = keysSection.getKeys(false).stream() - .map(tower.getConfigurationSection("keys")::getConfigurationSection) - .toList(); - KEYS = new Location[keys.size()]; - for (int i = 0; i < keys.size(); i++) { - KEYS[i] = parseLocation(keys.get(i)); - } - } else { - KEYS = new Location[0]; + List keys = tower.getConfigurationSection("keys").getKeys(false).stream() + .map(tower.getConfigurationSection("keys")::getConfigurationSection) + .toList(); + KEYS = new Location[keys.size()]; + for (int i = 0; i < keys.size(); i++) { + KEYS[i] = parseLocation(keys.get(i)); } LAVA_Y = tower.getInt("lavaY"); diff --git a/src/de/steamwar/towerrun/game/TowerRunGame.java b/src/de/steamwar/towerrun/game/TowerRunGame.java index ec24426..d0b14d6 100644 --- a/src/de/steamwar/towerrun/game/TowerRunGame.java +++ b/src/de/steamwar/towerrun/game/TowerRunGame.java @@ -84,12 +84,8 @@ public class TowerRunGame { for (int z = WorldConfig.MIN_TOWER.getBlockZ(); z < WorldConfig.MAX_TOWER.getBlockZ(); z += WorldConfig.LAVE_SPACE) { Vector pos = new Vector(x, 0, z); if (Arrays.stream(WorldConfig.REGIONS).anyMatch(region -> region.contains(pos))) { - int offset = WorldConfig.LAVA_Y; - 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); + WorldConfig.MIN_TOWER.getWorld().getBlockAt(x, WorldConfig.LAVA_Y, z).setType(Material.LAVA, true); + WorldConfig.MIN_TOWER.getWorld().getBlockAt(x, WorldConfig.LAVA_Y - 1, z).setType(Material.BEDROCK, true); } } }