RuneHive-Game
Loading...
Searching...
No Matches
SendAnnouncement.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.net.packet.OutgoingPacket;
4import com.runehive.net.packet.PacketType;
5import com.runehive.game.world.entity.mob.player.Player;
6
7public class SendAnnouncement extends OutgoingPacket {
8 private final String title;
9 private final String message;
10 private final int color;
11
12 public SendAnnouncement(Object title, Object message, int color) {
13 super(202, PacketType.VAR_BYTE);
14 this.title = String.valueOf(title);
15 this.message = String.valueOf(message);
16 this.color = color;
17 }
18
19 @Override
20 public boolean encode(Player player) {
21 builder.writeString(title)
22 .writeString(message)
23 .writeInt(color);
24 return true;
25 }
26}
This class represents a character controlled by a player.
Definition Player.java:125
OutgoingPacket(int opcode, int capacity)
SendAnnouncement(Object title, Object message, int color)
Represents a type of packet.
VAR_BYTE
A variable packet where the size is indicated by a byte.