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

View file

@ -79,6 +79,7 @@ public class mod_BiomesOPlenty
config.load(); config.load();
skyColors = true; skyColors = true;
biomeSize = config.get("Biome Settings", "Biome Size", 4, null).getInt(); 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); addToDefault = config.get("Biome Settings", "Add Biomes To Default World", false).getBoolean(false);
vanillaEnhanced = config.get("Biome Settings", "Enhanced Vanilla Biomes", true).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(); promisedLandDimID = config.get("Dimension Settings", "Promised Land Dimension ID", 20, null).getInt();
@ -676,9 +677,11 @@ public class mod_BiomesOPlenty
bootsAmethyst = (new ArmorAmethyst(bootsAmethystID, EnumArmorMaterialAmethyst, proxy.addArmor("amethyst"), 3)).setCreativeTab(tabBiomesOPlenty).setUnlocalizedName("bootsAmethyst"); bootsAmethyst = (new ArmorAmethyst(bootsAmethystID, EnumArmorMaterialAmethyst, proxy.addArmor("amethyst"), 3)).setCreativeTab(tabBiomesOPlenty).setUnlocalizedName("bootsAmethyst");
// Achievement declaration // Achievement declaration
achFlower2 = (new Achievement(3057, "achFlower2", 0, 0, Block.plantRed, (Achievement)null)).registerAchievement(); if (achievements == true)
achRedRock2 = (new Achievement(3058, "achRedRock2", -1, 2, redRock, achFlower2)).registerAchievement(); {
achThorn2 = (new Achievement(3059, "achThorn2", 2, 1, thorn, achFlower2)).registerAchievement(); 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();
achAsh2 = (new Achievement(3060, "achAsh2", 1, 3, ashes, achFlower2)).registerAchievement(); achAsh2 = (new Achievement(3060, "achAsh2", 1, 3, ashes, achFlower2)).registerAchievement();
achOrigin2 = (new Achievement(3061, "achOrigin2", 0, 5, originGrass, achFlower2)).setSpecial().registerAchievement(); achOrigin2 = (new Achievement(3061, "achOrigin2", 0, 5, originGrass, achFlower2)).setSpecial().registerAchievement();
achPromised2 = (new Achievement(3062, "achPromised2", 0, -5, holyGrass, achFlower2)).setSpecial().registerAchievement(); achPromised2 = (new Achievement(3062, "achPromised2", 0, -5, holyGrass, achFlower2)).setSpecial().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); pageBOP = new AchievementPage("Biomes O\' Plenty", achFlower2, achRedRock2, achThorn2, achAsh2, achOrigin2, achPromised2, achMud2, achShroom2, achBarley2, achMoss2);
AchievementPage.registerAchievementPage(pageBOP); AchievementPage.registerAchievementPage(pageBOP);
}
// Add block names // Add block names
LanguageRegistry.addName(mud, "Mud"); LanguageRegistry.addName(mud, "Mud");
@ -1217,17 +1221,20 @@ public class mod_BiomesOPlenty
GameRegistry.addSmelting(redRockCobble.blockID, new ItemStack(redRock, 1), 0.1F); GameRegistry.addSmelting(redRockCobble.blockID, new ItemStack(redRock, 1), 0.1F);
GameRegistry.addSmelting(tinyCactus.blockID, new ItemStack(Item.dyePowder, 1, 2), 0.2F); GameRegistry.addSmelting(tinyCactus.blockID, new ItemStack(Item.dyePowder, 1, 2), 0.2F);
// Add Achievement registration if (achievements == true)
addAchievementDesc("achFlower2", "Flower Child", "Pick some flowers!"); {
addAchievementDesc("achRedRock2", "Red Rocky Mountain High", "Dig out some red rocks."); // Add Achievement registration
addAchievementDesc("achThorn2", "Rather Thorny...", "Don\'t get cut!"); addAchievementDesc("achFlower2", "Flower Child", "Pick some flowers!");
addAchievementDesc("achAsh2", "Ash-ievement", "Get it? \'Cause it\'s ash."); addAchievementDesc("achRedRock2", "Red Rocky Mountain High", "Dig out some red rocks.");
addAchievementDesc("achOrigin2", "Alpha...", "Get some grass from the Origin Valley."); addAchievementDesc("achThorn2", "Rather Thorny...", "Don\'t get cut!");
addAchievementDesc("achPromised2", "...Omega", "Welcome to the Promised Land!"); addAchievementDesc("achAsh2", "Ash-ievement", "Get it? \'Cause it\'s ash.");
addAchievementDesc("achMud2", "Sticky Situation", "I just had these boots cleaned!"); addAchievementDesc("achOrigin2", "Alpha...", "Get some grass from the Origin Valley.");
addAchievementDesc("achShroom2", "Trippin\'", "Don\'t try this at home, kids!"); addAchievementDesc("achPromised2", "...Omega", "Welcome to the Promised Land!");
addAchievementDesc("achBarley2", "Fields Of Gold", "Upon the fields of barley."); addAchievementDesc("achMud2", "Sticky Situation", "I just had these boots cleaned!");
addAchievementDesc("achMoss2", "Mossman", "Mothman's long-lost cousin."); 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"); LanguageRegistry.instance().addStringLocalization("generator.BIOMESOP", "en_US", "Biomes O\' Plenty");
@ -2246,6 +2253,7 @@ public class mod_BiomesOPlenty
public static boolean skyColors; public static boolean skyColors;
public static int biomeSize; public static int biomeSize;
public static boolean addToDefault; public static boolean addToDefault;
public static boolean achievements;
public static boolean vanillaEnhanced; public static boolean vanillaEnhanced;
public static int promisedLandDimID; public static int promisedLandDimID;
@ -2805,46 +2813,49 @@ public class mod_BiomesOPlenty
// Achievement checker // Achievement checker
public static void onItemPickup(EntityPlayer player, ItemStack item) public static void onItemPickup(EntityPlayer player, ItemStack item)
{ {
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) if (achievements == true)
{ {
player.addStat(achFlower2, 1); 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)
} {
if (item.itemID == redRockCobble.blockID) player.addStat(achFlower2, 1);
{ }
player.addStat(achRedRock2, 1); if (item.itemID == redRockCobble.blockID)
} {
if (item.itemID == thorn.blockID) player.addStat(achRedRock2, 1);
{ }
player.addStat(achThorn2, 1); if (item.itemID == thorn.blockID)
} {
player.addStat(achThorn2, 1);
}
if (item.itemID == ashes.itemID) if (item.itemID == ashes.itemID)
{ {
player.addStat(achAsh2, 1); player.addStat(achAsh2, 1);
} }
if (item.itemID == originGrass.blockID) if (item.itemID == originGrass.blockID)
{ {
player.addStat(achOrigin2, 1); player.addStat(achOrigin2, 1);
} }
if (item.itemID == holyGrass.blockID || item.itemID == holyStone.blockID) if (item.itemID == holyGrass.blockID || item.itemID == holyStone.blockID)
{ {
player.addStat(achPromised2, 1); player.addStat(achPromised2, 1);
} }
if (item.itemID == mudBall.itemID) if (item.itemID == mudBall.itemID)
{ {
player.addStat(achMud2, 1); player.addStat(achMud2, 1);
} }
if (item.itemID == toadstool.blockID) if (item.itemID == toadstool.blockID)
{ {
player.addStat(achShroom2, 1); player.addStat(achShroom2, 1);
} }
if (item.itemID == barleyItem.itemID) if (item.itemID == barleyItem.itemID)
{ {
player.addStat(achBarley2, 1); player.addStat(achBarley2, 1);
} }
if (item.itemID == mossItem.itemID) if (item.itemID == mossItem.itemID)
{ {
player.addStat(achMoss2, 1); player.addStat(achMoss2, 1);
} }
}
} }
public static void addAchievementDesc(String ach, String name, String desc) public static void addAchievementDesc(String ach, String name, String desc)