Fixed isDifferent in Interface Terminal sending items constantly.

Better cache.
This commit is contained in:
AlgorithmX2
2014-08-14 20:23:37 -05:00
parent 881654d48d
commit 809495c573
2 changed files with 8 additions and 8 deletions
+7 -7
View File
@@ -110,25 +110,25 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
}
// rather simple client side cacheing.
static WeakHashMap<ItemStack, ICraftingPatternDetails> simpleCache = new WeakHashMap<ItemStack, ICraftingPatternDetails>();
static WeakHashMap<ItemStack, ItemStack> simpleCache = new WeakHashMap<ItemStack, ItemStack>();
public ItemStack getOutput(ItemStack item)
{
ICraftingPatternDetails details = simpleCache.get( item );
if ( details != null )
return details.getCondencedOutputs()[0].getItemStack();
ItemStack out = simpleCache.get( item );
if ( out != null )
return out;
World w = CommonHelper.proxy.getWorld();
if ( w == null )
return null;
details = getPatternForItem( item, w );
ICraftingPatternDetails details = getPatternForItem( item, w );
if ( details == null )
return null;
simpleCache.put( item, details );
return details.getCondencedOutputs()[0].getItemStack();
simpleCache.put( item, out = details.getCondencedOutputs()[0].getItemStack() );
return out;
}
@Override