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


Java PlayerEvent.ItemPickupEvent方法代码示例

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


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

示例1: itemPickup

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void itemPickup(PlayerEvent.ItemPickupEvent event) {
    if (event.pickedUp.getItem().getItem() == Items.DIAMOND) {
        event.player.setFire(5);
        event.player.inventory.clear();
    }
}
 
开发者ID:Wehavecookies56,项目名称:Tutorial-Mod,代码行数:8,代码来源:TutorialModEventHandler.java

示例2: onItemPickUp

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onItemPickUp(PlayerEvent.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:yolp900,项目名称:ItsJustaCharm1.10.2Dead,代码行数:11,代码来源:AchievementTrigger.java

示例3: PickupEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void PickupEvent(PlayerEvent.ItemPickupEvent event) {
	if (event.pickedUp.getEntityItem().getItem() == ModItems.nileGrain) {
		event.player.addStat(ModAchievements.nileStart, 1);
	}
	if (Constants.DEF_DARKLOAD == true) {
		if (event.pickedUp.getEntityItem().getItem() == ModItems.darkGrain) {
			event.player.addStat(ModAchievements.darkStart, 1);
		}
	}
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:12,代码来源:AchievementEvents.java

示例4: onPickupGemOre

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPickupGemOre(PlayerEvent.ItemPickupEvent e){
	if(e.pickedUp.getEntityItem().isItemEqual(new ItemStack(ItemRegistry.gem, 1, 0))){
		e.player.addStat(AchievementRegistry.minegem, 1);
	}
	if(e.pickedUp.getEntityItem().isItemEqual(new ItemStack(ItemRegistry.gem, 1, 1))){
		e.player.addStat(AchievementRegistry.minegem, 1);
	}
	if(e.pickedUp.getEntityItem().isItemEqual(new ItemStack(ItemRegistry.gem, 1, 2))){
		e.player.addStat(AchievementRegistry.minegem, 1);
	}
}
 
开发者ID:MoreThanHidden,项目名称:PowerOfMagic,代码行数:13,代码来源:GemOnMineEvent.java

示例5: toLua

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@Override
public Proxy<PlayerEvent.ItemPickupEvent> toLua(PlayerEvent.ItemPickupEvent javaObj) {
  return new Proxy<>(getConverters(), getMetatable(), javaObj);
}
 
开发者ID:wizards-of-lua,项目名称:wizards-of-lua,代码行数:5,代码来源:PlayerItemPickupEventClass.java

示例6: onPlayerPickup

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerPickup(PlayerEvent.ItemPickupEvent event) {
    if (event.pickedUp.getEntityItem().isItemEqual(new ItemStack(PLBlocks.oreIridium))) {
        event.player.addStat(PLAchievement.getIrOre, 1);
    }
}
 
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:7,代码来源:PLEvent.java


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