RuneHive-Game
Loading...
Searching...
No Matches
SendEnterText.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.codec.ByteOrder;
6import com.runehive.net.packet.OutgoingPacket;
7import com.runehive.net.packet.PacketType;
8
9/**
10 * Sends an enter text prompt to the player.
11 * Allows typing text without space closing the interface.
12 *
13 * @author AI Port from Elvarg
14 */
15public class SendEnterText extends OutgoingPacket {
16
17 private final String prompt;
18
19 public SendEnterText(String prompt) {
20 super(187, PacketType.VAR_BYTE);
21 this.prompt = prompt;
22 }
23
24 @Override
25 public boolean encode(Player player) {
26 builder.writeString(prompt);
27 return true;
28 }
29}
This class represents a character controlled by a player.
Definition Player.java:125
OutgoingPacket(int opcode, int capacity)
Represents a type of packet.
VAR_BYTE
A variable packet where the size is indicated by a byte.