private void handlePossibleSlotChanges( int slot, IAEItemStack oldAeIS, ItemStack newIS, List<IAEItemStack> changes ) { if( oldAeIS != null && oldAeIS.isSameType( newIS ) ) { this.handleStackSizeChanged( slot, oldAeIS, newIS, changes ); } else { this.handleItemChanged( slot, oldAeIS, newIS, changes ); } }
@Override public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final IActionSource src ) { AEItemStack ret = null; ItemStack slotItem = this.target.getOutputSlot().getStackInSlot( 0 ); if( !slotItem.isEmpty() && request.isSameType( slotItem ) ) { int count = (int) Math.min( request.getStackSize(), Integer.MAX_VALUE ); ret = AEItemStack.fromItemStack( this.target.getOutputSlot().extractItem( 0, count, mode == Actionable.SIMULATE ) ); } return ret; }
public void setTargetStack( final IAEItemStack stack ) { // client doesn't need to re-send, makes for lower overhead rapid packets. if( Platform.isClient() ) { if( stack == null && this.clientRequestedTargetItem == null ) { return; } if( stack != null && stack.isSameType( this.clientRequestedTargetItem ) ) { return; } NetworkHandler.instance().sendToServer( new PacketTargetItemStack( (AEItemStack) stack ) ); } this.clientRequestedTargetItem = stack == null ? null : stack.copy(); }
return; else if( req.isSameType( stored ) ) // same type ( qty different? )!
@Override public void setTargetStack(final IAEItemStack stack) { // client doesn't need to re-send, makes for lower overhead rapid packets. if (Platform.isClient()) { if (stack == null && clientRequestedTargetItem == null) { return; } if (stack != null && stack.isSameType(clientRequestedTargetItem)) { return; } ModNetworking.instance().sendToServer(new PacketTargetItemStack((AEItemStack) stack)); } clientRequestedTargetItem = stack == null ? null : stack.copy(); }