本文整理汇总了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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
}
示例9: notifyPickup
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@SubscribeEvent
public void notifyPickup(ItemPickupEvent e)
{
}
示例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);
}
}
示例11: notifyPickup
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@SubscribeEvent
public void notifyPickup(ItemPickupEvent e)
{
}
示例12: notifyPickup
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; //导入依赖的package包/类
@SubscribeEvent
public void notifyPickup(ItemPickupEvent event)
{
}
示例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());
}
示例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);
}
}