BiomesOPlenty/common/biomesoplenty/handlers/BOPPickupHandler.java

85 lines
2.7 KiB
Java
Raw Normal View History

2013-11-13 03:48:32 +00:00
package biomesoplenty.handlers;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
2013-11-13 09:57:25 +00:00
import net.minecraft.stats.AchievementList;
2013-11-13 03:48:32 +00:00
import biomesoplenty.api.Blocks;
import biomesoplenty.api.Items;
import biomesoplenty.configuration.BOPAchievements;
import cpw.mods.fml.common.IPickupNotifier;
public class BOPPickupHandler implements IPickupNotifier
{
@Override
public void notifyPickup(EntityItem item, EntityPlayer player)
{
2013-11-13 09:57:25 +00:00
//Getting Wood (Vanilla
if (item.getEntityItem().itemID == Blocks.logs1.get().blockID || item.getEntityItem().itemID == Blocks.logs2.get().blockID || item.getEntityItem().itemID == Blocks.logs3.get().blockID || item.getEntityItem().itemID == Blocks.logs4.get().blockID)
{
player.addStat(AchievementList.mineWood, 1);
}
2013-11-13 03:48:32 +00:00
//Flower Child
if (item.getEntityItem().itemID == Blocks.flowers.get().blockID || item.getEntityItem().itemID == Blocks.flowers2.get().blockID || item.getEntityItem().itemID == Block.plantRed.blockID || item.getEntityItem().itemID == Block.plantYellow.blockID)
{
player.addStat(BOPAchievements.achFlower, 1);
}
//Berry Picking
if (item.getEntityItem().itemID == Items.food.get().itemID && (item.getEntityItem().getItemDamage() == 0))
{
player.addStat(BOPAchievements.achBerry, 1);
}
//Rather Thorny
if (item.getEntityItem().itemID == Blocks.plants.get().blockID && (item.getEntityItem().getItemDamage() == 5))
{
player.addStat(BOPAchievements.achThorn, 1);
}
//A Rolling Stone
if (item.getEntityItem().itemID == Blocks.moss.get().blockID)
{
player.addStat(BOPAchievements.achMoss, 1);
}
//Nutritious
if (item.getEntityItem().itemID == Blocks.coral.get().blockID && (item.getEntityItem().getItemDamage() > 3))
{
player.addStat(BOPAchievements.achCoral, 1);
}
2013-11-13 06:48:59 +00:00
//Bittersweet
if (item.getEntityItem().itemID == Items.food.get().itemID && (item.getEntityItem().getItemDamage() == 9))
2013-11-13 06:48:59 +00:00
{
player.addStat(BOPAchievements.achHoney, 1);
}
2013-11-13 03:48:32 +00:00
//Decay
if (item.getEntityItem().itemID == Blocks.plants.get().blockID && (item.getEntityItem().getItemDamage() == 13))
{
player.addStat(BOPAchievements.achWitherWart, 1);
}
//Gravedigger
if (item.getEntityItem().itemID == Blocks.grave.get().blockID)
{
player.addStat(BOPAchievements.achGrave, 1);
}
//Phantom Menace
2013-11-16 03:10:30 +00:00
if (item.getEntityItem().itemID == Items.miscItems.get().itemID && (item.getEntityItem().getItemDamage() == 10))
2013-11-13 03:48:32 +00:00
{
player.addStat(BOPAchievements.achPhantom, 1);
}
//Blue Sky
if (item.getEntityItem().itemID == Items.miscItems.get().itemID && (item.getEntityItem().getItemDamage() == 4))
{
player.addStat(BOPAchievements.achCelestial, 1);
}
}
}