Added more achievements

This commit is contained in:
Matt Caughey 2016-01-18 13:02:11 -05:00
parent f14e46151b
commit 43bd569c3e
5 changed files with 88 additions and 40 deletions

View file

@ -16,11 +16,16 @@ public class BOPAchievements
public static Achievement obtain_coral;
public static Achievement obtain_thorn;
public static Achievement obtain_poison_ivy;
public static Achievement obtain_deathbloom;
public static Achievement obtain_glowshroom;
public static Achievement obtain_turnip;
public static Achievement obtain_honeycomb;
public static Achievement obtain_pixie_dust;
public static Achievement obtain_ghastly_soul;
public static Achievement obtain_celestial_crystal;
public static Achievement craft_ornamental_artifact;
public static Achievement craft_ambrosia;
public static Achievement explore_all_biomes;
public static Achievement use_enderporter;
}

View file

@ -10,21 +10,10 @@ package biomesoplenty.common.handler;
import java.util.Iterator;
import java.util.Set;
import com.google.common.collect.Sets;
import biomesoplenty.api.achievement.BOPAchievements;
import biomesoplenty.api.biome.BOPBiomes;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.block.BlockBOPFlower;
import biomesoplenty.common.block.BlockBOPLog;
import biomesoplenty.common.block.BlockBOPPlant;
import biomesoplenty.common.enums.BOPPlants;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.AchievementList;
import net.minecraft.util.BlockPos;
import net.minecraft.util.JsonSerializableSet;
@ -34,6 +23,18 @@ import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
import biomesoplenty.api.achievement.BOPAchievements;
import biomesoplenty.api.biome.BOPBiomes;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.block.BlockBOPFlower;
import biomesoplenty.common.block.BlockBOPLog;
import biomesoplenty.common.block.BlockBOPMushroom;
import biomesoplenty.common.block.BlockBOPPlant;
import biomesoplenty.common.enums.BOPFlowers;
import biomesoplenty.common.enums.BOPPlants;
import com.google.common.collect.Sets;
public class AchievementEventHandler
{
@ -80,15 +81,27 @@ public class AchievementEventHandler
{
player.triggerAchievement(BOPAchievements.obtain_poison_ivy);
}
//I am Become Death Achievement
if (block != null && block == BlockBOPFlower.paging.getBlock(BOPFlowers.DEATHBLOOM))
{
player.triggerAchievement(BOPAchievements.obtain_deathbloom);
}
//Stalk Market Achievement
if (item != null && item == BOPItems.turnip)
{
player.triggerAchievement(BOPAchievements.obtain_turnip);
}
//Soul Searching Achievement
if (item != null && item == BOPItems.ghastly_soul)
{
player.triggerAchievement(BOPAchievements.obtain_ghastly_soul);
}
//Honeycomb Crunch Achievement
if (item != null && item == BOPItems.honeycomb)
//Honeycomb's Big Achievement
if (item != null && item == BOPItems.filled_honeycomb)
{
player.triggerAchievement(BOPAchievements.obtain_honeycomb);
}
@ -109,7 +122,14 @@ public class AchievementEventHandler
@SubscribeEvent
public void onItemCrafted(ItemCraftedEvent event)
{
ItemStack item = event.crafting;
Item item = event.crafting.getItem();
EntityPlayer player = event.player;
//Nectar of the Gods Achievement
if (item != null && item == BOPItems.ambrosia)
{
player.triggerAchievement(BOPAchievements.craft_ambrosia);
}
}
@SubscribeEvent

View file

@ -7,24 +7,32 @@
******************************************************************************/
package biomesoplenty.common.init;
import static biomesoplenty.api.achievement.BOPAchievements.craft_ambrosia;
import static biomesoplenty.api.achievement.BOPAchievements.craft_ornamental_artifact;
import static biomesoplenty.api.achievement.BOPAchievements.explore_all_biomes;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_berry;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_celestial_crystal;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_coral;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_flowers;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_thorn;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_poison_ivy;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_turnip;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_honeycomb;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_pixie_dust;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_celestial_crystal;
import static biomesoplenty.api.achievement.BOPAchievements.craft_ornamental_artifact;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_poison_ivy;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_thorn;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_turnip;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_deathbloom;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_glowshroom;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_ghastly_soul;
import static biomesoplenty.api.achievement.BOPAchievements.use_enderporter;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraftforge.common.AchievementPage;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.block.BlockBOPFlower;
import biomesoplenty.common.block.BlockBOPMushroom;
import biomesoplenty.common.block.BlockBOPPlant;
import biomesoplenty.common.enums.BOPFlowers;
import biomesoplenty.common.enums.BOPPlants;
public class ModAchievements
@ -44,13 +52,18 @@ public class ModAchievements
obtain_berry = addAchievement("achievement.obtain_berry", "obtain_berry", 2, 1, new ItemStack(BOPItems.berries), obtain_flowers);
obtain_coral = addAchievement("achievement.obtain_coral", "obtain_coral", 1, -2, new ItemStack(BOPBlocks.coral), obtain_berry);
obtain_thorn = addAchievement("achievement.obtain_thorn", "obtain_thorn", -2, -2, BlockBOPPlant.paging.getVariantItem(BOPPlants.THORN), obtain_coral);
obtain_poison_ivy = addAchievement("achievement.obtain_poison_ivy", "obtain_poison_ivy", -3, 0, BlockBOPPlant.paging.getVariantItem(BOPPlants.POISONIVY), obtain_thorn);
obtain_turnip = addAchievement("achievement.obtain_turnip", "obtain_turnip", -1, -4, new ItemStack(BOPItems.turnip), obtain_coral);
obtain_honeycomb = addAchievement("achievement.obtain_honeycomb", "obtain_honeycomb", 3, -3, new ItemStack(BOPItems.honeycomb), obtain_coral);
obtain_pixie_dust = addAchievement("achievement.obtain_pixie_dust", "obtain_pixie_dust", 5, -4, new ItemStack(BOPItems.pixie_dust), obtain_honeycomb);
obtain_celestial_crystal = addAchievement("achievement.obtain_celestial_crystal", "obtain_celestial_crystal", 7, -1, new ItemStack(BOPItems.crystal_shard), obtain_pixie_dust);
craft_ornamental_artifact = addAchievement("achievement.craft_ornamental_artifact", "craft_ornamental_artifact", 3, -6, new ItemStack(BOPItems.gem), obtain_pixie_dust);
explore_all_biomes = addAchievement("achievement.explore_all_biomes", "explore_all_biomes", 0, -7, new ItemStack(BOPItems.earth), craft_ornamental_artifact).setSpecial();
obtain_glowshroom = addAchievement("achievement.obtain_glowshroom", "obtain_glowshroom", -5, -4, BlockBOPPlant.paging.getVariantItem(BOPPlants.KORU), obtain_coral);
obtain_poison_ivy = addAchievement("achievement.obtain_poison_ivy", "obtain_poison_ivy", -3, 1, BlockBOPPlant.paging.getVariantItem(BOPPlants.POISONIVY), obtain_thorn);
obtain_deathbloom = addAchievement("achievement.obtain_deathbloom", "obtain_deathbloom", -6, 2, BlockBOPFlower.paging.getVariantItem(BOPFlowers.DEATHBLOOM), obtain_poison_ivy);
obtain_turnip = addAchievement("achievement.obtain_turnip", "obtain_turnip", -1, -5, new ItemStack(BOPItems.turnip), obtain_coral);
obtain_honeycomb = addAchievement("achievement.obtain_honeycomb", "obtain_honeycomb", 3, -3, new ItemStack(BOPItems.filled_honeycomb), obtain_coral);
craft_ornamental_artifact = addAchievement("achievement.craft_ornamental_artifact", "craft_ornamental_artifact", 5, -4, new ItemStack(BOPItems.gem), obtain_honeycomb);
obtain_pixie_dust = addAchievement("achievement.obtain_pixie_dust", "obtain_pixie_dust", 7, -2, new ItemStack(BOPItems.pixie_dust), craft_ornamental_artifact);
obtain_ghastly_soul = addAchievement("achievement.obtain_ghastly_soul", "obtain_ghastly_soul", 4, 2, new ItemStack(BOPItems.ghastly_soul), obtain_honeycomb);
obtain_celestial_crystal = addAchievement("achievement.obtain_celestial_crystal", "obtain_celestial_crystal", 6, 0, new ItemStack(BOPItems.crystal_shard), obtain_honeycomb);
craft_ambrosia = addAchievement("achievement.craft_ambrosia", "craft_ambrosia", 8, 4, new ItemStack(BOPItems.ambrosia), obtain_celestial_crystal).setSpecial();
explore_all_biomes = addAchievement("achievement.explore_all_biomes", "explore_all_biomes", 2, -7, new ItemStack(BOPItems.earth), craft_ornamental_artifact).setSpecial();
use_enderporter = addAchievement("achievement.use_enderporter", "use_enderporter", 1, 3, new ItemStack(BOPItems.enderporter), obtain_ghastly_soul).setSpecial();
}
private static Achievement addAchievement(String unlocalizedName, String identifier, int column, int row, ItemStack iconStack, Achievement parent)

View file

@ -195,7 +195,7 @@ public class ModCrafting
GameRegistry.addShapedRecipe(new ItemStack(BOPBlocks.bamboo, 8), new Object [] {" #", "# ", '#', new ItemStack(BOPBlocks.bamboo_thatching)});
GameRegistry.addShapedRecipe(new ItemStack(BOPBlocks.bamboo, 8), new Object [] {"# ", " #", '#', new ItemStack(BOPBlocks.bamboo_thatching)});
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.jar_empty, 3, 0), new Object[] {"# #", "# #", "###", '#', Blocks.glass});
GameRegistry.addShapelessRecipe(new ItemStack(BOPItems.ambrosia), new Object[] {new ItemStack(BOPItems.pixie_dust), new ItemStack(Items.potionitem, 1, 0), BlockBOPFlower.paging.getVariantItem(BOPFlowers.MINERS_DELIGHT), new ItemStack(BOPBlocks.seaweed, 1, BlockBOPSeaweed.SeaweedType.KELP.ordinal()), BlockBOPPlant.paging.getVariantItem(BOPPlants.ROOT), new ItemStack(BOPItems.crystal_shard), new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.HONEY.ordinal()), new ItemStack(BOPItems.berries), Items.sugar});
GameRegistry.addShapelessRecipe(new ItemStack(BOPItems.ambrosia), new Object[] {new ItemStack(BOPItems.pixie_dust), new ItemStack(Items.potionitem, 1, 0), new ItemStack(BOPItems.ichor), new ItemStack(BOPBlocks.seaweed, 1, BlockBOPSeaweed.SeaweedType.KELP.ordinal()), BlockBOPPlant.paging.getVariantItem(BOPPlants.ROOT), new ItemStack(BOPItems.crystal_shard), new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.HONEY.ordinal()), new ItemStack(BOPItems.berries), Items.sugar});
GameRegistry.addShapedRecipe(new ItemStack(BOPBlocks.flesh), new Object[] {"##", "##", '#', new ItemStack(BOPItems.fleshchunk)});
GameRegistry.addShapedRecipe(new ItemStack(Items.rotten_flesh), new Object[] {"FFF", "FPF", "FFF", 'F', new ItemStack(BOPItems.fleshchunk), 'P', new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.POISON.ordinal())});

View file

@ -1,25 +1,35 @@
achievement.obtain_flowers=Flower Child
achievement.obtain_flowers.desc=Become one with nature!
achievement.obtain_flowers.desc=Find a fresh flower!
achievement.obtain_berry=Berry Good
achievement.obtain_berry.desc=Berries are berry nice!...Berry.
achievement.obtain_berry.desc=Pick a ripe berry from a bush
achievement.obtain_coral=Totally Coral!
achievement.obtain_coral.desc=That nose job is so coral!
achievement.obtain_coral.desc=Dive deep for coral
achievement.obtain_turnip=Stalk Market
achievement.obtain_turnip.desc=Sell high, buy low!
achievement.obtain_turnip.desc=Harvest a turnip
achievement.obtain_glowshroom=Fluorescent Fungi
achievement.obtain_glowshroom.desc=Find a glowing glowshroom!
achievement.obtain_thorn=Rather Thorny
achievement.obtain_thorn.desc=Yes...Rather thorny indeed...
achievement.obtain_thorn.desc=Collect a prickly thorn!
achievement.obtain_poison_ivy=Pick Your Poison
achievement.obtain_poison_ivy.desc=Too late, you already did!
achievement.obtain_honeycomb=Honeycomb Crunch
achievement.obtain_honeycomb.desc=Yeah yeah yeah
achievement.obtain_poison_ivy.desc=Pluck some poison ivy from the ground
achievement.obtain_deathbloom=I am Become Death
achievement.obtain_deathbloom.desc=Acquire a deadly deathbloom
achievement.obtain_honeycomb=Honeycomb's Big
achievement.obtain_honeycomb.desc=Steal a filled honeycomb from a Nether wasp hive
achievement.obtain_ghastly_soul=Soul Searching
achievement.obtain_ghastly_soul.desc=Kill a Phantom and take its soul
achievement.obtain_pixie_dust=Don't Breathe This
achievement.obtain_pixie_dust.desc=Pixie smoke...
achievement.obtain_pixie_dust.desc=Slay a pixie and collect its magical dust
achievement.obtain_celestial_crystal=Far Out...
achievement.obtain_celestial_crystal.desc=This is from like, the cosmos, man...
achievement.craft_ornamental_artifact=Captain Glam-It
achievement.craft_ornamental_artifact.desc=By your powers combined...
achievement.obtain_celestial_crystal.desc=Mine celestial crystals in the End
achievement.craft_ornamental_artifact=Go Planet!
achievement.craft_ornamental_artifact.desc=Combine all 8 biome-exclusive gems together
achievement.craft_ambrosia=Nectar of the Gods
achievement.craft_ambrosia.desc=Sugar, water, honey, berries, roots, kelp, ichor, pixie dust, and celestial crystals!
achievement.explore_all_biomes=The Wanderer
achievement.explore_all_biomes.desc=Around around around...
achievement.explore_all_biomes.desc=Truly discover all biomes
achievement.use_enderporter=Gone Home
achievement.use_enderporter.desc=Travel back to the spawn point with an enderporter
biome_finder.searching=Searching for %s
biome_finder.found=Found %s!