use of org.dragonet.utilities.io.PEBinaryWriter in project Dragonet-Legacy by DragonetMC.
the class WindowSetSlotPacket method encode.
@Override
public void encode() {
try {
setChannel(NetworkChannel.CHANNEL_PRIORITY);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PEBinaryWriter writer = new PEBinaryWriter(bos);
writer.writeByte((byte) (this.pid() & 0xFF));
writer.writeByte(this.windowID);
writer.writeShort(this.slot);
writer.writeShort(this.hotbarSlot);
;
PEInventorySlot.writeSlot(writer, this.item);
this.setData(bos.toByteArray());
} catch (IOException e) {
}
}
use of org.dragonet.utilities.io.PEBinaryWriter in project Dragonet-Legacy by DragonetMC.
the class RemoveEntityPacket method encode.
@Override
public void encode() {
try {
setChannel(NetworkChannel.CHANNEL_ENTITY_SPAWNING);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PEBinaryWriter writer = new PEBinaryWriter(bos);
writer.writeByte((byte) (this.pid() & 0xFF));
writer.writeLong(this.eid);
this.setData(bos.toByteArray());
} catch (IOException e) {
}
}
use of org.dragonet.utilities.io.PEBinaryWriter in project Dragonet-Legacy by DragonetMC.
the class RemovePlayerPacket method encode.
@Override
public void encode() {
try {
setChannel(NetworkChannel.CHANNEL_ENTITY_SPAWNING);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PEBinaryWriter writer = new PEBinaryWriter(bos);
writer.writeByte((byte) (this.pid() & 0xFF));
writer.writeLong(this.eid);
writer.writeUUID(this.uuid);
this.setData(bos.toByteArray());
} catch (IOException e) {
}
}
use of org.dragonet.utilities.io.PEBinaryWriter in project Dragonet-Legacy by DragonetMC.
the class RespawnPacket method encode.
@Override
public void encode() {
try {
setChannel(NetworkChannel.CHANNEL_MOVEMENT);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PEBinaryWriter writer = new PEBinaryWriter(bos);
writer.writeByte((byte) (this.pid() & 0xFF));
writer.writeFloat(x);
writer.writeFloat(y + 1.62f);
writer.writeFloat(z);
this.setData(bos.toByteArray());
} catch (IOException e) {
}
}
use of org.dragonet.utilities.io.PEBinaryWriter in project Dragonet-Legacy by DragonetMC.
the class ServerHandshakePacket method encode.
@Override
public void encode() {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PEBinaryWriter writer = new PEBinaryWriter(bos);
writer.writeByte((byte) (this.pid() & 0xFF));
writer.writeAddress(addr, port);
writer.writeShort((short) 0);
writer.writeAddress(Inet4Address.getByName("127.0.0.1"), (short) 0);
writer.writeAddress(Inet4Address.getByName("0.0.0.0"), (short) 0);
writer.writeAddress(Inet4Address.getByName("0.0.0.0"), (short) 0);
writer.writeAddress(Inet4Address.getByName("0.0.0.0"), (short) 0);
writer.writeAddress(Inet4Address.getByName("0.0.0.0"), (short) 0);
writer.writeAddress(Inet4Address.getByName("0.0.0.0"), (short) 0);
writer.writeAddress(Inet4Address.getByName("0.0.0.0"), (short) 0);
writer.writeAddress(Inet4Address.getByName("0.0.0.0"), (short) 0);
writer.writeAddress(Inet4Address.getByName("0.0.0.0"), (short) 0);
writer.writeAddress(Inet4Address.getByName("0.0.0.0"), (short) 0);
writer.writeLong(this.session);
writer.writeLong(this.session2);
this.setData(bos.toByteArray());
} catch (IOException e) {
}
}
Aggregations