Package net.minecraft.src

Examples of net.minecraft.src.InventoryPlayer


    Zeldo.InitRecipes();
    if (Proxy.IsClient()) {
      long StartTime = new Date().getTime();
      craftableRecipes.clearRecipes();
      recipeList = Collections.unmodifiableList(recipeList);
      InventoryPlayer Temp = new InventoryPlayer( thePlayer );
 
      for(int i = 0; i < Zeldo.ValidOutput.size(); i++) { // Zeldo.ValidOutput.size()
        Temp.copyInventory(thePlayer.inventory);
        //System.out.println("RecipeCheck: " + i + "/" + Zeldo.ValidOutput.size() + " - " + Zeldo.ValidOutput.get(i).ItemID + "@" + Zeldo.ValidOutput.get(i).ItemDamage);
        if ((Boolean)Zeldo.canPlayerCraft(Temp, (ItemDetail)Zeldo.ValidOutput.get(i), theTile, i)[0])
        {
          craftableRecipes.addRecipe(((ItemDetail)Zeldo.ValidOutput.get(i)).iRecipe, i);
        }
View Full Code Here


    if (Proxy.IsClient() && Proxy.isMutiplayer())
    {
      mod_CraftingTableIII.getInstance().SendCraftingPacket(irecipe.getRecipeOutput().copy(), false, Internal.xCoord, Internal.yCoord, Internal.zCoord, RecipeIndex);
    }
   
    InventoryPlayer Temp = new InventoryPlayer( thePlayer );
    Temp.copyInventory(thePlayer.inventory);
   
    InventoryPlayer inventoryPlayer = thePlayer.inventory;
    Object[] iTemp = Zeldo.canPlayerCraft(inventoryPlayer, Internal, new ItemDetail(irecipe.getRecipeOutput()), 0, true, null, null, RecipeIndex);
    Internal.theInventory = ((TileEntityCraftingTableII)iTemp[3]).theInventory;
    thePlayer.inventory.copyInventory((InventoryPlayer) iTemp[1]) ;
   
    //onCraftMatrixChanged(recipeOutputStack);
View Full Code Here

    if (Proxy.IsClient() && Proxy.isMutiplayer())
    {
      mod_CraftingTableIII.getInstance().SendCraftingPacket(irecipe.getRecipeOutput().copy(), true, Internal.xCoord, Internal.yCoord, Internal.zCoord, RecipeIndex);
    }
   
    InventoryPlayer Temp = new InventoryPlayer( thePlayer );
    Temp.copyInventory(thePlayer.inventory);
   
    InventoryPlayer inventoryPlayer = thePlayer.inventory;
    int GoTo = 64;
    if (irecipe.getRecipeOutput().getMaxStackSize() > 1) {
      GoTo = irecipe.getRecipeOutput().getMaxStackSize() / irecipe.getRecipeOutput().stackSize ;
    }
    for (int i=0; i<GoTo; i++)
View Full Code Here

    //onCraftMatrixChanged(recipeOutputStack);
  }
 
  private void onCraftMatrixChanged(ItemStack recipeOutputStack)
  {
    InventoryPlayer inventoryPlayer = thePlayer.inventory;
    // Call custom hooks.
    ModLoader.takenFromCrafting(thePlayer, recipeOutputStack, craftMatrix);
    ForgeHooks.onTakenFromCrafting(thePlayer, recipeOutputStack, craftMatrix);
    // Remove items from the craftMatrix and replace container items.
    for(int i = 0; i < craftMatrix.getSizeInventory(); i++)
    {
            ItemStack itemstack1 = craftMatrix.getStackInSlot(i);
            if(itemstack1 != null)
            {
                craftMatrix.decrStackSize(i, 1);
                if(itemstack1.getItem().hasContainerItem())
                {
                    craftMatrix.setInventorySlotContents(i, new ItemStack(itemstack1.getItem().getContainerItem()));
                }
            }
        }
        // Transfer any remaining items in the craft matrix to the player.
        for(int i = 0; i < craftMatrix.getSizeInventory(); i++) {
          ItemStack itemstack = craftMatrix.getStackInSlot(i);
          if(itemstack != null) {
            inventoryPlayer.addItemStackToInventory(itemstack);
            craftMatrix.setInventorySlotContents(i, null);
          }
        }
  }
View Full Code Here

   
    if (Level > MaxLevel)
      return new Object[] {false, ThePlayer, SlotCount, Internal};

    //Copys to prevent bugs
    InventoryPlayer ThePlayerBefore = new InventoryPlayer(ThePlayer.player);
    ThePlayerBefore.copyInventory(ThePlayer);
    TileEntityCraftingTableII InternalBefore = ((TileEntityCraftingTableII)Internal).getCopy();
   
    int recipeIndex = ForcedIndex;
   
    if (recipeIndex == -1) {
View Full Code Here

   
    if (Level > MaxLevel)
      return new Object[] {false, ThePlayer, SlotCount, Internal};

    //Copys to prevent bugs
    InventoryPlayer ThePlayerBefore = new InventoryPlayer(ThePlayer.player);
    ThePlayerBefore.copyInventory(ThePlayer);
    TileEntityCraftingTableII InternalBefore = ((TileEntityCraftingTableII)Internal).getCopy();
   
    int recipeIndex = ForcedIndex;
   
    if (recipeIndex == -1) {
View Full Code Here

import net.minecraft.src.Slot;

public class InventoryUtil {
  public static void replaceItem(int id, int damage) {
    int slot = -1;
    InventoryPlayer inventory = Minecraft.getMinecraft().thePlayer.inventory;
    for (int i = 0; i < inventory.mainInventory.length; i++) {
      if (inventory.mainInventory[i] != null && i != inventory.currentItem) {
        if (inventory.mainInventory[i].itemID == id && (damage == -1 || (damage == inventory.mainInventory[i].getItemDamage()))) {
          if (!Minecraft.getMinecraft().isMultiplayerWorld()) {
            inventory.mainInventory[inventory.currentItem].stackSize = inventory.mainInventory[i].stackSize;
View Full Code Here

TOP

Related Classes of net.minecraft.src.InventoryPlayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.