From b64f5adbc97a9c8f52f1fe119b6c72f5305fe8f4 Mon Sep 17 00:00:00 2001 From: Adubbz G Date: Sat, 15 Jun 2013 09:16:58 +1000 Subject: [PATCH] Fixed a bug on MCF "HURR WHY BIOMES NO GENERATE" --- .../configuration/BOPConfiguration.java | 2 ++ .../helpers/TickHandlerClient.java | 5 ++++ .../biomesoplenty/helpers/Version.java | 29 +++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java index 7f04544cd..5fe347978 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java +++ b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java @@ -458,6 +458,7 @@ public class BOPConfiguration { public static boolean jungleVillage; public static Property seenVersion; + public static Property seenWorldTypeMsg; public static void init(File configFile) { @@ -925,6 +926,7 @@ public class BOPConfiguration { jungleNewID = config.get("Biome IDs", "Jungle (New) ID", 254).getInt(); seenVersion = config.get("Vars", "Seen Version", "null"); + seenWorldTypeMsg = config.get("Vars", "Seen WorldType Msg", false); FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Config!"); } diff --git a/src/minecraft/biomesoplenty/helpers/TickHandlerClient.java b/src/minecraft/biomesoplenty/helpers/TickHandlerClient.java index 784f2caca..061426c57 100644 --- a/src/minecraft/biomesoplenty/helpers/TickHandlerClient.java +++ b/src/minecraft/biomesoplenty/helpers/TickHandlerClient.java @@ -24,6 +24,11 @@ public class TickHandlerClient implements ITickHandler EntityPlayer player = (EntityPlayer) tickData[0]; + if (Version.needsBOPWorldtypeAndMarkAsSeen(player.worldObj)) + { + player.sendChatToPlayer(String.format("\u00A7cThe Biomes O Plenty world type must be used in order for the new biomes to generate. This message will only display once.")); + } + if (Version.needsUpdateNoticeAndMarkAsSeen()) { player.sendChatToPlayer(String.format("\u00A7cA new version of Biomes O Plenty is available: %s for Minecraft %s", Version.getRecommendedVersion(), Loader.instance().getMinecraftModContainer().getVersion())); diff --git a/src/minecraft/biomesoplenty/helpers/Version.java b/src/minecraft/biomesoplenty/helpers/Version.java index 7d3166335..5e43f283a 100644 --- a/src/minecraft/biomesoplenty/helpers/Version.java +++ b/src/minecraft/biomesoplenty/helpers/Version.java @@ -7,9 +7,13 @@ import java.net.URL; import java.util.ArrayList; import java.util.logging.Level; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; import net.minecraftforge.common.Property; import biomesoplenty.BiomesOPlenty; import biomesoplenty.configuration.BOPConfiguration; +import biomesoplenty.world.WorldTypeBOP; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -56,6 +60,31 @@ public class Version implements Runnable { BOPConfiguration.config.save(); return true; } + + public static boolean needsBOPWorldtypeAndMarkAsSeen(World world) + { + WorldType terrainType = world.getWorldInfo().getTerrainType(); + WorldTypeBOP bopType = new WorldTypeBOP(); + + Property property = BOPConfiguration.config.get("Vars", "Seen WorldType Msg", false); + String worldTypeProp = property.getString(); + + if (terrainType == null || property.getBoolean(false) == true) + return false; + + if (terrainType.getWorldTypeName().equals(bopType.getWorldTypeName())) + { + property.set(true); + + BOPConfiguration.config.save(); + return false; + } + + property.set(true); + + BOPConfiguration.config.save(); + return true; + } public static String getRecommendedVersion() {