From b9219413f6247d50898f9cdbf9d2b29587176f8e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 23 Dec 2016 22:50:49 -0500 Subject: [PATCH] Adjusted Dungeons --- .../dungeons/dungeons/GenericDungeonA1.java | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java index 4f70d62..b8ad2bd 100644 --- a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java +++ b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java @@ -22,15 +22,24 @@ public class GenericDungeonA1 extends Dungeon{ plugin.getServer().broadcastMessage("Available Worlds... " + plugin.getServer().getWorlds().toString()); return false; }*/ - if ((entrance = loadLocation(plugin, "dungeons.dungeona1.enter")) == null){ - if(plugin.getServer().getWorld("Dungeons") != null){ - entrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); - } + Location temp; + if ((temp = loadLocation(plugin, "dungeons.dungeona1.enter")) != null){ + entrance = temp; + }else if(plugin.getServer().getWorld("Dungeons") != null){ + entrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); + }else{ + plugin.getServer().broadcastMessage("There is no working default dungeon entrance for A1, setting to null"); + entrance = null; } - if ((exit = loadLocation(plugin, "dungeons.dungeona1.exit")) == null){ - if (plugin.getServer().getWorld("world") != null){ - exit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); - } + + temp = null; + if ((temp = loadLocation(plugin, "dungeons.dungeona1.exit")) != null){ + exit = temp; + }else if (plugin.getServer().getWorld("world") != null){ + exit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); + }else{ + plugin.getServer().broadcastMessage("There is no working default dungeon exit for A1, setting to null"); + exit = null; } if (entrance == null || exit == null){ @@ -72,6 +81,7 @@ public class GenericDungeonA1 extends Dungeon{ double x = plugin.getConfig().getDouble(path+".x"); double y = plugin.getConfig().getDouble(path+".y"); double z = plugin.getConfig().getDouble(path+".z"); + return new Location(world, x, y, z); }catch(Exception e){ e.printStackTrace();