Package appeng.api.networking.security

Examples of appeng.api.networking.security.BaseActionSource


    this.craftingMethods.clear();
    this.craftableItems.clear();
    this.emitableItems.clear();

    // update the stuff that was in the list...
    this.storageGrid.postAlterationOfStoredItems( StorageChannel.ITEMS, oldItems.keySet(), new BaseActionSource() );

    // re-create list..
    for (ICraftingProvider provider : this.craftingProviders)
    {
      provider.provideCrafting( this );
    }

    Map<IAEItemStack, Set<ICraftingPatternDetails>> tmpCraft = new HashMap<IAEItemStack, Set<ICraftingPatternDetails>>();

    // new craftables!
    for (ICraftingPatternDetails details : this.craftingMethods.keySet())
    {
      for (IAEItemStack out : details.getOutputs())
      {
        out = out.copy();
        out.reset();
        out.setCraftable( true );

        Set<ICraftingPatternDetails> methods = tmpCraft.get( out );

        if ( methods == null )
        {
          tmpCraft.put( out, methods = new TreeSet<ICraftingPatternDetails>( comp ) );
        }

        methods.add( details );
      }
    }

    // make them immutable
    for (Entry<IAEItemStack, Set<ICraftingPatternDetails>> e : tmpCraft.entrySet())
    {
      this.craftableItems.put( e.getKey(), ImmutableList.copyOf( e.getValue() ) );
    }

    this.storageGrid.postAlterationOfStoredItems( StorageChannel.ITEMS, this.craftableItems.keySet(), new BaseActionSource() );
  }
View Full Code Here


    if ( inactiveCellProviders.contains( cc ) )
    {
      inactiveCellProviders.remove( cc );
      activeCellProviders.add( cc );

      BaseActionSource actionSrc = new BaseActionSource();
      if ( cc instanceof IActionHost )
        actionSrc = new MachineSource( (IActionHost) cc );

      for (IMEInventoryHandler<IAEItemStack> h : cc.getCellArray( StorageChannel.ITEMS ))
      {
View Full Code Here

    if ( activeCellProviders.contains( cc ) )
    {
      inactiveCellProviders.add( cc );
      activeCellProviders.remove( cc );

      BaseActionSource actionSrc = new BaseActionSource();
      if ( cc instanceof IActionHost )
        actionSrc = new MachineSource( (IActionHost) cc );

      for (IMEInventoryHandler<IAEItemStack> h : cc.getCellArray( StorageChannel.ITEMS ))
      {
View Full Code Here

    ItemStack paintBall = getColor( is );

    IMEInventory<IAEItemStack> inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
    if ( inv != null )
    {
      IAEItemStack option = inv.extractItems( AEItemStack.create( paintBall ), Actionable.SIMULATE, new BaseActionSource() );

      if ( option != null )
      {
        paintBall = option.getItemStack();
        paintBall.stackSize = 1;
      }
      else
        paintBall = null;

      if ( !Platform.hasPermissions( new DimensionalCoord( w, x, y, z ), p ) )
        return false;

      if ( paintBall != null && paintBall.getItem() instanceof ItemSnowball )
      {
        ForgeDirection orientation = ForgeDirection.getOrientation( side );
        TileEntity te = w.getTileEntity( x, y, z );
        // clean cables.
        if ( te instanceof IColorableTile )
        {
          if ( getAECurrentPower( is ) > powerPerUse && ((IColorableTile) te).getColor() != AEColor.Transparent )
          {
            if ( ((IColorableTile) te).recolourBlock( orientation, AEColor.Transparent, p ) )
            {
              inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() );
              extractAEPower( is, powerPerUse );
              return true;
            }
          }
        }

        // clean paint balls..
        Block testBlk = w.getBlock( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ );
        TileEntity painted = w.getTileEntity( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ );
        if ( getAECurrentPower( is ) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint )
        {
          inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() );
          extractAEPower( is, powerPerUse );
          ((TilePaint) painted).cleanSide( orientation.getOpposite() );
          return true;
        }
      }
      else if ( paintBall != null )
      {
        AEColor color = getColorFromItem( paintBall );

        if ( color != null && getAECurrentPower( is ) > powerPerUse )
        {
          if ( color != AEColor.Transparent
              && recolourBlock( blk, ForgeDirection.getOrientation( side ), w, x, y, z, ForgeDirection.getOrientation( side ), color, p ) )
          {
            inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() );
            extractAEPower( is, powerPerUse );
            return true;
          }
        }
View Full Code Here

TOP

Related Classes of appeng.api.networking.security.BaseActionSource

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.