Merge pull request #9 from Adubbz/master

configurable achievements
This commit is contained in:
ted 2013-03-31 23:46:02 -07:00
commit 8a7d5f63b4
1 changed files with 59 additions and 48 deletions

View File

@ -79,6 +79,7 @@ public class mod_BiomesOPlenty
config.load();
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();
@ -676,6 +677,8 @@ public class mod_BiomesOPlenty
bootsAmethyst = (new ArmorAmethyst(bootsAmethystID, EnumArmorMaterialAmethyst, proxy.addArmor("amethyst"), 3)).setCreativeTab(tabBiomesOPlenty).setUnlocalizedName("bootsAmethyst");
// Achievement declaration
if (achievements == true)
{
achFlower2 = (new Achievement(3057, "achFlower2", 0, 0, Block.plantRed, (Achievement)null)).registerAchievement();
achRedRock2 = (new Achievement(3058, "achRedRock2", -1, 2, redRock, achFlower2)).registerAchievement();
achThorn2 = (new Achievement(3059, "achThorn2", 2, 1, thorn, achFlower2)).registerAchievement();
@ -689,6 +692,7 @@ public class mod_BiomesOPlenty
pageBOP = new AchievementPage("Biomes O\' Plenty", achFlower2, achRedRock2, achThorn2, achAsh2, achOrigin2, achPromised2, achMud2, achShroom2, achBarley2, achMoss2);
AchievementPage.registerAchievementPage(pageBOP);
}
// Add block names
LanguageRegistry.addName(mud, "Mud");
@ -1217,6 +1221,8 @@ public class mod_BiomesOPlenty
GameRegistry.addSmelting(redRockCobble.blockID, new ItemStack(redRock, 1), 0.1F);
GameRegistry.addSmelting(tinyCactus.blockID, new ItemStack(Item.dyePowder, 1, 2), 0.2F);
if (achievements == true)
{
// Add Achievement registration
addAchievementDesc("achFlower2", "Flower Child", "Pick some flowers!");
addAchievementDesc("achRedRock2", "Red Rocky Mountain High", "Dig out some red rocks.");
@ -1228,6 +1234,7 @@ public class mod_BiomesOPlenty
addAchievementDesc("achShroom2", "Trippin\'", "Don\'t try this at home, kids!");
addAchievementDesc("achBarley2", "Fields Of Gold", "Upon the fields of barley.");
addAchievementDesc("achMoss2", "Mossman", "Mothman's long-lost cousin.");
}
LanguageRegistry.instance().addStringLocalization("generator.BIOMESOP", "en_US", "Biomes O\' Plenty");
@ -2246,6 +2253,7 @@ public class mod_BiomesOPlenty
public static boolean skyColors;
public static int biomeSize;
public static boolean addToDefault;
public static boolean achievements;
public static boolean vanillaEnhanced;
public static int promisedLandDimID;
@ -2804,6 +2812,8 @@ public class mod_BiomesOPlenty
// Achievement checker
public static void onItemPickup(EntityPlayer player, ItemStack item)
{
if (achievements == true)
{
if (item.itemID == glowFlower.blockID || item.itemID == orangeFlower.blockID || item.itemID == blueFlower.blockID || item.itemID == purpleFlower.blockID || item.itemID == pinkFlower.blockID || item.itemID == whiteFlower.blockID || item.itemID == tinyFlower.blockID || item.itemID == deathbloom.blockID || item.itemID == hydrangea.blockID || item.itemID == violet.blockID || item.itemID == Block.plantRed.blockID || item.itemID == Block.plantYellow.blockID)
{
@ -2846,6 +2856,7 @@ public class mod_BiomesOPlenty
player.addStat(achMoss2, 1);
}
}
}
public static void addAchievementDesc(String ach, String name, String desc)
{