public void sendTradeAccept() {
Player with = player.getWishToTrade();
if (with == null) { // This shouldn't happen
return;
}
RSCPacketBuilder s = new RSCPacketBuilder();
s.setID(251);
s.addLong(with.getUsernameHash());
s.addByte((byte) with.getTradeOffer().size());
for (InvItem item : with.getTradeOffer()) {
s.addShort(item.id);
s.addInt(item.amount);
}
s.addByte((byte) player.getTradeOffer().size());
for (InvItem item : player.getTradeOffer()) {
s.addShort(item.id);
s.addInt(item.amount);
}
packets.add(s.toPacket());
}