@Test public void blockLocationFromConfigValid() { YamlConfiguration conf = new YamlConfiguration(); conf.set(WorldLoader.X, 6); conf.set(WorldLoader.Y, 0); conf.set(WorldLoader.Z, -4); conf.set(WorldLoader.WORLD_NAME, "test"); when(Bukkit.getWorld("test")).thenReturn(mock(World.class)); Location loc = WorldLoader.blockLocationFromConfig(conf, false); Assert.assertNotNull(loc); }
@Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); return loc; }
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); return loc; } }
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); return loc; }  }
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); return loc; }  @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 Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); return loc; }  @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; }