Keep Alive
This commit is contained in:
@@ -49,12 +49,14 @@ public enum State {
|
||||
.put(0x02, ChatMessagePacket.class)
|
||||
.put(0x04, ClientSettingsPacket.class)
|
||||
.put(0x09, PluginMessagePacket.class)
|
||||
.put(0x0B, KeepAlivePacket.class)
|
||||
.put(0x0E, PlayerPositionAndLookPacket.class)
|
||||
.put(0x1A, HeldItemChangePacket.class)
|
||||
.put(0x1D, AnimationPacket.class)
|
||||
.build(),
|
||||
ImmutableBiMap.<Class<? extends SCPacket>, Integer>builder()
|
||||
.put(PluginMessagePacket.class, 0x18)
|
||||
.put(KeepAlivePacket.class, 0x1F)
|
||||
.put(JoinGamePacket.class, 0x23)
|
||||
.put(SpawnPositionPacket.class, 0x46)
|
||||
.put(PlayerAbilitiesPacket.class, 0x2C)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* DmitriyMX <dimon550@gmail.com>
|
||||
* 2018-06-23
|
||||
*/
|
||||
package mc.core.network.proto_1_12_2.packets;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import mc.core.network.CSPacket;
|
||||
import mc.core.network.NetStream;
|
||||
import mc.core.network.SCPacket;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@ToString
|
||||
public class KeepAlivePacket implements CSPacket, SCPacket {
|
||||
private long payload;
|
||||
|
||||
@Override
|
||||
public void readSelf(NetStream netStream) {
|
||||
this.payload = netStream.readLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSelf(NetStream netStream) {
|
||||
netStream.writeLong(this.payload);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user