当前位置: 首页>>代码示例>>Java>>正文


Java ItemPickupEvent类代码示例

本文整理汇总了Java中cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent的典型用法代码示例。如果您正苦于以下问题:Java ItemPickupEvent类的具体用法?Java ItemPickupEvent怎么用?Java ItemPickupEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ItemPickupEvent类属于cpw.mods.fml.common.gameevent.PlayerEvent包,在下文中一共展示了ItemPickupEvent类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: OnItemPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:OmgImAlexis,项目名称:TheStuffMod,代码行数:22,代码来源:AchievementHandler.java

示例2: notifyPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@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);
		}
	}
		
}
 
开发者ID:AlexDGr8r,项目名称:MeteorsMod,代码行数:21,代码来源:HandlerAchievement.java

示例3: onItemPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:LambdaInnovation,项目名称:LambdaLib,代码行数:15,代码来源:LIFMLGameEventDispatcher.java

示例4: itemPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:KillerMapper,项目名称:roadstuff,代码行数:10,代码来源:EventPlayer.java

示例5: onItemPickedUp

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@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);
        }
    }
}
 
开发者ID:AdvancedMods,项目名称:AMCore,代码行数:11,代码来源:AchievementTriggerer.java

示例6: onItemPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:TheDarkEra,项目名称:TheDarkEra,代码行数:14,代码来源:AchievedHandler.java

示例7: onPlayerItemPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@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);
			}
		}
	}
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:12,代码来源:ACEventHandler.java

示例8: onPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@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);
}
   }
 
开发者ID:OwnAgePau,项目名称:Soul-Forest,代码行数:11,代码来源:CraftingHandler.java

示例9: notifyPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@SubscribeEvent 
public void notifyPickup(ItemPickupEvent e) 
{ 
}
 
开发者ID:Wahazar,项目名称:TFCPrimitiveTech,代码行数:5,代码来源:ModPlayerTracker.java

示例10: PickupPatStar

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@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);
	}
	
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:17,代码来源:OnPickupPatStarEvent.java

示例11: notifyPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@SubscribeEvent 
public void notifyPickup(ItemPickupEvent e) 
{
}
 
开发者ID:AnodeCathode,项目名称:TechNodefirmacraftMod,代码行数:5,代码来源:ModPlayerTracker.java

示例12: notifyPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@SubscribeEvent
public void notifyPickup(ItemPickupEvent event)
{
}
 
开发者ID:Aleksey-Terzi,项目名称:DecorationsTFC,代码行数:5,代码来源:PlayerTracker.java

示例13: onItemPickup

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@SubscribeEvent
public void onItemPickup(ItemPickupEvent event)
{
    triggerAchievement(AchievementSource.ITEM_PICKUP, event.player, event.pickedUp.getEntityItem());
}
 
开发者ID:tterrag1098,项目名称:CustomThings,代码行数:6,代码来源:AchievementHandler.java

示例14: PickupJenStar

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@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);
	}
	
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:16,代码来源:OnPickupJenStarEvent.java


注:本文中的cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。