@Test public void worldFromConfNullUUID() { World w = WorldLoader.worldFromConfig(new YamlConfiguration(), true); Assert.assertNull(w); }
@Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf.getString(WORLD_NAME); if (worldName == null) { return null; } return Bukkit.getWorld(worldName); } }
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf.getString(WORLD_NAME); if (worldName == null) { return null; } return Bukkit.getWorld(worldName); } } }
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf.getString(WORLD_NAME); if (worldName == null) { return null; } return Bukkit.getWorld(worldName); } }  }
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf.getString(WORLD_NAME); if (worldName == null) { return null; } return Bukkit.getWorld(worldName); } }  @NotNull static ConfigurationSection locationToConfig(@NotNull Location location, boolean useUUID); @Nullable static Location locationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID); @NotNull static ConfigurationSection blockLocationToConfig(@NotNull Location location, boolean useUUID); @Nullable static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID); @Nullable static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf); @Nullable static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID); }
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf.getString(WORLD_NAME); if (worldName == null) { return null; } return Bukkit.getWorld(worldName); } }  @NotNull static ConfigurationSection locationToConfig(@NotNull Location location, boolean useUUID); @Nullable static Location locationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID); @NotNull static ConfigurationSection blockLocationToConfig(@NotNull Location location, boolean useUUID); @Nullable static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID); @Nullable static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf); @Nullable static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID); static final String WORLD_UID; static final String WORLD_NAME; static final String X; static final String Y; static final String Z; static final String YAW; static final String PITCH; }