Source:
protected void loadData(JsonObject json, BiomeTextureMap data, int version) { if (version == 0) { Log.warn("Too many biome textures changed since config version 0," + " disregarding this config entirely"); return; } for (Entry<String, JsonElement> entry : json.entrySet()) { String key = entry.getKey(); if (!(key.length() > 0)) { Log.warn("No biome ID specified, skipping entry"); return; } int biomeID; try { biomeID = Integer.parseInt(key); } catch(NumberFormatException e) { ResourceLocation biomeResourceLocation; if (key.contains(":")) { String[] biomeStringSplit = key.split(":"); biomeResourceLocation = new ResourceLocation(biomeStringSplit[0], biomeStringSplit[1]); } else { biomeResourceLocation = new ResourceLocation(key); } Biome biome = Biome.REGISTRY.getObject(biomeResourceLocation); if (biome == null) { Log.warn("Biome ID is invalid, skipping entry"); return; } biomeID = Biome.getIdForBiome(biome); } if (entry.getValue().isJsonArray()) { JsonArray array = entry.getValue().getAsJsonArray(); ResourceLocation[] textures = new ResourceLocation[array.size()]; for (int i = 0; i < array.size(); i++) { String path = array.get(i).getAsString(); textures[i] = new ResourceLocation(path); } data.setTexture(biomeID, new TextureSet(null, textures)); Log.info("Registered %d custom texture(s) for biome %d", textures.length, biomeID); } else { String name = entry.getValue().getAsString(); if (textureSetMap.isRegistered(name)) { data.setTexture(biomeID, textureSetMap.getByName(name)); Log.info("Registered texture set %s for biome %d", name, biomeID); } else { Log.warn("Unknown texture set %s for biome %d", name, biomeID); } } } }

Target:
protected void loadData(JsonObject json, BiomeTextureMap data, int version) { if (version == 0) { Log.warn("Too many biome textures changed since config version 0," + " disregarding this config entirely"); return; } for (Entry<String, JsonElement> entry : json.entrySet()) { String key = entry.getKey(); if (!(key.length() > 0)) { Log.warn("No biome ID specified, skipping entry"); return; } int biomeID; Biome biome; try { biomeID = Integer.parseInt(key); biome = Biome.getBiomeForId(biomeID); if (biome == null) { Log.warn("Cannot find biome for ID %d", biomeID); return; } } catch(NumberFormatException e) { biome = ForgeRegistries.BIOMES.getValue(new ResourceLocation(key)); if (biome == null) { Log.warn("Biome ID is invalid, skipping entry with key: %s", key); return; } biomeID = Biome.getIdForBiome(biome); } if (entry.getValue().isJsonArray()) { JsonArray array = entry.getValue().getAsJsonArray(); ResourceLocation[] textures = new ResourceLocation[array.size()]; for (int i = 0; i < array.size(); i++) { String path = array.get(i).getAsString(); textures[i] = new ResourceLocation(path); } data.setTexture(biomeID, new TextureSet(null, textures)); Log.info("Registered %d custom texture(s) for biome %s", textures.length, CustomFormatter.getRegistryString(biome)); } else { String name = entry.getValue().getAsString(); if (textureSetMap.isRegistered(name)) { data.setTexture(biomeID, textureSetMap.getByName(name)); Log.info("Registered texture set %s for biome %s", name, CustomFormatter.getRegistryString(biome)); } else { Log.warn("Unknown texture set %s for biome %s", name, CustomFormatter.getRegistryString(biome)); } } } }