RuneHive-Game
Loading...
Searching...
No Matches
SendTooltip.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.net.codec.ByteModification;
5import com.runehive.net.packet.OutgoingPacket;
6import com.runehive.net.packet.PacketType;
7
8public class SendTooltip extends OutgoingPacket {
9
10 private final String string;
11 private final int id;
12
13 public SendTooltip(int id, String string) {
14 super(203, PacketType.VAR_SHORT);
15 this.string = string;
16 this.id = id;
17 }
18
19
20 public SendTooltip(String string, int id) {
21 this(id, string);
22 }
23
24 @Override
25 public boolean encode(Player player) {
26 builder.writeString(string)
27 .writeShort(id, ByteModification.ADD);
28 return true;
29 }
30
31}
This class represents a character controlled by a player.
Definition Player.java:125
OutgoingPacket(int opcode, int capacity)
Represents RuneScape's custom value types.
ADD
Adds 128 to the value when written, subtracts 128 from the rarity when read.
Represents a type of packet.
VAR_SHORT
A variable packet where the size is indicated by a short.