Java 类cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent 实例源码

项目:TheStuffMod    文件:AchievementHandler.java   
@SubscribeEvent
public void OnItemPickup(ItemPickupEvent event){
    if(event.pickedUp.getEntityItem().getItem().equals(Item.getItemFromBlock(Blocks.dirt))) {
        event.player.addStat(ModAchievements.dirt, 1);
    }
    if(event.pickedUp.getEntityItem().getItem().equals(Item.getItemFromBlock(ModBlocks.oreCopper))) {
        event.player.addStat(ModAchievements.mineCopper, 1);
    }
    if(event.pickedUp.getEntityItem().getItem().equals(ModItems.uranium)) {
        event.player.addStat(ModAchievements.mineUranium, 1);
    }
    if(event.pickedUp.getEntityItem().getItem().equals(ModItems.iridium)) {
        event.player.addStat(ModAchievements.mineUranium, 1);
    }
    if(event.pickedUp.getEntityItem().getItem().equals(ModItems.plutonium)) {
        event.player.addStat(ModAchievements.mineUranium, 1);
    }
    if(UtilityCheck.isItemImpureGem(event.pickedUp.getEntityItem().getItem())) {
        event.player.addStat(ModAchievements.mineGem, 1);
    }
}
项目:MeteorsMod    文件:HandlerAchievement.java   
@SubscribeEvent
public void notifyPickup(ItemPickupEvent event) {

    EntityPlayer player = event.player;
    if (HandlerPlayerTick.getMagnetizationLevel(player) > 0) {
        player.triggerAchievement(attractedDrop);
    }

    ItemStack iStack = event.pickedUp.getEntityItem();
    if (iStack != null) {
        Item item = iStack.getItem();
        if ((item == null) || (player == null)) return;
        if (item == MeteorItems.itemMeteorChips || item == MeteorItems.itemFrezaCrystal || item == MeteorItems.itemKreknoChip) {
            player.triggerAchievement(materialGather);
        } else if (item == MeteorItems.itemRedMeteorGem) {
            player.triggerAchievement(meteorManipulator);
        }
    }

}
项目:LambdaLib    文件:LIFMLGameEventDispatcher.java   
@SubscribeEvent
public void onItemPickup(ItemPickupEvent event) {
    if (!addItemPickup.isEmpty()) {
        hItemPickup.addAll(addItemPickup);
        addItemPickup.clear();
    }
    for (Iterator<LIHandler> it = hItemPickup.iterator(); it.hasNext(); ) {
        LIHandler handler = it.next();
        if (handler.isDead())
            it.remove();
        else
            handler.trigger(event);
    }
}
项目:roadstuff    文件:EventPlayer.java   
@SubscribeEvent
public void itemPickup(ItemPickupEvent eventPicked)
{
    if(eventPicked.pickedUp.getEntityItem().getItem() == RoadStuffItems.itemBitumen && eventPicked.pickedUp.getEntityItem().getItemDamage() == 0)
    {
        if(eventPicked.player != null)
            eventPicked.player.triggerAchievement(RoadStuffAchievements.getBitumen);
    }
}
项目:AMCore    文件:AchievementTriggerer.java   
@SubscribeEvent
public void onItemPickedUp(ItemPickupEvent event) {
    ItemStack stack = event.pickedUp.getEntityItem();
    if (stack != null && stack.getItem() instanceof IPickupAchievement) {
        Achievement achievement = ((IPickupAchievement) stack.getItem()).getAchievementOnPickup(stack, event.player, event.pickedUp);
        if(achievement != null) {
            event.player.addStat(achievement, 1);
        }
    }
}
项目:TheDarkEra    文件:AchievedHandler.java   
@SubscribeEvent
public void onItemPickup(ItemPickupEvent event){
    Item item = event.pickedUp.getEntityItem().getItem();

    if(item.equals(TDETools.ancient_pickaxe) || item.equals(TDETools.ancient_axe) || item.equals(TDETools.ancient_shovel) || item.equals(TDETools.ancient_hoe) || item.equals(TDEWeapons.ancient_dagger) || item.equals(TDEWeapons.ancient_sword)){
        AchievementHandler.setAchieved(TDEAchievements.ancient_upgrade);
        ScoreStat.addScore(1);
    }
    if(item.equals(TDEWeapons.death_sword)){
        AchievementHandler.setAchieved(TDEAchievements.death_lord);
        ScoreStat.addScore(1);
    }
}
项目:AgeCraft-Old    文件:ACEventHandler.java   
@SubscribeEvent
public void onPlayerItemPickup(ItemPickupEvent event) {
    for(String page : TechTree.pages.keySet()) {
        ArrayList<TechTreeComponent> components = TechTree.pages.get(page);
        for(TechTreeComponent component : components) {
            if(component.goal.hasReachedGoal(event.pickedUp.getEntityItem()) && TechTreeServer.canUnlockComponent(event.player.getCommandSenderName(), component.pageName, component.name)) {
                TechTreeServer.unlockComponent(event.player.getCommandSenderName(), component.pageName, component.name);
            }
        }
    }
}
项目:Soul-Forest    文件:CraftingHandler.java   
@SubscribeEvent
   public void onPickup(ItemPickupEvent event){
String pickedUpItem = event.pickedUp.getEntityItem().getItem().getUnlocalizedName();
if(pickedUpItem.equals(SoulItems.BlueGel.get().getUnlocalizedName())){
    event.player.addStat(InitAchievements.gel, 1);
}
if(pickedUpItem.equals(SoulItems.FrostShard.get().getUnlocalizedName()) || pickedUpItem.equals(SoulItems.StrengthShard.get().getUnlocalizedName()) || pickedUpItem.equals(SoulItems.BucketSoulWater.get().getUnlocalizedName())){
    event.player.addStat(InitAchievements.shards, 1);
}
   }
项目:TFCPrimitiveTech    文件:ModPlayerTracker.java   
@SubscribeEvent 
public void notifyPickup(ItemPickupEvent e) 
{ 
}
项目:PopularMMOS-EpicProportions-Mod    文件:OnPickupPatStarEvent.java   
@SubscribeEvent
    public void PickupPatStar(PlayerEvent.ItemPickupEvent event) {

        event.setResult(ALLOW);

        //event.player.triggerAchievement(Achievements.achievementPatStar);



    if (event.pickedUp.getEntityItem() == itemstack)
    {
    event.player.addStat(Achievements.achievementPatStar, 1);
    event.setResult(ALLOW);
    }

}
项目:TFCTech    文件:ModPlayerTracker.java   
@SubscribeEvent 
public void notifyPickup(ItemPickupEvent e) 
{ 
}
项目:TerraFirmaProgressivePack    文件:TFCPPPlayerTracker.java   
@SubscribeEvent 
public void notifyPickup(ItemPickupEvent e) 
{ 
}
项目:TechNodefirmacraftMod    文件:ModPlayerTracker.java   
@SubscribeEvent 
public void notifyPickup(ItemPickupEvent e) 
{
}
项目:DecorationsTFC    文件:PlayerTracker.java   
@SubscribeEvent
public void notifyPickup(ItemPickupEvent event)
{
}
项目:MerchantsTFC    文件:PlayerTracker.java   
@SubscribeEvent
public void notifyPickup(ItemPickupEvent event)
{
}
项目:LanternsTFC    文件:PlayerTracker.java   
@SubscribeEvent
public void notifyPickup(ItemPickupEvent event)
{
}
项目:DecorationsTFC    文件:PlayerTracker.java   
@SubscribeEvent
public void notifyPickup(ItemPickupEvent event)
{
}
项目:CustomThings    文件:AchievementHandler.java   
@SubscribeEvent
public void onItemPickup(ItemPickupEvent event)
{
    triggerAchievement(AchievementSource.ITEM_PICKUP, event.player, event.pickedUp.getEntityItem());
}
项目:PopularMMOS-EpicProportions-Mod    文件:OnPickupJenStarEvent.java   
@SubscribeEvent
    public void PickupJenStar(PlayerEvent.ItemPickupEvent event) {

        event.setResult(ALLOW);

        //event.player.triggerAchievement(Achievements.achievementJenStar);



    if (event.pickedUp.getEntityItem() == itemstack)
    {
    event.player.addStat(Achievements.achievementJenStar, 1);
    }

}