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


Java PlayerEvent.ItemCraftedEvent方法代码示例

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


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

示例1: onCrafting

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onCrafting(PlayerEvent.ItemCraftedEvent event) {
    //TODO: Extractify
    EntityPlayer player = event.player;
    ItemStack stack = event.crafting;
    IInventory craftMatrix = event.craftMatrix;
    for (int i = 0; i < craftMatrix.getSizeInventory(); i++) {
        ItemStack here = craftMatrix.getStackInSlot(i);
        if (here == null) {
            continue;
        }
        Item item = here.getItem();
        if (item instanceof IActOnCraft) {
            ((IActOnCraft) item).onCraft(here, craftMatrix, i, stack, player);
        }
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:18,代码来源:Registry.java

示例2: event

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void event(PlayerEvent.ItemCraftedEvent e) {
    if (e.crafting.getItem() instanceof Bag) {
        giveAchievement(e.player, Achievements.firstBag);
        Bag bag = (Bag) e.crafting.getItem();
        Bagginses.analytics.eventDesign("BagCrafted:" + bag.getType().name().toLowerCase() + bag.getColor() + ":" + (isSoulBound(e.crafting) ? "soulbound" : "notSoulbound"), Bagginses.analytics.userPrefix());
        if (((Bag) e.crafting.getItem()).getType() == BagTypes.VOID) {
            giveAchievement(e.player, Achievements.voidBag);
        }
        else if(((Bag) e.crafting.getItem()).getType() == BagTypes.ENDER) {
            giveAchievement(e.player, Achievements.enderBag);
        }
        else if (((Bag) e.crafting.getItem()).getType() == BagTypes.TIER2) {
            giveAchievement(e.player, Achievements.tier2Bag);
        }
        else if (((Bag) e.crafting.getItem()).getType() == BagTypes.TIER3) {
            giveAchievement(e.player, Achievements.tier3Bag);
        }
    }
}
 
开发者ID:lorddusk,项目名称:Bagginses,代码行数:21,代码来源:AchievementEventHandler.java

示例3: onItemCraft

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void onItemCraft(PlayerEvent.ItemCraftedEvent event) {
    ItemStack stack = event.crafting;
    if (stack.getItem() == FirstAidItems.BANDAGE) {
        String username = event.player.getName();
        if (username.equalsIgnoreCase("ichun"))
            stack.setStackDisplayName("MediChun's Healthkit"); //Yup, I *had* to do this
    }
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:10,代码来源:EventHandler.java

示例4: onItemCrafted

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onItemCrafted(PlayerEvent.ItemCraftedEvent event) {
	ItemStack stack = event.crafting;
	if (stack != null && stack.getItem() instanceof ICraftAchievement) {
		Achievement achievement = ((ICraftAchievement)stack.getItem()).getAchievementOnCraft(stack, event.player, event.craftMatrix);
		if (achievement != null) {
			event.player.addStat(achievement, 1);
		}
	}
}
 
开发者ID:yolp900,项目名称:ItsJustaCharm1.10.2Dead,代码行数:11,代码来源:AchievementTrigger.java

示例5: onItemCraft

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onItemCraft( PlayerEvent.ItemCraftedEvent event ){
    for( Achievement a : Achievements.craftAchievements ){
        if( Achievements.achievementsIgnoreMeta.get( a.hashCode() ) ){
            if( event.crafting.getItem() == a.theItemStack.getItem() ){
                Achievements.trigger( a, event.player );
            }
        } else{
            if( ItemStack.areItemsEqual( event.crafting, a.theItemStack ) ){
                Achievements.trigger( a, event.player );
            }
        }
    }
}
 
开发者ID:davqvist,项目名称:CustomAchievements,代码行数:15,代码来源:AchievementHandler.java

示例6: onItemCrafted

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
		public void onItemCrafted(PlayerEvent.ItemCraftedEvent event)
		{
//			Item item = event.crafting.getItem();
//
//			if (item == Item.getItemFromBlock(ModBlocks.UNCRAFTING_TABLE))
//			{
//				event.player.addStat(CRAFT_TABLE);
//			}
		}
 
开发者ID:crazysnailboy,项目名称:UncraftingTable,代码行数:11,代码来源:ModAchievementList.java

示例7: onCrafting

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void onCrafting(PlayerEvent.ItemCraftedEvent event)
{
    Item item = event.crafting.getItem();
    EntityPlayer player = event.player;
    if(item instanceof ItemMHSword)
        player.addStat(MHAchievements.firstSword);
}
 
开发者ID:alxnns1,项目名称:MobHunter,代码行数:9,代码来源:EventHandler.java

示例8: CraftingEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void CraftingEvent(PlayerEvent.ItemCraftedEvent event) {
	if (event.crafting.getItem() == ModItems.nileEssence) {
		event.player.addStat(ModAchievements.nileStart, 1);
	}
	if (event.crafting.getItem() == ModItems.nileDust) {
		event.player.addStat(ModAchievements.nileStart, 1);
	}
	if (event.crafting.getItem() == ModItems.nileSword) {
		event.player.addStat(ModAchievements.buildNileSword, 1);
	}
	if (event.crafting.getItem() == Item.getItemFromBlock(ModBlocks.nileWorktable)) {
		event.player.addStat(ModAchievements.buildNWorkBench, 1);
	}
	if (event.crafting.getItem() == ModItems.nileBone) {
		event.player.addStat(ModAchievements.buildNileBone, 1);
	}

	if (Constants.DEF_DARKLOAD == true) {
		if (event.crafting.getItem() == ModItems.darkEssence) {
			event.player.addStat(ModAchievements.darkStart, 1);
		}
		if (event.crafting.getItem() == ModItems.darkDust) {
			event.player.addStat(ModAchievements.darkStart, 1);
		}

		if (event.crafting.getItem() == ModItems.darkSword) {
			event.player.addStat(ModAchievements.buildDarkSword, 1);
		}
		if (event.crafting.getItem() == ModItems.darkBone) {
			event.player.addStat(ModAchievements.buildDarkBone, 1);
		}
	}
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:35,代码来源:AchievementEvents.java

示例9: onCrafting

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onCrafting(PlayerEvent.ItemCraftedEvent event){
	Item item = event.crafting.getItem();
	EntityPlayer thePlayer = event.player;

		if (item.equals(Item.getItemFromBlock(BlockLoader.cheesePress))){
			event.player.addStat(AchieveLoad.cheesePress, 1);
		}else if (item.equals(ItemLoader.knife)){
			//EFLog.error("PING!");
			event.player.addStat(AchieveLoad.obtainKnife, 1);
		}

}
 
开发者ID:TeamDmfMM,项目名称:Extra-Food,代码行数:14,代码来源:CraftingAchievements.java

示例10: onCrafting

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onCrafting(PlayerEvent.ItemCraftedEvent event)
{
 /*if (event.crafting.getItem() == ItemRegistry.bucketliquidWaterSource ) {
     event.player.addStat(AchievementRegistry.stickyooze, 1);
    }
 if (event.crafting.getItem() == ItemRegistry.bucketliquidFire ) {
     event.player.addStat(AchievementRegistry.stickyooze, 1);
 	}
 if (event.crafting.getItem() == ItemRegistry.bucketliquidGrass ) {
     event.player.addStat(AchievementRegistry.stickyooze, 1);
 	}
*/
}
 
开发者ID:MoreThanHidden,项目名称:PowerOfMagic,代码行数:15,代码来源:CraftingHandler.java

示例11: onCraftingCake

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onCraftingCake(PlayerEvent.ItemCraftedEvent event) {
    if (event.crafting.getItem() instanceof ItemFruitCake || event.crafting.getItem() instanceof ItemVegetableCake)
        event.craftMatrix.setInventorySlotContents(1, new ItemStack(FCRItems.GLASS_BOTTLE));
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:6,代码来源:EventLoader.java

示例12: onPlayerCrafting

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerCrafting(PlayerEvent.ItemCraftedEvent event) {
    if (event.crafting.getItem().equals(PLBlocks.carbonizeFurnace.getItem())) {
        event.player.addStat(PLAchievement.getCarbonizeFurnace, 1);
    }
}
 
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:7,代码来源:PLEvent.java

示例13: onItemCrafted

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onItemCrafted (PlayerEvent.ItemCraftedEvent event) {

}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:5,代码来源:ItemEvents.java

示例14: onCraftingEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
/**
 * Method used to decrease item damage of forging item after each used.
 * 
 * @param event = event passed as reference.
 */
@SubscribeEvent
public void onCraftingEvent(PlayerEvent.ItemCraftedEvent event) {
}
 
开发者ID:hockeyhurd,项目名称:Project-Zed,代码行数:9,代码来源:CraftingEventHandler.java


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