summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/Packet3Chat.java
blob: 7c0205b6feb3df655a9f5ae2a7bd3f818fed0d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package net.minecraft.server;

import java.io.DataInputStream;
import java.io.DataOutputStream;

import java.io.IOException; // CraftBukkit

public class Packet3Chat extends Packet {

    public static int a = 119;
    public String message;
    private boolean c;

    public Packet3Chat() {
        this.c = true;
    }

    public Packet3Chat(String s) {
        this(s, true);
    }

    public Packet3Chat(String s, boolean flag) {
        this.c = true;

        /* CraftBukkit start - handle this later
        if (s.length() > b) {
            s = s.substring(0, b);
        }
        // CraftBukkit end */

        this.message = s;
        this.c = flag;
    }

    public void a(DataInputStream datainputstream) throws IOException { // CraftBukkit
        this.message = a(datainputstream, a);
    }

    public void a(DataOutputStream dataoutputstream) throws IOException { // CraftBukkit
        a(this.message, dataoutputstream);
    }

    public void handle(NetHandler nethandler) {
        nethandler.a(this);
    }

    public int a() {
        return 2 + this.message.length() * 2;
    }

    public boolean isServer() {
        return this.c;
    }

    public boolean a_() {
        return !this.message.startsWith("/");
    }
}