Sends a {@link Packet} to player to update the picked {@link ItemStack}.

@param itemStack the item stack
@param player the player
@param windowId the window id
12386
public static void updatePickedItemStack(ItemStack itemStack, EntityPlayerMP player, int windowId)
	{
		Packet packet = new Packet(PICKEDITEM, windowId);
		packet.draggedItemStack(itemStack);
		MalisisCore.network.sendTo(packet, player);
	}
1043017
public static void sendBlockData(Chunk chunk, String identifer, ByteBuf data)
	{
		MalisisCore.network.sendToPlayersWatchingChunk(new Packet(chunk, identifer, data), chunk);
	}
1162059
private void setSelectedNavDrawerItem(int itemId) {
        for(DrawerItem item: mDrawerItems){
            formatNavDrawerItem(item, itemId == item.getId());
        }
    }
850697
public static void removeIngredientsFromPlayer(EntityPlayerMP player, List<ItemStack> ingredients)
    {
        NonNullList<ItemStack> main = player.inventory.mainInventory;
        NonNullList<ItemStack> arm = player.inventory.armorInventory;

        for (ItemStack isIngredient : ingredients)
        {
            int target = isIngredient.getCount();
            for (int i = 0; i < main.size() + arm.size() && target > 0; i++)
            {
                ItemStack isPlayer = (i >= main.size()) ? arm.get(i - main.size()) : main.get(i);
                if (isPlayer != null && isIngredient != null && itemStackIngredientsMatch(isPlayer, isIngredient))
                {
                    if (target >= isPlayer.getCount())
                    {
                        // Consume this stack:
                        target -= isPlayer.getCount();
                        if (i >= main.size())
                            arm.get(i - main.size()).setCount(0);
                        else
                            main.get(i).setCount(0);
                    }
                    else
                    {
                        isPlayer.setCount(isPlayer.getCount() - target);
                        target = 0;
                    }
                }
            }
            ItemStack resultForReward = isIngredient.copy();
            RewardForDiscardingItemImplementation.LoseItemEvent event = new RewardForDiscardingItemImplementation.LoseItemEvent(resultForReward);
            MinecraftForge.EVENT_BUS.post(event);
        }
    }
720895
public static void send(EntityPlayerMP player)
	{
		Packet packet = new Packet();
		MalisisCore.network.sendTo(packet, player);
	}
1051313
public void sendAck(Request arg0) throws SipException {
		if (tracer.isInfoEnabled()) {
			tracer.info(this+" sending ACK:\n"+arg0);
		}
		wrappedDialog.sendAck(arg0);
	}
195535
private void deliverTrackMetadataUpdate(int player, TrackMetadata metadata) {
        if (!getTrackMetadataListeners().isEmpty()) {
            final TrackMetadataUpdate update = new TrackMetadataUpdate(player, metadata);
            for (final TrackMetadataListener listener : getTrackMetadataListeners()) {
                try {
                    listener.metadataChanged(update);

                } catch (Throwable t) {
                    logger.warn("Problem delivering track metadata update to listener", t);
                }
            }
        }
    }
1298389
public void send(String nodeID, byte[] packet) {
		if (nodeID == null) {
			logger.warn("Unable to send (missing nodeID)!");
			return;
		}
		if (packet == null || packet.length < 6) {
			logger.warn("Cannot send empty packet to node " + nodeID + "!");
			return;
		}
		SendBuffer buffer = null;
		try {

			// Get or create buffer
			boolean newBuffer = false;
			synchronized (buffers) {
				buffer = buffers.get(nodeID);
				if (buffer == null) {

					// Create new connection
					RemoteAddress address = transporter.getAddress(nodeID);
					if (address == null) {
						logger.warn("Unknown node ID (" + nodeID + ")!");
						return;
					}
					buffer = new SendBuffer(nodeID, address.host, address.port, debug);
					append(nodeID, buffer, packet);
					buffers.put(nodeID, buffer);
					newBuffer = true;
				} else {

					// Try to append to buffer
					if (!buffer.append(packet)) {

						// Buffer is closed
						RemoteAddress address = transporter.getAddress(nodeID);
						buffer = new SendBuffer(nodeID, address.host, address.port, debug);
						append(nodeID, buffer, packet);
						buffers.put(nodeID, buffer);
						newBuffer = true;
					}
				}
			}
			if (newBuffer) {

				// Close older connections
				if (maxConnections > 0) {
					cleanup();
				}

				// Add to opened buffers
				opened.add(buffer);

			} else if (buffer.key != null) {

				// Mark as writable
				buffer.key.interestOps(SelectionKey.OP_WRITE);
			}

			// Wake up selector
			if (selector != null) {
				selector.wakeup();
			}

		} catch (Throwable cause) {
			synchronized (buffers) {
				buffers.remove(nodeID);
			}
			LinkedList<byte[]> packets;
			if (buffer != null) {
				packets = buffer.getUnsentPackets();
			} else {
				packets = new LinkedList<>();
			}
			if (packets.isEmpty() && packet != null) {
				packets.addLast(packet);
			}
			transporter.unableToSend(nodeID, packets, cause);
		}
	}
32890
public TableWriteItems withItemsToPut(Item ... itemsToPut) {
        if (itemsToPut == null)
            this.itemsToPut = null;
        else
            this.itemsToPut = new ArrayList<Item>(Arrays.asList(itemsToPut));
        return this;
    }
303324
private ItemStack handleDropSlot(MalisisSlot hoveredSlot, boolean fullStack)
	{
		ItemStack itemStack = hoveredSlot.getItemStack();
		if (itemStack.isEmpty() || !hoveredSlot.isState(PLAYER_EXTRACT))
			return itemStack;

		ItemUtils.ItemStackSplitter iss = new ItemUtils.ItemStackSplitter(hoveredSlot.getItemStack());
		iss.split(fullStack ? ItemUtils.FULL_STACK : 1);

		hoveredSlot.setItemStack(iss.source);
		//if (slot.hasChanged())
		hoveredSlot.onSlotChanged();
		owner.dropItem(iss.split, true);

		if (iss.amount != 0)
			hoveredSlot.onPickupFromSlot(owner, iss.split);

		return iss.split;
	}
1118573
public void put(T item, String itemId) throws Exception
    {
        put(item, itemId, 0, null);
    }
437006
private void sendSeekStatus(IPlayItem item, int position) {
        Status seek = new Status(StatusCodes.NS_SEEK_NOTIFY);
        seek.setClientid(streamId);
        seek.setDetails(item.getName());
        seek.setDesciption(String.format("Seeking %d (stream ID: %d).", position, streamId));

        doPushMessage(seek);
    }
1350173
public void sendAckData(List<Object> objs) {
        if (!isAckRequested() || !sended.compareAndSet(false, true)) {
            return;
        }
        Packet ackPacket = new Packet(PacketType.MESSAGE);
        ackPacket.setSubType(PacketType.ACK);
        ackPacket.setAckId(originalPacket.getAckId());
        ackPacket.setData(objs);
        client.send(ackPacket);
    }
417192
public void send(byte[] data, int id) {
        boolean isFirstPacket = (packets.size() == 0);
        packets.add(data);
        ids.add(id);
        if (isFirstPacket) {
            scheduleSendTask(true);
        }
        Log.d(TAG, "Added packet " + id + " to buffer; " + packets.size() + " packets in buffer");
    }
339725
public void sendRequestPacket(String nodeID, Context ctx) {
		FastBuildTree msg = new FastBuildTree(11);

		// Add basic properties (version, sender's nodeID, etc.)
		msg.putUnsafe("ver", PROTOCOL_VERSION);
		msg.putUnsafe("sender", this.nodeID);
		msg.putUnsafe("id", ctx.id);
		msg.putUnsafe("action", ctx.name);

		// Add params and meta
		if (ctx.params != null) {
			msg.putUnsafe("params", ctx.params.asObject());
			Tree meta = ctx.params.getMeta(false);
			if (meta != null && !meta.isEmpty()) {
				msg.putUnsafe("meta", meta.asObject());
			}
		}

		// Timeout
		if (ctx.opts != null && ctx.opts.timeout > 0) {
			msg.putUnsafe("timeout", ctx.opts.timeout);
		}

		// Call level
		msg.putUnsafe("level", ctx.level);

		// Parent ID
		if (ctx.parentID != null) {
			msg.putUnsafe("parentID", ctx.parentID);
		}

		// Request ID
		msg.putUnsafe("requestID", ctx.requestID);

		// Stream packet counter (default is "0" = packet isn't streamed)
		if (ctx.stream != null) {

			// Streaming in progress
			msg.putUnsafe("stream", true);

			// First sequence
			msg.putUnsafe("seq", 0);
		}

		// Send message
		publish(Transporter.PACKET_REQUEST, nodeID, msg);
	}
913160
protected void updateApp(String itemId) {

        I_CmsOuTreeType foundType = null;
        for (I_CmsOuTreeType type : m_app.getTreeTypeProvider().getTreeTypes()) {
            if (itemId.equals(type.getId())) {
                foundType = type;
                break;
            }
        }
        if (foundType != null) {
            m_app.update(m_parentOu, foundType, null);
            return;
        }
        m_app.update(itemId, CmsOuTreeType.OU, null, "");
    }
221074
public void send(Packet packet) {
        if (log.isTraceEnabled()) {
            log.trace("send packet: {}", packet);
        }
        // no handshake flag, queue the packet
        if (session.containsAttribute(Constants.HANDSHAKE_COMPLETE)) {
            try {
                // clear any queued items first
                queue.forEach(entry -> {
                    session.write(entry);
                    queue.remove(entry);
                });
            } catch (Exception e) {
                log.warn("Exception draining queued packets on session: {}", session.getId(), e);
            }
            // process the incoming packet
            session.write(packet);
        } else {
            if (handshakeWriteFuture != null) {
                log.warn("Handshake is not complete yet on session: {} written? {}", session.getId(), handshakeWriteFuture.isWritten(), handshakeWriteFuture.getException());
            } else {
                log.warn("Handshake is not complete yet on session: {}", session.getId());
            }
            // not queuing pings
            MessageType type = packet.getType();
            if (type != MessageType.PING && type != MessageType.PONG) {
                log.info("Placing {} message in session: {} queue", type, session.getId());
                queue.offer(packet);
            }
        }
    }