RuneHive-Game
Loading...
Searching...
No Matches
SendInterfaceLayer.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.net.packet.OutgoingPacket;
4import com.runehive.game.world.entity.mob.player.Player;
5
6/**
7 * Shows an itemcontainer inside another itemcontainer.
8 *
9 * @author nshusa
10 */
11public class SendInterfaceLayer extends OutgoingPacket {
12
13 /** The id of the itemcontainer to show. */
14 private final int id;
15
16 /** The toggle to display the itemcontainer to the user. */
17 private final boolean hide;
18
19 /**
20 * Creates a new {@link SendInterfaceLayer).
21 *
22 * @param id The id of the itemcontainer.
23 * @param hide The toggle to display the itemcontainer.
24 */
25 public SendInterfaceLayer(int id, boolean hide) {
26 super(171, 3);
27 this.id = id;
28 this.hide = hide;
29 }
30
31 @Override
32 public boolean encode(Player player) {
33 builder.writeByte(hide ? 1 : 0)
34 .writeShort(id);
35 return true;
36 }
37}
This class represents a character controlled by a player.
Definition Player.java:125
OutgoingPacket(int opcode, int capacity)
final int id
The id of the itemcontainer to show.
SendInterfaceLayer(int id, boolean hide)
Creates a new SendInterfaceLayer).
final boolean hide
The toggle to display the itemcontainer to the user.