use of org.dragonet.utilities.io.PEBinaryReader in project Dragonet-Legacy by DragonetMC.
the class CraftingEventPacket method decode.
@Override
public void decode() {
try {
PEBinaryReader reader = new PEBinaryReader(new ByteArrayInputStream(this.getData()));
reader.readByte();
this.windowId = reader.readByte();
this.craftType = reader.readInt();
this.uuid = reader.readUUID();
int size = reader.readInt();
input = new PEInventorySlot[size > 128 ? 128 : size];
for (int i = 0; i < size; i++) {
input[i] = PEInventorySlot.readSlot(reader);
}
size = reader.readInt();
output = new PEInventorySlot[size > 128 ? 128 : size];
for (int i = 0; i < size; i++) {
output[i] = PEInventorySlot.readSlot(reader);
}
this.setLength(reader.totallyRead());
} catch (IOException e) {
}
}
use of org.dragonet.utilities.io.PEBinaryReader in project Dragonet-Legacy by DragonetMC.
the class InteractPacket method decode.
@Override
public void decode() {
try {
PEBinaryReader reader = new PEBinaryReader(new ByteArrayInputStream(this.getData()));
reader.readByte();
this.action = reader.readByte();
this.target = reader.readLong();
this.setLength(reader.totallyRead());
} catch (IOException e) {
}
}
Aggregations