當前位置: 首頁>>代碼示例>>Java>>正文


Java Items.iron_ingot方法代碼示例

本文整理匯總了Java中net.minecraft.init.Items.iron_ingot方法的典型用法代碼示例。如果您正苦於以下問題:Java Items.iron_ingot方法的具體用法?Java Items.iron_ingot怎麽用?Java Items.iron_ingot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.init.Items的用法示例。


在下文中一共展示了Items.iron_ingot方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerRepair

import net.minecraft.init.Items; //導入方法依賴的package包/類
private void registerRepair()
{
	ItemStack[] repair = new ItemStack[9];
	
	// Top row
	//repair[0] = new ItemStack(Item.getItemFromBlock(Blocks.obsidian));
	repair[1] = new ItemStack(Blocks.golden_rail);
	//repair[2] = new ItemStack(Item.getItemFromBlock(Blocks.obsidian));
	
	// Middle row
	repair[3] = new ItemStack(Blocks.golden_rail);
	repair[4] = new ItemStack(this, 1 , this.getMaxDamage());
	repair[5] = new ItemStack(Blocks.golden_rail);
	
	// Bottom row
	repair[6] = new ItemStack(Items.redstone);
	repair[7] = new ItemStack(Items.iron_ingot);
	repair[8] = new ItemStack(Items.redstone);
	        
       GameRegistry.addRecipe(new Recipe_ERA(repair, new ItemStack(this)));
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:22,代碼來源:ERA.java

示例2: registerRecipe

import net.minecraft.init.Items; //導入方法依賴的package包/類
private void registerRecipe()
{
	// Fully loaded
	// Alternate item registering method
	ItemStack[] input = new ItemStack[9];

	// Top row
	input[0] = new ItemStack(Item.getItemFromBlock(Blocks.obsidian));
	input[1] = new ItemStack(Blocks.golden_rail, 27);	// 27 rails
	input[2] = new ItemStack(Item.getItemFromBlock(Blocks.obsidian));
	
	// Middle row
	input[3] = new ItemStack(Item.getItemFromBlock(Blocks.obsidian));
	input[4] = new ItemStack(Item.getItemFromBlock(Blocks.ender_chest));
	input[5] = new ItemStack(Item.getItemFromBlock(Blocks.obsidian));
	
	// Bottom row
	input[6] = new ItemStack(Item.getItemFromBlock(Blocks.tripwire_hook));
	input[7] = new ItemStack(Items.iron_ingot);
	input[8] = new ItemStack(Item.getItemFromBlock(Blocks.obsidian));
	        
       GameRegistry.addRecipe(new Recipe_ERA(input, new ItemStack(this)));
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:24,代碼來源:ERA.java

示例3: addRecipes

import net.minecraft.init.Items; //導入方法依賴的package包/類
@Override
public void addRecipes()
{
	if (this.Enabled)
	{
		// One ender rifle (empty)
		GameRegistry.addRecipe(new ItemStack(this, 1 , this.getMaxDamage()), "aza", "bcy", "xzx",
				'x', Blocks.obsidian,
				'y', Blocks.tripwire_hook,
				'z', Items.iron_ingot,
				'a', Items.ender_eye,
				'b', Blocks.piston,
				'c', Blocks.sticky_piston
				);
	}
	else if (Main.noCreative) { this.setCreativeTab(null); }	// Not enabled and not allowed to be in the creative menu

	ItemStack stack = new ItemStack(Items.iron_ingot);

	Helper.makeAmmoRecipe(stack, 1, 1, this.getMaxDamage(), this);
	Helper.makeAmmoRecipe(stack, 2, 2, this.getMaxDamage(), this);
	Helper.makeAmmoRecipe(stack, 3, 3, this.getMaxDamage(), this);
	Helper.makeAmmoRecipe(stack, 4, 4, this.getMaxDamage(), this);
	Helper.makeAmmoRecipe(stack, 5, 5, this.getMaxDamage(), this);
	Helper.makeAmmoRecipe(stack, 6, 6, this.getMaxDamage(), this);
	Helper.makeAmmoRecipe(stack, 7, 7, this.getMaxDamage(), this);
	Helper.makeAmmoRecipe(stack, 8, 8, this.getMaxDamage(), this);
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:29,代碼來源:EnderRifle.java

示例4: registerRidingRecipe

import net.minecraft.init.Items; //導入方法依賴的package包/類
private void registerRidingRecipe()
{
	ItemStack[] input = new ItemStack[3];
	
	input[0] = new ItemStack(this);
	input[1] = new ItemStack(Items.saddle);
	input[2] = new ItemStack(Items.iron_ingot);
	        
       Helper.registerAAUpgradeRecipe(new ItemStack(this), input, "hasRidingUpgrade");
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:11,代碼來源:PackedUpAA.java

示例5: getRepairItem

import net.minecraft.init.Items; //導入方法依賴的package包/類
public Item getRepairItem()
{
    return this == LEATHER ? Items.leather : (this == CHAIN ? Items.iron_ingot : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == DIAMOND ? Items.diamond : null))));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:ItemArmor.java

示例6: isItemValid

import net.minecraft.init.Items; //導入方法依賴的package包/類
public boolean isItemValid(ItemStack stack)
{
    return stack == null ? false : stack.getItem() == Items.emerald || stack.getItem() == Items.diamond || stack.getItem() == Items.gold_ingot || stack.getItem() == Items.iron_ingot;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:ContainerBeacon.java

示例7: onCrafting

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
 */
protected void onCrafting(ItemStack stack)
{
    stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b);

    if (!this.thePlayer.worldObj.isRemote)
    {
        int i = this.field_75228_b;
        float f = FurnaceRecipes.instance().getSmeltingExperience(stack);

        if (f == 0.0F)
        {
            i = 0;
        }
        else if (f < 1.0F)
        {
            int j = MathHelper.floor_float((float)i * f);

            if (j < MathHelper.ceiling_float_int((float)i * f) && Math.random() < (double)((float)i * f - (float)j))
            {
                ++j;
            }

            i = j;
        }

        while (i > 0)
        {
            int k = EntityXPOrb.getXPSplit(i);
            i -= k;
            this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, k));
        }
    }

    this.field_75228_b = 0;

    if (stack.getItem() == Items.iron_ingot)
    {
        this.thePlayer.triggerAchievement(AchievementList.acquireIron);
    }

    if (stack.getItem() == Items.cooked_fish)
    {
        this.thePlayer.triggerAchievement(AchievementList.cookFish);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:49,代碼來源:SlotFurnaceOutput.java

示例8: getRepairItem

import net.minecraft.init.Items; //導入方法依賴的package包/類
public Item getRepairItem()
{
    return this == WOOD ? Item.getItemFromBlock(Blocks.planks) : (this == STONE ? Item.getItemFromBlock(Blocks.cobblestone) : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null))));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:Item.java

示例9: isItemValidForSlot

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
 */
public boolean isItemValidForSlot(int index, ItemStack stack)
{
    return stack.getItem() == Items.emerald || stack.getItem() == Items.diamond || stack.getItem() == Items.gold_ingot || stack.getItem() == Items.iron_ingot;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:8,代碼來源:TileEntityBeacon.java


注:本文中的net.minecraft.init.Items.iron_ingot方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。