當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。