Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ea54ccbcf5 | |||
| 7796c6d4b6 |
@@ -24,8 +24,10 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import appeng.api.config.FuzzyMode;
|
import appeng.api.config.FuzzyMode;
|
||||||
|
import appeng.api.storage.data.IItemList;
|
||||||
import appeng.container.implementations.ContainerPatternTerm;
|
import appeng.container.implementations.ContainerPatternTerm;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
@@ -208,7 +210,7 @@ public class PacketJEIRecipe extends AppEngPacket
|
|||||||
IAEItemStack mostDamaged = null;
|
IAEItemStack mostDamaged = null;
|
||||||
for( IAEItemStack is : outList )
|
for( IAEItemStack is : outList )
|
||||||
{
|
{
|
||||||
if (!is.isCraftable())
|
if( !is.isCraftable() )
|
||||||
{
|
{
|
||||||
if( mostDamaged == null || mostDamaged.getItemDamage() < is.getItemDamage() )
|
if( mostDamaged == null || mostDamaged.getItemDamage() < is.getItemDamage() )
|
||||||
{
|
{
|
||||||
@@ -235,6 +237,22 @@ public class PacketJEIRecipe extends AppEngPacket
|
|||||||
// Fall back using an existing item
|
// Fall back using an existing item
|
||||||
out = storage.extractItems( request, Actionable.SIMULATE, cct.getActionSource() );
|
out = storage.extractItems( request, Actionable.SIMULATE, cct.getActionSource() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( out == null )
|
||||||
|
{
|
||||||
|
IItemList<IAEItemStack> items = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||||
|
Iterator<IAEItemStack> iterator = inv.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ).getAvailableItems( items ).iterator();
|
||||||
|
while ( iterator.hasNext() )
|
||||||
|
{
|
||||||
|
final IAEItemStack o = iterator.next();
|
||||||
|
if( o.getDefinition().isItemEqual( request.getDefinition() ) && o.isCraftable() )
|
||||||
|
{
|
||||||
|
out = o;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( out != null )
|
if( out != null )
|
||||||
|
|||||||
@@ -329,6 +329,7 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
|
|||||||
|
|
||||||
// Reduce the cache size
|
// Reduce the cache size
|
||||||
this.cachedAeStacks = Arrays.copyOf( this.cachedAeStacks, slots );
|
this.cachedAeStacks = Arrays.copyOf( this.cachedAeStacks, slots );
|
||||||
|
this.skipSlots = new ArrayList<>(this.itemHandler.getSlots());
|
||||||
}
|
}
|
||||||
|
|
||||||
return changes;
|
return changes;
|
||||||
|
|||||||
Reference in New Issue
Block a user