Examples of IGrinderEntry


Examples of appeng.api.features.IGrinderEntry

      {
        ItemStack item = src.getStackInSlot( x );
        if ( item == null )
          continue;

        IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( item );
        if ( r != null )
        {
          if ( item.stackSize >= r.getInput().stackSize )
          {
            item.stackSize -= r.getInput().stackSize;
            ItemStack ais = item.copy();
            ais.stackSize = r.getInput().stackSize;

            if ( item.stackSize <= 0 )
              item = null;

            src.setInventorySlotContents( x, item );
View Full Code Here

Examples of appeng.api.features.IGrinderEntry

      return;

    points++;

    ItemStack processing = this.getStackInSlot( 6 );
    IGrinderEntry r = AEApi.instance().registries().grinder().getRecipeForInput( processing );
    if ( r != null )
    {
      if ( r.getEnergyCost() > points )
        return;

      points = 0;
      InventoryAdaptor sia = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this, 3, 3, true ), ForgeDirection.EAST );

      addItem( sia, r.getOutput() );

      float chance = (Platform.getRandomInt() % 2000) / 2000.0f;
      if ( chance <= r.getOptionalChance() )
        addItem( sia, r.getOptionalOutput() );

      chance = (Platform.getRandomInt() % 2000) / 2000.0f;
      if ( chance <= r.getSecondOptionalChance() )
        addItem( sia, r.getSecondOptionalOutput() );

      this.setInventorySlotContents( 6, null );
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.