Added more achievements

This commit is contained in:
Matt Caughey 2016-01-18 03:41:22 -05:00
parent c82041dfc4
commit 7a4043a4aa
4 changed files with 112 additions and 11 deletions

View File

@ -12,6 +12,15 @@ import net.minecraft.stats.Achievement;
public class BOPAchievements
{
public static Achievement obtain_flowers;
public static Achievement obtain_berry;
public static Achievement obtain_coral;
public static Achievement obtain_thorn;
public static Achievement obtain_poison_ivy;
public static Achievement obtain_turnip;
public static Achievement obtain_honeycomb;
public static Achievement obtain_pixie_dust;
public static Achievement obtain_celestial_crystal;
public static Achievement craft_ornamental_artifact;
public static Achievement explore_all_biomes;
}

View File

@ -10,12 +10,6 @@ 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.common.block.BlockBOPFlower;
import biomesoplenty.common.block.BlockBOPLog;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@ -28,6 +22,16 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
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 com.google.common.collect.Sets;
public class AchievementEventHandler
{
@ -50,6 +54,54 @@ public class AchievementEventHandler
{
player.addStat(BOPAchievements.obtain_flowers, 1);
}
//Berry Good Achievement
if (item != null && item == BOPItems.berries)
{
player.addStat(BOPAchievements.obtain_berry, 1);
}
//Totally Coral Achievement
if (block != null && block == BOPBlocks.coral)
{
player.addStat(BOPAchievements.obtain_coral, 1);
}
//Rather Thorny Achievement
if (block != null && block == BlockBOPPlant.paging.getBlock(BOPPlants.THORN))
{
player.addStat(BOPAchievements.obtain_thorn, 1);
}
//Pick Your Poison Achievement
if (block != null && block == BlockBOPPlant.paging.getBlock(BOPPlants.POISONIVY))
{
player.addStat(BOPAchievements.obtain_poison_ivy, 1);
}
//Stalk Market Achievement
if (item != null && item == BOPItems.turnip)
{
player.addStat(BOPAchievements.obtain_turnip, 1);
}
//Honeycomb Crunch Achievement
if (item != null && item == BOPItems.honeycomb)
{
player.addStat(BOPAchievements.obtain_honeycomb, 1);
}
//Don't Breathe This Achievement
if (item != null && item == BOPItems.pixie_dust)
{
player.addStat(BOPAchievements.obtain_pixie_dust, 1);
}
//Far Out Achievement
if (item != null && item == BOPItems.crystal_shard)
{
player.addStat(BOPAchievements.obtain_celestial_crystal, 1);
}
}
@SubscribeEvent

View File

@ -7,13 +7,26 @@
******************************************************************************/
package biomesoplenty.common.init;
import static biomesoplenty.api.achievement.BOPAchievements.*;
import biomesoplenty.api.item.BOPItems;
import static biomesoplenty.api.achievement.BOPAchievements.explore_all_biomes;
import static biomesoplenty.api.achievement.BOPAchievements.obtain_berry;
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 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.BlockBOPGrass;
import biomesoplenty.common.block.BlockBOPPlant;
import biomesoplenty.common.enums.BOPPlants;
public class ModAchievements
{
@ -28,8 +41,17 @@ public class ModAchievements
private static void addAchievements()
{
obtain_flowers = addAchievement("achievement.obtain_flowers", "obtain_flowers", 2, 0, new ItemStack(Blocks.red_flower), null);
explore_all_biomes = addAchievement("achievement.explore_all_biomes", "explore_all_biomes", 0, 0, new ItemStack(BOPItems.earth), null);
obtain_flowers = addAchievement("achievement.obtain_flowers", "obtain_flowers", 0, 0, new ItemStack(Blocks.red_flower), null);
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, -8, new ItemStack(BOPItems.gem), obtain_pixie_dust);
explore_all_biomes = addAchievement("achievement.explore_all_biomes", "explore_all_biomes", 0, -8, new ItemStack(BOPItems.earth), craft_ornamental_artifact).setSpecial();
}
private static Achievement addAchievement(String unlocalizedName, String identifier, int column, int row, ItemStack iconStack, Achievement parent)

View File

@ -1,5 +1,23 @@
achievement.obtain_flowers=Flower Child
achievement.obtain_flowers.desc=Become one with nature!
achievement.obtain_berry=Berry Good
achievement.obtain_berry.desc=Berries are berry nice!...Berry.
achievement.obtain_coral=Totally Coral!
achievement.obtain_coral.desc=That nose job is so coral!
achievement.obtain_turnip=Stalk Market
achievement.obtain_turnip.desc=Sell high, buy low!
achievement.obtain_thorn=Rather Thorny
achievement.obtain_thorn.desc=Yes...Rather thorny indeed...
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_pixie_dust=Don't Breathe This
achievement.obtain_pixie_dust.desc=Pixie smoke...
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.explore_all_biomes=The Wanderer
achievement.explore_all_biomes.desc=Around around around...