RuneHive-Game
Loading...
Searching...
No Matches
SendWidget.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.packet.OutgoingPacket;
5
6public class SendWidget extends OutgoingPacket {
7
8 private final WidgetType type;
9 private final int seconds;
10
12 super(178, 3);
13 this.type = type;
14 this.seconds = seconds;
15 }
16
17 @Override
18 public boolean encode(Player player) {
19 builder.writeByte(type.icon)
20 .writeShort(seconds * 50);
21 return true;
22 }
23
24 public enum WidgetType {
30 CLAN(6),
31 STUN(7),
33
34 private final int icon;
36 this.icon = icon;
37 }
38 }
39
40}
This class represents a character controlled by a player.
Definition Player.java:125
OutgoingPacket(int opcode, int capacity)
SendWidget(WidgetType type, int seconds)