本文整理汇总了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);
}
}