Fixed a bug on MCF "HURR WHY BIOMES NO GENERATE"
This commit is contained in:
parent
34a42086d6
commit
b64f5adbc9
3 changed files with 36 additions and 0 deletions
|
@ -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!");
|
||||
}
|
||||
|
|
|
@ -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()));
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -57,6 +61,31 @@ public class Version implements Runnable {
|
|||
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()
|
||||
{
|
||||
return recommendedVersion;
|
||||
|
|
Loading…
Reference in a new issue