diff --git a/src/minecraft/tdwp_ftw/biomesop/declarations/BOPConfiguration.java b/src/minecraft/tdwp_ftw/biomesop/declarations/BOPConfiguration.java index 29fee1f8b..675a2f3da 100644 --- a/src/minecraft/tdwp_ftw/biomesop/declarations/BOPConfiguration.java +++ b/src/minecraft/tdwp_ftw/biomesop/declarations/BOPConfiguration.java @@ -6,6 +6,9 @@ import static net.minecraftforge.common.Configuration.CATEGORY_GENERAL; import java.io.File; import java.util.logging.Level; +import tdwp_ftw.biomesop.ClientProxy; +import tdwp_ftw.biomesop.mod_BiomesOPlenty; + import net.minecraftforge.common.Configuration; import cpw.mods.fml.common.FMLLog; @@ -415,6 +418,8 @@ public class BOPConfiguration { public static void init(File configFile) { + boolean isClient = mod_BiomesOPlenty.proxy instanceof ClientProxy; + config = new Configuration(configFile); try @@ -424,9 +429,17 @@ public class BOPConfiguration { skyColors = true; biomeSize = config.get("Biome Settings", "Biome Size", 4, null).getInt(); achievements = config.get("Achievement Settings", "Add Biomes O Plenty Achievemnets (Currently Broken)", false).getBoolean(false); - addToDefault = config.get("Biome Settings", "Add Biomes To Default World", false).getBoolean(false); vanillaEnhanced = config.get("Biome Settings", "Enhanced Vanilla Biomes", true).getBoolean(false); promisedLandDimID = config.get("Dimension Settings", "Promised Land Dimension ID", 20, null).getInt(); + + if (!isClient) + { + addToDefault = config.get("Biome Settings", "Add Biomes To Default World", true).getBoolean(true); + } + else + { + addToDefault = config.get("Biome Settings", "Add Biomes To Default World", false).getBoolean(false); + } alpsGen = config.get("Biomes To Generate", "Alps", true).getBoolean(false); arcticGen = config.get("Biomes To Generate", "Arctic", true).getBoolean(false); diff --git a/src/minecraft/tdwp_ftw/biomesop/mod_BiomesOPlenty.java b/src/minecraft/tdwp_ftw/biomesop/mod_BiomesOPlenty.java index 01f13715e..6ef7f3c70 100644 --- a/src/minecraft/tdwp_ftw/biomesop/mod_BiomesOPlenty.java +++ b/src/minecraft/tdwp_ftw/biomesop/mod_BiomesOPlenty.java @@ -74,34 +74,38 @@ public class mod_BiomesOPlenty @PreInit public void preInit(FMLPreInitializationEvent event) { - + boolean isClient = proxy instanceof ClientProxy; + String[] soundFiles = { "bopdisc.ogg", "bopdiscmud.ogg"}; - for (String soundFile : soundFiles) try + if (isClient) { - File file = new File("resources/mod/streaming/" + soundFile); - if (!file.exists()) { - System.out.println("[BoP] " + soundFile + " doesn't exist, creating..."); - file.getParentFile().mkdirs(); - file.createNewFile(); - InputStream istream = getClass().getResourceAsStream("/mods/BiomesOPlenty/audio/" + soundFile); - OutputStream out = new FileOutputStream(file); - byte[] buf = new byte[1024]; - int size = 0; - int len; - while ((len = istream.read(buf)) > 0) { - out.write(buf, 0, len); - size += len; + for (String soundFile : soundFiles) try + { + File file = new File("resources/mod/streaming/" + soundFile); + if (!file.exists()) { + System.out.println("[BoP] " + soundFile + " doesn't exist, creating..."); + file.getParentFile().mkdirs(); + file.createNewFile(); + InputStream istream = getClass().getResourceAsStream("/mods/BiomesOPlenty/audio/" + soundFile); + OutputStream out = new FileOutputStream(file); + byte[] buf = new byte[1024]; + int size = 0; + int len; + while ((len = istream.read(buf)) > 0) { + out.write(buf, 0, len); + size += len; + } + out.close(); + istream.close(); + if (size == 0) file.delete(); } - out.close(); - istream.close(); - if (size == 0) file.delete(); } - } - catch (Exception e) - { - FMLCommonHandler.instance().getFMLLogger().log(Level.WARNING, "[BoP] Failed to load sound file: " + soundFile); - e.printStackTrace(); + catch (Exception e) + { + FMLCommonHandler.instance().getFMLLogger().log(Level.WARNING, "[BoP] Failed to load sound file: " + soundFile); + e.printStackTrace(); + } } BOPConfiguration.init(event.getSuggestedConfigurationFile());