Package appeng.container.implementations

Examples of appeng.container.implementations.ContainerCraftAmount


          TileEntity te = context.getTile();
          Platform.openGUI( sender, te, baseContainer.openContext.side, GuiBridge.GUI_CRAFTING_AMOUNT );

          if ( sender.openContainer instanceof ContainerCraftAmount )
          {
            ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer;

            if ( baseContainer.getTargetStack() != null )
            {
              cca.craftingItem.putStack( baseContainer.getTargetStack().getItemStack() );
              cca.whatToMake = baseContainer.getTargetStack();
            }

            cca.detectAndSendChanges();
          }
        }
      }
      else
      {
View Full Code Here


  @Override
  public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player)
  {
    if ( player.openContainer instanceof ContainerCraftAmount )
    {
      ContainerCraftAmount cca = (ContainerCraftAmount) player.openContainer;
      Object target = cca.getTarget();
      if ( target instanceof IGridHost )
      {
        IGridHost gh = (IGridHost) target;
        IGridNode gn = gh.getGridNode( ForgeDirection.UNKNOWN );
        if ( gn == null )
          return;

        IGrid g = gn.getGrid();
        if ( g == null || cca.whatToMake == null )
          return;

        Future<ICraftingJob> futureJob = null;

        cca.whatToMake.setStackSize( amount );

        try
        {
          ICraftingGrid cg = g.getCache( ICraftingGrid.class );
          futureJob = cg.beginCraftingJob( cca.getWorld(), cca.getGrid(), cca.getActionSrc(), cca.whatToMake, null );

          ContainerOpenContext context = cca.openContext;
          if ( context != null )
          {
            TileEntity te = context.getTile();
            Platform.openGUI( player, te, cca.openContext.side, GuiBridge.GUI_CRAFTING_CONFIRM );

            if ( player.openContainer instanceof ContainerCraftConfirm )
            {
              ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer;
              ccc.autoStart = heldShift;
              ccc.job = futureJob;
              cca.detectAndSendChanges();
            }
          }

        }
        catch (Throwable e)
View Full Code Here

  GuiButton minus1, minus10, minus100, minus1000;

  GuiBridge OriginalGui;

  public GuiCraftAmount(InventoryPlayer inventoryPlayer, ITerminalHost te) {
    super( new ContainerCraftAmount( inventoryPlayer, te ) );
  }
View Full Code Here

TOP

Related Classes of appeng.container.implementations.ContainerCraftAmount

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.