Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void encodePlayerEquipment(GamePacketBuilder builder, int[] equipment, int[] playerLook,
- boolean isFullBody, boolean isFullMask, boolean isFullHelm) {
- if (equipment[PlayerConstants.HELM] > 1) {
- builder.putShort(0x200 + equipment[PlayerConstants.HELM]);
- } else {
- builder.put((byte) 0);
- }
- if (equipment[PlayerConstants.CAPE] > 1) {
- builder.putShort(0x200 + equipment[PlayerConstants.CAPE]);
- } else {
- builder.put((byte) 0);
- }
- if (equipment[PlayerConstants.AMULET] > 1) {
- builder.putShort(0x200 + equipment[PlayerConstants.AMULET]);
- } else {
- builder.put((byte) 0);
- }
- if (equipment[PlayerConstants.WEAPON] > 1) {
- builder.putShort(0x200 + equipment[PlayerConstants.WEAPON]);
- } else {
- builder.put((byte) 0);
- }
- if (equipment[PlayerConstants.CHEST] > 1) {
- builder.putShort(0x200 + equipment[PlayerConstants.CHEST]);
- } else {
- builder.putShort(0x100 + playerLook[PlayerConstants.BODY] + (28000));
- }
- if (equipment[PlayerConstants.SHIELD] > 1) {
- builder.putShort(0x200 + equipment[PlayerConstants.SHIELD]);
- } else {
- builder.put((byte) 0);
- }
- if (!isFullBody) {
- builder.putShort(0x100 + playerLook[PlayerConstants.ARMS] + (28000));
- } else {
- builder.put((byte) 0);
- }
- if (equipment[PlayerConstants.BOTTOMS] > 1) {
- builder.putShort(0x200 + equipment[PlayerConstants.BOTTOMS]);
- } else {
- builder.putShort(0x100 + playerLook[PlayerConstants.LEGS] + (28000));
- }
- if (!isFullHelm && !isFullMask) {
- builder.putShort(0x100 + playerLook[PlayerConstants.HEAD] + (28000));
- } else {
- builder.put((byte) 0);
- }
- if (equipment[PlayerConstants.GLOVES] > 1) {
- builder.putShort(0x200 + equipment[PlayerConstants.GLOVES]);
- } else {
- builder.putShort(0x100 + playerLook[PlayerConstants.HANDS] + (28000));
- }
- if (equipment[PlayerConstants.BOOTS] > 1) {
- builder.putShort(0x200 + equipment[PlayerConstants.BOOTS]);
- } else {
- builder.putShort(0x100 + playerLook[PlayerConstants.FEET] + (28000));
- }
- if (!isFullMask && (playerLook[PlayerConstants.SEX] != 1)) {
- builder.putShort(0x100 + playerLook[PlayerConstants.BEARD] + (28000));
- } else {
- builder.put((byte) 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement