use of org.dragonet.utilities.io.PEBinaryReader in project Dragonet-Legacy by DragonetMC.
the class ClientConnectPacket method decode.
@Override
public void decode() {
try {
PEBinaryReader reader = new PEBinaryReader(new ByteArrayInputStream(this.getData()));
//PID
reader.readByte();
this.clientID = reader.readLong();
this.sessionID = reader.readLong();
this.useSecurity = (reader.readByte() & 0xFF) > 0;
this.setLength(reader.totallyRead());
} catch (IOException e) {
}
}
use of org.dragonet.utilities.io.PEBinaryReader in project Dragonet-Legacy by DragonetMC.
the class MovePlayerPacket method decode.
@Override
public void decode() {
try {
PEBinaryReader reader = new PEBinaryReader(new ByteArrayInputStream(this.getData()));
//PID
reader.readByte();
this.eid = reader.readLong();
this.x = reader.readFloat();
this.y = reader.readFloat() - 1.62f;
this.z = reader.readFloat();
this.yaw = reader.readFloat();
this.bodyYaw = reader.readFloat();
this.pitch = reader.readFloat();
this.mode = reader.readByte();
this.teleport = reader.readByte() > 0;
this.setLength(reader.totallyRead());
} catch (IOException e) {
}
}
use of org.dragonet.utilities.io.PEBinaryReader in project Dragonet-Legacy by DragonetMC.
the class PingPongPacket method decode.
@Override
public void decode() {
try {
PEBinaryReader reader = new PEBinaryReader(new ByteArrayInputStream(this.getData()));
reader.readByte();
this.pingID = reader.readLong();
this.setLength(reader.totallyRead());
} catch (IOException e) {
}
}
use of org.dragonet.utilities.io.PEBinaryReader in project Dragonet-Legacy by DragonetMC.
the class PlayerActionPacket method decode.
@Override
public void decode() {
try {
PEBinaryReader reader = new PEBinaryReader(new ByteArrayInputStream(this.getData()));
//PID
reader.readByte();
eid = reader.readLong();
action = reader.readInt();
x = reader.readInt();
y = reader.readInt();
z = reader.readInt();
face = reader.readInt();
this.setLength(reader.totallyRead());
} catch (IOException e) {
}
}
use of org.dragonet.utilities.io.PEBinaryReader in project Dragonet-Legacy by DragonetMC.
the class UseItemPacket method decode.
@Override
public void decode() {
try {
PEBinaryReader reader = new PEBinaryReader(new ByteArrayInputStream(this.getData()));
//PID
reader.readByte();
this.x = reader.readInt();
this.y = reader.readInt();
this.z = reader.readInt();
this.face = reader.readByte() & 0xFF;
this.fx = reader.readFloat();
this.fy = reader.readFloat();
this.fz = reader.readFloat();
this.posX = reader.readFloat();
this.posY = reader.readFloat();
this.posZ = reader.readFloat();
this.item = PEInventorySlot.readSlot(reader);
} catch (IOException e) {
}
}
Aggregations