Skip to content

Instantly share code, notes, and snippets.

@Techdaan
Created January 15, 2019 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Techdaan/23d125f24c1669a9eaca092b05fdcb77 to your computer and use it in GitHub Desktop.
Save Techdaan/23d125f24c1669a9eaca092b05fdcb77 to your computer and use it in GitHub Desktop.
WorldAreaType
@Override
public void decode(ByteBuf buffer) {
for (int opcode = buffer.readUnsignedByte(); opcode != 0; opcode = buffer.readUnsignedByte()) {
if (opcode == 2) { // No clue
op1 = buffer.readMedium();
} else if (opcode == 3) { // Seem to be regions
CoordGrid first = new CoordGrid(buffer.readInt());
CoordGrid second = new CoordGrid(buffer.readInt());
} else if (opcode == 4) { // Seem to be chunks
CoordGrid first = new CoordGrid(buffer.readInt());
CoordGrid second = new CoordGrid(buffer.readInt());
} else {
throw new IllegalArgumentException("Unknown WorldAreaType opcode '" + opcode + "'");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment