public static Location getLocation(Destination dest) { if (dest.equals(Destination.MOON)) { if (moon == null) loadLocations(); return moon; } else if (dest.equals(Destination.HOME)) { if (home == null) loadLocations(); return home; } return null; }
public static void loadDestinations() { for (Destination dest : Destination.values()) loadDestination(dest); }
public static void loadDestination(Destination dest) { if (AvoidTheVoid.getPlugin().getConfig().contains(dest.toString().toLowerCase() + "lever")) levers.put( dest, AvoidTheVoid.getPlugin().getConfig().getString(dest.toString().toLowerCase() + "lever")); }