package rt4;

import org.openrs2.deob.annotation.OriginalArg;
import org.openrs2.deob.annotation.OriginalClass;
import org.openrs2.deob.annotation.OriginalMember;
import org.openrs2.deob.annotation.Pc;

@OriginalClass("client!h")
public final class ObjType {

	@OriginalMember(owner = "client!h", name = "a", descriptor = "[S")
	private short[] retex_d;

	@OriginalMember(owner = "client!h", name = "g", descriptor = "I")
	private int model;

	@OriginalMember(owner = "client!h", name = "y", descriptor = "[S")
	private short[] retex_s;

	@OriginalMember(owner = "client!h", name = "z", descriptor = "[I")
	public int[] countco;

	@OriginalMember(owner = "client!h", name = "G", descriptor = "[S")
	private short[] recol_d;

	@OriginalMember(owner = "client!h", name = "I", descriptor = "[S")
	private short[] recol_s;

	@OriginalMember(owner = "client!h", name = "W", descriptor = "[B")
	private byte[] recol_p;

	@OriginalMember(owner = "client!h", name = "Y", descriptor = "I")
	public int id;

	@OriginalMember(owner = "client!h", name = "nb", descriptor = "Lclient!sc;")
	public HashTable params;

	@OriginalMember(owner = "client!h", name = "tb", descriptor = "[I")
	public int[] countobj;

	@OriginalMember(owner = "client!h", name = "h", descriptor = "I")
	public int cursor2 = -1;

	@OriginalMember(owner = "client!h", name = "K", descriptor = "I")
	private int womanwear3 = -1;

	@OriginalMember(owner = "client!h", name = "l", descriptor = "I")
	public int cost = 1;

	@OriginalMember(owner = "client!h", name = "e", descriptor = "I")
	private int womanhead2 = -1;

	@OriginalMember(owner = "client!h", name = "q", descriptor = "I")
	private int manWearXOff = 0;

	@OriginalMember(owner = "client!h", name = "H", descriptor = "I")
	private int womanhead = -1;

	@OriginalMember(owner = "client!h", name = "T", descriptor = "I")
	public int team = 0;

	@OriginalMember(owner = "client!gd", name = "b", descriptor = "Lclient!na;")
	public static final JagString aClass100_464 = JagString.parse("null");
	@OriginalMember(owner = "client!h", name = "E", descriptor = "Lclient!na;")
	public JagString name = aClass100_464;

	@OriginalMember(owner = "client!h", name = "J", descriptor = "I")
	private int manWearZOff = 0;

	@OriginalMember(owner = "client!h", name = "V", descriptor = "I")
	private int ambient = 0;

	@OriginalMember(owner = "client!h", name = "C", descriptor = "I")
	private int manwear3 = -1;

	@OriginalMember(owner = "client!h", name = "ib", descriptor = "I")
	private int manhead2 = -1;

	@OriginalMember(owner = "client!h", name = "cb", descriptor = "I")
	public int certtemplate = -1;

	@OriginalMember(owner = "client!h", name = "M", descriptor = "I")
	private int womanWearXOff = 0;

	@OriginalMember(owner = "client!h", name = "R", descriptor = "I")
	private int resizeY = 128;

	@OriginalMember(owner = "client!h", name = "A", descriptor = "I")
	public int cursor1Op = -1;

	@OriginalMember(owner = "client!h", name = "n", descriptor = "I")
	public int cursor1 = -1;

	@OriginalMember(owner = "client!h", name = "B", descriptor = "I")
	public int zAngle2D = 0;

	@OriginalMember(owner = "client!h", name = "u", descriptor = "I")
	public int lentTemplate = -1;

	@OriginalMember(owner = "client!h", name = "hb", descriptor = "I")
	public int lentLink = -1;

	@OriginalMember(owner = "client!h", name = "r", descriptor = "I")
	public int womanwear = -1;

	@OriginalMember(owner = "client!h", name = "F", descriptor = "I")
	private int manwear2 = -1;

	@OriginalMember(owner = "client!h", name = "f", descriptor = "I")
	public int yOffset2D = 0;

	@OriginalMember(owner = "client!h", name = "X", descriptor = "I")
	public int xAngle2D = 0;

	@OriginalMember(owner = "client!h", name = "ob", descriptor = "I")
	public int yAngle2D = 0;

	@OriginalMember(owner = "client!h", name = "pb", descriptor = "I")
	public int dummyItem = 0;

	@OriginalMember(owner = "client!h", name = "w", descriptor = "I")
	public int stackable = 0;

	@OriginalMember(owner = "client!h", name = "ab", descriptor = "I")
	public int certlink = -1;

	@OriginalMember(owner = "client!h", name = "fb", descriptor = "I")
	private int womanwear2 = -1;

	@OriginalMember(owner = "client!h", name = "Z", descriptor = "I")
	public int cursor2Op = -1;

	@OriginalMember(owner = "client!h", name = "mb", descriptor = "I")
	private int resizeZ = 128;

	@OriginalMember(owner = "client!h", name = "P", descriptor = "Z")
	public boolean members = false;

	@OriginalMember(owner = "client!h", name = "b", descriptor = "I")
	private int womanWearZOff = 0;

	@OriginalMember(owner = "client!h", name = "db", descriptor = "I")
	public int xOffset2D = 0;

	@OriginalMember(owner = "client!h", name = "sb", descriptor = "I")
	private int manhead = -1;

	@OriginalMember(owner = "client!h", name = "rb", descriptor = "I")
	private int womanWearYOff = 0;

	@OriginalMember(owner = "client!h", name = "eb", descriptor = "I")
	public int manwear = -1;

	@OriginalMember(owner = "client!h", name = "qb", descriptor = "[Lclient!na;")
	public JagString[] ops = new JagString[]{null, null, LocalizedText.TAKE, null, null};

	@OriginalMember(owner = "client!h", name = "ub", descriptor = "I")
	private int resizeX = 128;

	@OriginalMember(owner = "client!h", name = "bb", descriptor = "I")
	private int contrast = 0;

	@OriginalMember(owner = "client!h", name = "N", descriptor = "I")
	private int manWearYOff = 0;

	@OriginalMember(owner = "client!h", name = "U", descriptor = "[Lclient!na;")
	public JagString[] iops = new JagString[]{null, null, null, null, LocalizedText.DROP};

	@OriginalMember(owner = "client!h", name = "Ab", descriptor = "I")
	public int zoom2d = 2000;

	@OriginalMember(owner = "client!h", name = "xb", descriptor = "Z")
	public boolean stockMarket = false;

	/*
	 * This method gets the stackable obj models dependent on the defined amount "trigger" values.
	 * An example of this would be coins/arrows.
	 */
	@OriginalMember(owner = "client!h", name = "a", descriptor = "(II)Lclient!h;")
	public final ObjType method1820(@OriginalArg(0) int count) {
		if (this.countobj != null && count > 1) {
			@Pc(23) int countId = -1;
			for (@Pc(25) int i = 0; i < 10; i++) {
				if (this.countco[i] <= count && this.countco[i] != 0) {
					countId = this.countobj[i];
				}
			}
			if (countId != -1) {
				return ObjTypeList.get(countId);
			}
		}
		return this;
	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(ILclient!wa;)V")
	public final void decode(@OriginalArg(1) Buffer buffer) {
		while (true) {
			@Pc(5) int opcode = buffer.g1();
			if (opcode == 0) {
				return;
			}
			this.decode(buffer, opcode);
		}
	}

	@OriginalMember(owner = "client!h", name = "c", descriptor = "(I)V")
	public final void postDecode() {
	}

	public static class Opcodes {

		public static final int model = 1;
		public static final int name = 2;
		public static final int zoom2d = 4;
		public static final int xan2d = 5;
		public static final int yan2d = 6;
		public static final int xof2d = 7;
		public static final int yof2d = 8;
		public static final int stackable_yes = 11;
		public static final int cost = 12;
		public static final int members = 16;
		public static final int manwear = 23;
		public static final int manwear2 = 24;
		public static final int womanwear = 25;
		public static final int womanwear2 = 26;
		public static final int op1 = 30;
		public static final int op5 = 34;
		public static final int iop1 = 35;
		public static final int iop5 = 39;
		public static final int recol = 40;
		public static final int retex = 41;
		public static final int stockmarket_yes = 65;
		public static final int manwear3 = 78;
		public static final int womanwear3 = 79;
		public static final int manhead = 90;
		public static final int womanhead = 91;
		public static final int manhead2 = 92;
		public static final int womanhead2 = 93;
		public static final int zan2d = 95;
		public static final int certlink = 97;
		public static final int certtemplate = 98;
		public static final int countobj1 = 100;
		public static final int countobj10 = 109;
		public static final int resizex = 110;
		public static final int resizey = 111;
		public static final int resizez = 112;
		public static final int ambient = 113;
		public static final int contrast = 114;
		public static final int team = 115;
		public static final int params = 249;

	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(BLclient!wa;I)V")
	private void decode(@OriginalArg(1) Buffer buffer, @OriginalArg(2) int opcode) {
		if (opcode == Opcodes.model) { // 1
			this.model = buffer.g2();
		} else if (opcode == Opcodes.name) { // 2
			this.name = buffer.gjstr();
		} else if (opcode == Opcodes.zoom2d) { // 4
			this.zoom2d = buffer.g2();
		} else if (opcode == Opcodes.xan2d) { // 5
			this.xAngle2D = buffer.g2();
		} else if (opcode == Opcodes.yan2d) { // 6
			this.yAngle2D = buffer.g2();
		} else if (opcode == Opcodes.xof2d) { // 7
			this.xOffset2D = buffer.g2();
			if (this.xOffset2D > 32767) {
				this.xOffset2D -= 65536;
			}
		} else if (opcode == Opcodes.yof2d) { // 8
			this.yOffset2D = buffer.g2();
			if (this.yOffset2D > 32767) {
				this.yOffset2D -= 65536;
			}
		} else if (opcode == Opcodes.stackable_yes) { // 11
			this.stackable = 1;
		} else if (opcode == Opcodes.cost) { // 12
			this.cost = buffer.g4();
		} else if (opcode == Opcodes.members) { // 16
			this.members = true;
		} else if (opcode == Opcodes.manwear) { // 23
			this.manwear = buffer.g2();
		} else if (opcode == Opcodes.manwear2) { // 24
			this.manwear2 = buffer.g2();
		} else if (opcode == Opcodes.womanwear) { // 25
			this.womanwear = buffer.g2();
		} else if (opcode == Opcodes.womanwear2) { // 26
			this.womanwear2 = buffer.g2();
		} else if (opcode >= Opcodes.op1 && opcode <= Opcodes.op5) { // 30-34
			this.ops[opcode - Opcodes.op1] = buffer.gjstr();
			if (this.ops[opcode - Opcodes.op1].equalsIgnoreCase(LocalizedText.HIDDEN)) {
				this.ops[opcode - Opcodes.op1] = null;
			}
		} else if (opcode >= Opcodes.iop1 && opcode <= Opcodes.iop5) { // 35-39
			this.iops[opcode - Opcodes.iop1] = buffer.gjstr();
		} else {
			@Pc(169) int count;
			@Pc(179) int i;
			if (opcode == Opcodes.recol) { // 40
				count = buffer.g1();
				this.recol_d = new short[count];
				this.recol_s = new short[count];
				for (i = 0; i < count; i++) {
					this.recol_s[i] = (short) buffer.g2();
					this.recol_d[i] = (short) buffer.g2();
				}
			} else if (opcode == Opcodes.retex) { // 41
				count = buffer.g1();
				this.retex_d = new short[count];
				this.retex_s = new short[count];
				for (i = 0; i < count; i++) {
					this.retex_s[i] = (short) buffer.g2();
					this.retex_d[i] = (short) buffer.g2();
				}
			} else if (opcode == 42) {
				count = buffer.g1();
				this.recol_p = new byte[count];
				for (i = 0; i < count; i++) {
					this.recol_p[i] = buffer.g1b();
				}
			} else if (opcode == Opcodes.stockmarket_yes) { // 65
				this.stockMarket = true;
			} else if (opcode == Opcodes.manwear3) { // 78
				this.manwear3 = buffer.g2();
			} else if (opcode == Opcodes.womanwear3) { // 79
				this.womanwear3 = buffer.g2();
			} else if (opcode == Opcodes.manhead) { // 90
				this.manhead = buffer.g2();
			} else if (opcode == Opcodes.womanhead) { // 91
				this.womanhead = buffer.g2();
			} else if (opcode == Opcodes.manhead2) { // 92
				this.manhead2 = buffer.g2();
			} else if (opcode == Opcodes.womanhead2) { // 93
				this.womanhead2 = buffer.g2();
			} else if (opcode == Opcodes.zan2d) { // 95
				this.zAngle2D = buffer.g2();
			} else if (opcode == 96) {
				this.dummyItem = buffer.g1();
			} else if (opcode == Opcodes.certlink) { // 97
				this.certlink = buffer.g2();
			} else if (opcode == Opcodes.certtemplate) { // 98
				this.certtemplate = buffer.g2();
			} else if (opcode >= Opcodes.countobj1 && opcode <= Opcodes.countobj10) { // 100-109
				if (this.countobj == null) {
					this.countobj = new int[10];
					this.countco = new int[10];
				}
				this.countobj[opcode - Opcodes.countobj1] = buffer.g2();
				this.countco[opcode - Opcodes.countobj1] = buffer.g2();
			} else if (opcode == Opcodes.resizex) { // 110
				this.resizeX = buffer.g2();
			} else if (opcode == Opcodes.resizey) { // 111
				this.resizeY = buffer.g2();
			} else if (opcode == Opcodes.resizez) { // 112
				this.resizeZ = buffer.g2();
			} else if (opcode == Opcodes.ambient) { // 113
				this.ambient = buffer.g1b();
			} else if (opcode == Opcodes.contrast) { // 114
				this.contrast = buffer.g1b() * 5;
			} else if (opcode == Opcodes.team) { // 115
				this.team = buffer.g1();
			} else if (opcode == 121) {
				this.lentLink = buffer.g2();
			} else if (opcode == 122) {
				this.lentTemplate = buffer.g2();
			} else if (opcode == 125) {
				this.manWearXOff = buffer.g1b();
				this.manWearYOff = buffer.g1b();
				this.manWearZOff = buffer.g1b();
			} else if (opcode == 126) {
				this.womanWearXOff = buffer.g1b();
				this.womanWearYOff = buffer.g1b();
				this.womanWearZOff = buffer.g1b();
			} else if (opcode == 127) {
				this.cursor1Op = buffer.g1();
				this.cursor1 = buffer.g2();
			} else if (opcode == 128) {
				this.cursor2Op = buffer.g1();
				this.cursor2 = buffer.g2();
			} else if (opcode == 129) {
				buffer.g1();
				buffer.g2();
			} else if (opcode == 130) {
				buffer.g1();
				buffer.g2();
			} else if (opcode == Opcodes.params) {
				int size = buffer.g1();
				if (this.params == null) {
					i = IntUtils.clp2(size);
					this.params = new HashTable(i);
				}
				for (i = 0; i < size; i++) {
					@Pc(510) boolean isString = buffer.g1() == 1;
					@Pc(514) int key = buffer.g3();
					@Pc(523) Node value;
					if (isString) {
						value = new StringNode(buffer.gjstr());
					} else {
						value = new IntNode(buffer.g4());
					}
					this.params.put(value, key);
				}
			}
		}
	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(III)I")
	public final int getParam(@OriginalArg(0) int defaultValue, @OriginalArg(2) int id) {
		if (this.params == null) {
			return defaultValue;
		} else {
			@Pc(25) IntNode node = (IntNode) this.params.get(id);
			return node == null ? defaultValue : node.value;
		}
	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(ILclient!na;I)Lclient!na;")
	public final JagString getParam(@OriginalArg(1) JagString defaultValue, @OriginalArg(2) int id) {
		if (this.params == null) {
			return defaultValue;
		} else {
			@Pc(21) StringNode node = (StringNode) this.params.get(id);
			return node == null ? defaultValue : node.value;
		}
	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(Lclient!h;Lclient!h;Z)V")
	public final void generateCertificate(@OriginalArg(0) ObjType link, @OriginalArg(1) ObjType template) {
		this.name = link.name;
		this.zoom2d = template.zoom2d;
		this.recol_s = template.recol_s;
		this.recol_d = template.recol_d;
		this.xAngle2D = template.xAngle2D;
		this.yAngle2D = template.yAngle2D;
		this.retex_d = template.retex_d;
		this.model = template.model;
		this.recol_p = template.recol_p;
		this.zAngle2D = template.zAngle2D;
		this.cost = link.cost;
		this.stackable = 1;
		this.yOffset2D = template.yOffset2D;
		this.xOffset2D = template.xOffset2D;
		this.retex_s = template.retex_s;
		this.members = link.members;
	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(BLclient!h;Lclient!h;)V")
	public final void generateLent(@OriginalArg(1) ObjType link, @OriginalArg(2) ObjType template) {
		this.recol_p = link.recol_p;
		this.manWearYOff = link.manWearYOff;
		this.params = link.params;
		this.manwear3 = link.manwear3;
		this.womanwear = link.womanwear;
		this.manWearZOff = link.manWearZOff;
		this.iops = new JagString[5];
		this.model = template.model;
		this.zoom2d = template.zoom2d;
		this.cost = 0;
		this.team = link.team;
		this.womanhead = link.womanhead;
		this.recol_s = link.recol_s;
		this.zAngle2D = template.zAngle2D;
		this.manwear2 = link.manwear2;
		this.yAngle2D = template.yAngle2D;
		this.manhead = link.manhead;
		this.manhead2 = link.manhead2;
		this.manWearXOff = link.manWearXOff;
		this.xAngle2D = template.xAngle2D;
		this.yOffset2D = template.yOffset2D;
		this.womanhead2 = link.womanhead2;
		this.womanWearXOff = link.womanWearXOff;
		this.recol_d = link.recol_d;
		this.womanWearYOff = link.womanWearYOff;
		this.womanWearZOff = link.womanWearZOff;
		this.xOffset2D = template.xOffset2D;
		this.manwear = link.manwear;
		this.womanwear2 = link.womanwear2;
		this.name = link.name;
		this.retex_d = link.retex_d;
		this.retex_s = link.retex_s;
		this.ops = link.ops;
		this.members = link.members;
		this.womanwear3 = link.womanwear3;
		if (link.iops != null) {
			for (@Pc(157) int local157 = 0; local157 < 4; local157++) {
				this.iops[local157] = link.iops[local157];
			}
		}
		this.iops[4] = LocalizedText.LENT_ITEM_RETURN;
	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(ZZ)Z")
	public final boolean isHeadModelReady(@OriginalArg(0) boolean female) {
		@Pc(6) int headModel = this.manhead;
		@Pc(9) int headModelAccessory = this.manhead2;
		if (female) {
			headModel = this.womanhead;
			headModelAccessory = this.womanhead2;
		}
		if (headModel == -1) {
			return true;
		}
		@Pc(33) boolean ready = ObjTypeList.modelsArchive.isFileReady(0, headModel);
		if (headModelAccessory != -1 && !ObjTypeList.modelsArchive.isFileReady(0, headModelAccessory)) {
			ready = false;
		}
		return ready;
	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(BZ)Z")
	public final boolean isWearModelReady(@OriginalArg(1) boolean female) {
		@Pc(6) int wear2 = this.manwear2;
		@Pc(9) int wear1 = this.manwear;
		@Pc(20) int wear3 = this.manwear3;
		if (female) {
			wear3 = this.womanwear3;
			wear1 = this.womanwear;
			wear2 = this.womanwear2;
		}
		if (wear1 == -1) {
			return true;
		}
		@Pc(41) boolean ready = ObjTypeList.modelsArchive.isFileReady(0, wear1);
		if (wear2 != -1 && !ObjTypeList.modelsArchive.isFileReady(0, wear2)) {
			ready = false;
		}
		if (wear3 != -1 && !ObjTypeList.modelsArchive.isFileReady(0, wear3)) {
			ready = false;
		}
		return ready;
	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(IIILclient!tk;II)Lclient!ak;")
	public final Model getModel(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) SeqType seqType, @OriginalArg(4) int count, @OriginalArg(5) int arg4) {
		if (this.countobj != null && count > 1) {
			@Pc(22) int countId = -1;
			for (@Pc(24) int i = 0; i < 10; i++) {
				if (count >= this.countco[i] && this.countco[i] != 0) {
					countId = this.countobj[i];
				}
			}
			if (countId != -1) {
				return ObjTypeList.get(countId).getModel(arg0, arg1, seqType, 1, arg4);
			}
		}
		@Pc(76) Model model = (Model) ObjTypeList.models.get(this.id);
		if (model == null) {
			@Pc(85) RawModel model2 = RawModel.create(ObjTypeList.modelsArchive, this.model);
			if (model2 == null) {
				return null;
			}
			@Pc(97) int i;
			if (this.recol_s != null) {
				for (i = 0; i < this.recol_s.length; i++) {
					if (this.recol_p == null || i >= this.recol_p.length) {
						model2.recolor(this.recol_s[i], this.recol_d[i]);
					} else {
						model2.recolor(this.recol_s[i], client.aShortArray87[this.recol_p[i] & 0xFF]);
					}
				}
			}
			if (this.retex_s != null) {
				for (i = 0; i < this.retex_s.length; i++) {
					model2.retexture(this.retex_s[i], this.retex_d[i]);
				}
			}
			model = model2.createModel(this.ambient + 64, this.contrast + 768, -50, -10, -50);
			if (this.resizeX != 128 || this.resizeY != 128 || this.resizeZ != 128) {
				model.resize(this.resizeX, this.resizeY, this.resizeZ);
			}
			model.pickable = true;
			if (GlRenderer.enabled) {
				((GlModel) model).method4111(false, false, false, false, false, true);
			}
			ObjTypeList.models.put(model, this.id);
		}
		if (seqType != null) {
			model = seqType.method4215(model, arg0, arg1, arg4);
		}
		return model;
	}

	@OriginalMember(owner = "client!h", name = "d", descriptor = "(I)Lclient!w;")
	public final SoftwareModel getInvModel() {
		@Pc(11) RawModel model = RawModel.create(ObjTypeList.modelsArchive, this.model);
		if (model == null) {
			return null;
		}
		@Pc(21) int i;
		if (this.recol_s != null) {
			for (i = 0; i < this.recol_s.length; i++) {
				if (this.recol_p == null || i >= this.recol_p.length) {
					model.recolor(this.recol_s[i], this.recol_d[i]);
				} else {
					model.recolor(this.recol_s[i], client.aShortArray87[this.recol_p[i] & 0xFF]);
				}
			}
		}
		if (this.retex_s != null) {
			for (i = 0; i < this.retex_s.length; i++) {
				model.retexture(this.retex_s[i], this.retex_d[i]);
			}
		}
		@Pc(107) SoftwareModel softwareModel = model.createSoftwareModel(this.ambient + 64, 768 - -this.contrast);
		if (this.resizeX != 128 || this.resizeY != 128 || this.resizeZ != 128) {
			softwareModel.resize(this.resizeX, this.resizeY, this.resizeZ);
		}
		return softwareModel;
	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(ZB)Lclient!gb;")
	public final RawModel getHeadModel(@OriginalArg(0) boolean female) {
		@Pc(4) int head2 = this.manhead2;
		@Pc(17) int head = this.manhead;
		if (female) {
			head2 = this.womanhead2;
			head = this.womanhead;
		}
		if (head == -1) {
			return null;
		}
		@Pc(36) RawModel model = RawModel.create(ObjTypeList.modelsArchive, head);
		if (head2 != -1) {
			@Pc(44) RawModel model2 = RawModel.create(ObjTypeList.modelsArchive, head2);
			@Pc(55) RawModel[] models = new RawModel[]{model, model2};
			model = new RawModel(models, 2);
		}
		@Pc(66) int i;
		if (this.recol_s != null) {
			for (i = 0; i < this.recol_s.length; i++) {
				model.recolor(this.recol_s[i], this.recol_d[i]);
			}
		}
		if (this.retex_s != null) {
			for (i = 0; i < this.retex_s.length; i++) {
				model.retexture(this.retex_s[i], this.retex_d[i]);
			}
		}
		return model;
	}

	@OriginalMember(owner = "client!h", name = "a", descriptor = "(ZI)Lclient!gb;")
	public final RawModel getBodyModel(@OriginalArg(0) boolean female) {
		@Pc(4) int wear1 = this.manwear;
		@Pc(18) int wear2 = this.manwear2;
		@Pc(21) int wear3 = this.manwear3;
		if (female) {
			wear3 = this.womanwear3;
			wear1 = this.womanwear;
			wear2 = this.womanwear2;
		}
		if (wear1 == -1) {
			return null;
		}
		@Pc(43) RawModel model = RawModel.create(ObjTypeList.modelsArchive, wear1);
		if (wear2 != -1) {
			@Pc(54) RawModel model2 = RawModel.create(ObjTypeList.modelsArchive, wear2);
			if (wear3 == -1) {
				@Pc(68) RawModel[] models = new RawModel[]{model, model2};
				model = new RawModel(models, 2);
			} else {
				@Pc(81) RawModel model3 = RawModel.create(ObjTypeList.modelsArchive, wear3);
				@Pc(96) RawModel[] models = new RawModel[]{model, model2, model3};
				model = new RawModel(models, 3);
			}
		}
		if (!female && (this.manWearXOff != 0 || this.manWearYOff != 0 || this.manWearZOff != 0)) {
			model.translate(this.manWearXOff, this.manWearYOff, this.manWearZOff);
		}
		if (female && (this.womanWearXOff != 0 || this.womanWearYOff != 0 || this.womanWearZOff != 0)) {
			model.translate(this.womanWearXOff, this.womanWearYOff, this.womanWearZOff);
		}
		@Pc(165) int i;
		if (this.recol_s != null) {
			for (i = 0; i < this.recol_s.length; i++) {
				model.recolor(this.recol_s[i], this.recol_d[i]);
			}
		}
		if (this.retex_s != null) {
			for (i = 0; i < this.retex_s.length; i++) {
				model.retexture(this.retex_s[i], this.retex_d[i]);
			}
		}
		return model;
	}
}
