fix shift-clicking patterns from pattern slot sometimes voiding them

This commit is contained in:
Salomão
2021-06-05 18:54:26 -03:00
parent 50aac2c768
commit 52da4f9528
@@ -134,14 +134,16 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
{ {
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
if( this.inventorySlots.get( idx ) instanceof SlotPlayerInv || this.inventorySlots.get( idx ) instanceof SlotPlayerHotBar )
final AppEngSlot clickSlot = ( AppEngSlot ) this.inventorySlots.get( idx ); // require AE SLots!
ItemStack itemStack = clickSlot.getStack();
if( AEApi.instance().definitions().materials().blankPattern().isSameAs( itemStack ) )
{ {
IItemHandler patternInv = this.getPatternTerminal().getInventoryByName( "pattern" ); final AppEngSlot clickSlot = ( AppEngSlot ) this.inventorySlots.get( idx ); // require AE SLots!
ItemStack remainder = patternInv.insertItem( 0, itemStack, false ); ItemStack itemStack = clickSlot.getStack();
clickSlot.putStack( remainder ); if( AEApi.instance().definitions().materials().blankPattern().isSameAs( itemStack ) )
{
IItemHandler patternInv = this.getPatternTerminal().getInventoryByName( "pattern" );
ItemStack remainder = patternInv.insertItem( 0, itemStack, false );
clickSlot.putStack( remainder );
}
} }
return super.transferStackInSlot( p, idx ); return super.transferStackInSlot( p, idx );
} }