2011-04-25 18:14:06 +02:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
import java.io.DataInputStream;
|
|
|
|
import java.io.DataOutputStream;
|
2011-06-27 00:25:01 +02:00
|
|
|
|
2011-05-14 16:29:42 +02:00
|
|
|
import java.io.IOException; // CraftBukkit
|
2011-04-25 18:14:06 +02:00
|
|
|
|
|
|
|
public class Packet3Chat extends Packet {
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public static int a = 119;
|
2011-06-27 00:25:01 +02:00
|
|
|
public String message;
|
2012-07-29 09:33:13 +02:00
|
|
|
private boolean c;
|
2011-04-25 18:14:06 +02:00
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public Packet3Chat() {
|
|
|
|
this.c = true;
|
|
|
|
}
|
2011-04-25 18:14:06 +02:00
|
|
|
|
|
|
|
public Packet3Chat(String s) {
|
2012-07-29 09:33:13 +02:00
|
|
|
this(s, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Packet3Chat(String s, boolean flag) {
|
|
|
|
this.c = true;
|
|
|
|
|
2011-05-14 16:29:42 +02:00
|
|
|
/* CraftBukkit start - handle this later
|
2012-03-30 23:33:51 +02:00
|
|
|
if (s.length() > b) {
|
|
|
|
s = s.substring(0, b);
|
2011-05-14 16:29:42 +02:00
|
|
|
}
|
|
|
|
// CraftBukkit end */
|
2011-04-25 18:14:06 +02:00
|
|
|
|
2011-06-27 00:25:01 +02:00
|
|
|
this.message = s;
|
2012-07-29 09:33:13 +02:00
|
|
|
this.c = flag;
|
2011-04-25 18:14:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void a(DataInputStream datainputstream) throws IOException { // CraftBukkit
|
2012-07-29 09:33:13 +02:00
|
|
|
this.message = a(datainputstream, a);
|
2011-04-25 18:14:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void a(DataOutputStream dataoutputstream) throws IOException { // CraftBukkit
|
2011-06-27 00:25:01 +02:00
|
|
|
a(this.message, dataoutputstream);
|
2011-04-25 18:14:06 +02:00
|
|
|
}
|
|
|
|
|
2012-01-14 21:03:48 +01:00
|
|
|
public void handle(NetHandler nethandler) {
|
2011-04-25 18:14:06 +02:00
|
|
|
nethandler.a(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
public int a() {
|
2012-01-12 23:10:13 +01:00
|
|
|
return 2 + this.message.length() * 2;
|
2011-04-25 18:14:06 +02:00
|
|
|
}
|
2012-07-29 09:33:13 +02:00
|
|
|
|
|
|
|
public boolean isServer() {
|
|
|
|
return this.c;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean a_() {
|
|
|
|
return !this.message.startsWith("/");
|
|
|
|
}
|
2011-04-25 18:14:06 +02:00
|
|
|
}
|