MCProtocolLib/example/com/github/steveice10/packetlib/test/PingPacket.java

33 lines
770 B
Java
Raw Normal View History

2017-03-01 19:09:48 -05:00
package com.github.steveice10.packetlib.test;
2013-11-29 17:34:06 -05:00
import com.github.steveice10.packetlib.codec.PacketCodecHelper;
2017-03-01 19:09:48 -05:00
import com.github.steveice10.packetlib.packet.Packet;
2013-11-29 17:34:06 -05:00
import java.io.IOException;
2013-11-29 17:34:06 -05:00
public class PingPacket implements Packet {
private final String id;
public PingPacket(ByteBuf buf, PacketCodecHelper codecHelper) throws IOException {
this.id = codecHelper.readString(buf);
}
public PingPacket(String id) {
this.id = id;
}
public String getPingId() {
return this.id;
}
@Override
public void write(ByteBuf buf, PacketCodecHelper codecHelper) throws IOException {
codecHelper.writeString(buf, this.id);
}
@Override
public boolean isPriority() {
return false;
}
2013-11-29 17:34:06 -05:00
}