added packets PlayerPosition & PlayerLook
This commit is contained in:
@@ -77,7 +77,9 @@ public enum State {
|
||||
.put(0x04, ClientSettingsPacket.class)
|
||||
.put(0x09, PluginMessagePacket.class)
|
||||
.put(0x0B, KeepAlivePacket.class)
|
||||
.put(0x0D, PlayerPositionPacket.class)
|
||||
.put(0x0E, PlayerPositionAndLookPacket.class)
|
||||
.put(0x0F, PlayerLookPacket.class)
|
||||
.put(0x1A, HeldItemChangePacket.class)
|
||||
.put(0x1D, AnimationPacket.class)
|
||||
.build(),
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package mc.core.network.proto_1_12_2.packets;
|
||||
|
||||
import lombok.Getter;
|
||||
import mc.core.network.CSPacket;
|
||||
import mc.core.network.NetInputStream;
|
||||
|
||||
@Getter
|
||||
public class PlayerLookPacket implements CSPacket {
|
||||
private float yaw, pitch;
|
||||
private boolean onGround; // True if the client is on the ground, false otherwise
|
||||
|
||||
@Override
|
||||
public void readSelf(NetInputStream netStream) {
|
||||
this.yaw = netStream.readFloat();
|
||||
this.pitch = netStream.readFloat();
|
||||
this.onGround = netStream.readBoolean();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package mc.core.network.proto_1_12_2.packets;
|
||||
|
||||
import lombok.Getter;
|
||||
import mc.core.network.CSPacket;
|
||||
import mc.core.network.NetInputStream;
|
||||
|
||||
@Getter
|
||||
public class PlayerPositionPacket implements CSPacket {
|
||||
private double x, y, z; // Y - is feet position. Normally Head Y - +1.62d
|
||||
private boolean onGround; // True if the client is on the ground, false otherwise
|
||||
|
||||
@Override
|
||||
public void readSelf(NetInputStream netStream) {
|
||||
this.x = netStream.readDouble();
|
||||
this.y = netStream.readDouble();
|
||||
this.z = netStream.readDouble();
|
||||
this.onGround = netStream.readBoolean();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user