本文整理匯總了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();
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
}