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