Java Code Examples for net.minecraft.init.Items#IRON_INGOT

The following examples show how to use net.minecraft.init.Items#IRON_INGOT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemHelperTests.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void stackMatchesRecipeInput_withStack_returnsFalseIfWrongItem()
{
    ItemStack stack = new ItemStack(Items.GOLD_INGOT);
    RecipeInputImpl input = new RecipeInputImpl(new WrappedItemStackConstant(new ItemStack(Items.IRON_INGOT)));

    assertFalse(ItemHelper.stackMatchesRecipeInput(stack, input, true));
}
 
Example 2
Source File: ItemHelperTests.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void stackMatchesRecipeInput_withStack_returnsTrueIfAmountIsEnough()
{
    ItemStack stack = new ItemStack(Items.IRON_INGOT, 5);
    RecipeInputImpl input = new RecipeInputImpl(new WrappedItemStackConstant(new ItemStack(Items.IRON_INGOT, 5)));

    assertTrue(ItemHelper.stackMatchesRecipeInput(stack, input, true));
}
 
Example 3
Source File: ItemHelperTests.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void stackMatchesRecipeInput_withStack_returnsFalseIfAmountTooSmall()
{
    ItemStack stack = new ItemStack(Items.IRON_INGOT);
    RecipeInputImpl input = new RecipeInputImpl(new WrappedItemStackConstant(new ItemStack(Items.IRON_INGOT, 5)));

    assertFalse(ItemHelper.stackMatchesRecipeInput(stack, input, true));
}
 
Example 4
Source File: ItemHelperTests.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void stackMatchesRecipeInput_withStack_ignoreCount_returnsTrueIfAmountTooSmall()
{
    ItemStack stack = new ItemStack(Items.IRON_INGOT);
    RecipeInputImpl input = new RecipeInputImpl(new WrappedItemStackConstant(new ItemStack(Items.IRON_INGOT, 5)));

    assertTrue(ItemHelper.stackMatchesRecipeInput(stack, input, false));
}
 
Example 5
Source File: ItemHelperTests.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void stackMatchesRecipeInput_withOre_returnsTrueIfAmountIsEnough()
{
    ItemStack stack = new ItemStack(Items.IRON_INGOT, 5);
    RecipeInputImpl input = new RecipeInputImpl("ingotIron", 5);

    assertTrue(ItemHelper.stackMatchesRecipeInput(stack, input, true));
}
 
Example 6
Source File: ItemHelperTests.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void stackMatchesRecipeInput_withOre_returnsFalseIfAmountTooSmall()
{
    ItemStack stack = new ItemStack(Items.IRON_INGOT);
    RecipeInputImpl input = new RecipeInputImpl("ingotIron", 5);

    assertFalse(ItemHelper.stackMatchesRecipeInput(stack, input, true));
}
 
Example 7
Source File: ItemHelperTests.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void stackMatchesRecipeInput_withOre_ignoreCount_returnsTrueIfAmountTooSmall()
{
    ItemStack stack = new ItemStack(Items.IRON_INGOT);
    RecipeInputImpl input = new RecipeInputImpl("ingotIron", 5);

    assertTrue(ItemHelper.stackMatchesRecipeInput(stack, input, false));
}
 
Example 8
Source File: ItemSwordCyberware.java    From Cyberware with MIT License 5 votes vote down vote up
@Override
public ItemStack[] getComponents(ItemStack stack)
{
	return new ItemStack[]
			{
				new ItemStack(Items.IRON_INGOT, 2, 0),
				new ItemStack(CyberwareContent.component, 1, 2),
				new ItemStack(CyberwareContent.component, 1, 4)
			};
}
 
Example 9
Source File: ValkyrienSkiesControl.java    From Valkyrien-Skies with Apache License 2.0 4 votes vote down vote up
@SubscribeEvent
public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
    Module.registerRecipe(event, "recipe_captains_chair",
        new ItemStack(INSTANCE.vsControlBlocks.captainsChair),
        "SLS",
        "VWV",
        " S ",
        'S', Items.STICK,
        'L', Items.LEATHER,
        'W', Item.getItemFromBlock(Blocks.LOG),
        'V', ValkyrienSkiesWorld.INSTANCE.valkyriumCrystal);

    Module.registerRecipe(event, "recipe_basic_engine",
        new ItemStack(INSTANCE.vsControlBlocks.basicEngine, 4),
        "I##",
        "IPP",
        "I##",
        '#', Item.getItemFromBlock(Blocks.PLANKS),
        'P', Item.getItemFromBlock(Blocks.PISTON),
        'I', Items.IRON_INGOT);

    Module.registerRecipe(event, "recipe_advanced_engine_stone",
        new ItemStack(INSTANCE.vsControlBlocks.advancedEngine, 4),
        "I##",
        "IPP",
        "I##",
        '#', Item.getItemFromBlock(Blocks.STONE),
        'P', Item.getItemFromBlock(Blocks.PISTON),
        'I', Items.IRON_INGOT);
    Module.registerRecipe(event, "recipe_advanced_engine_cobblestone",
        new ItemStack(INSTANCE.vsControlBlocks.advancedEngine, 2), "I##", "IPP", "I##", '#',
        Item.getItemFromBlock(Blocks.COBBLESTONE), 'P', Item.getItemFromBlock(Blocks.PISTON),
        'I', Items.IRON_INGOT);
    Module.registerRecipe(event, "recipe_elite_engine",
        new ItemStack(INSTANCE.vsControlBlocks.eliteEngine, 4), "III", "IPP", "III", 'P',
        Item.getItemFromBlock(Blocks.PISTON), 'I', Items.IRON_INGOT);
    Module.registerRecipe(event, "recipe_ultimate_engine",
        new ItemStack(INSTANCE.vsControlBlocks.ultimateEngine, 4), "I##", "IPP", "I##", '#',
        Item.getItemFromBlock(Blocks.OBSIDIAN), 'P', Item.getItemFromBlock(Blocks.PISTON), 'I',
        Items.IRON_INGOT);

    Item relayWireIngot = Items.IRON_INGOT;
    // TODO: Code to check for copper and set relayWireIngot

    Module.registerRecipe(event, "recipe_relay_wire",
        new ItemStack(INSTANCE.relayWire, 4), // 1 per copper/iron ingot
        " I ",
        "ISI",
        " I ",
        'I', relayWireIngot,
        'S', Items.STICK);

    Module.registerRecipe(event, "recipe_compacted_valkyrium",
        new ItemStack(INSTANCE.vsControlBlocks.compactedValkyrium, 1),
        "VVV",
        "VVV",
        "VVV",
        'V', ValkyrienSkiesWorld.INSTANCE.valkyriumCrystal);

    Module.registerRecipe(event, "recipe_valkyrium_engine_part",
        new ItemStack(INSTANCE.vsControlBlocks.valkyriumEnginePart, 1),
        "IVI",
        "VFV",
        "IVI",
        'I', Items.IRON_INGOT,
        'F', Item.getItemFromBlock(Blocks.FURNACE),
        'V', ValkyrienSkiesWorld.INSTANCE.valkyriumCrystal);

    Module.registerRecipe(event, "recipe_valkyrium_compressor_part",
        new ItemStack(INSTANCE.vsControlBlocks.valkyriumCompressorPart, 1),
        "GVG",
        "VFV",
        "GVG",
        'G', Items.GOLD_INGOT,
        'F', Item.getItemFromBlock(Blocks.PISTON),
        'V', ValkyrienSkiesWorld.INSTANCE.valkyriumCrystal);
}
 
Example 10
Source File: SlotFirepitOutput.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
/**
 * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
 */
@Override
protected void onCrafting(ItemStack stack)
{
	stack.onCrafting(this.player.world, this.player, this.removeCount);

	if (!this.player.world.isRemote)
	{
		int i = this.removeCount;
		float f = FurnaceRecipes.instance().getSmeltingExperience(stack);

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

			if (j < MathHelper.ceil((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.player.world.spawnEntity(new EntityXPOrb(this.player.world, this.player.posX, this.player.posY + 0.5D, this.player.posZ + 0.5D, k));
		}
	}

	this.removeCount = 0;

	net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerSmeltedEvent(player, stack);

	if (stack.getItem() == Items.IRON_INGOT)
	{
		this.player.addStat(AchievementList.ACQUIRE_IRON);
	}

	if (stack.getItem() == Items.COOKED_FISH)
	{
		this.player.addStat(AchievementList.COOK_FISH);
	}
}