33public class SendItemOnInterface
extends OutgoingPacket {
36 private final Item[] items;
37 private final int[] tabAmounts;
39 public SendItemOnInterface(
int id) {
40 this(id,
null,
new Item[]{});
43 public SendItemOnInterface(
int id, Item... items) {
44 this(id,
null, items);
47 public SendItemOnInterface(
int id,
int[] tabAmounts, Item... items) {
51 this.tabAmounts = tabAmounts;
55 public boolean encode(
Player player) {
56 final boolean sendTabs =
id == InterfaceConstants.WITHDRAW_BANK && tabAmounts !=
null;
58 .writeShort(items.length)
59 .writeShort(sendTabs ? tabAmounts.length : 0);
60 for (
final Item item : items) {
62 final int amount = item.getAmount();
64 builder.writeByte(255)
67 builder.writeByte(amount);
69 builder.writeShort(item.getId() + 1);
77 for (
final int amount : tabAmounts) {
78 builder.writeInt(amount);