public final class ItemDefinition {
private static final int[] BLACK_FIX = { 13101, 13672, 13675, 6568, 10636,
12158, 12159, 12160, 12161, 12162, 12163, 12164, 12165, 12166,
12167, 12168, 12527, 18017, 18018, 18019, 18020, 3140, 13481,
14479, 14481, 19337, 19342 };
private static ByteBuffer buffer;
private static ItemDefinition[] cache;
private static int cacheIndex;
public static boolean isMembers = true;
public static List mruNodes1 = new List(100);
public static List mruNodes2 = new List(50);
private static int[] streamIndices;
public static int totalItems;
public static void dumpItemModelsForId(int i) {
try {
ItemDefinition d = get(i);
if (d != null) {
int[] models = { d.maleWearId, d.femaleWearId, d.modelID, };
for (int ids : models) {// 13655
if (ids > 0) {
try {
System.out.println("Dumping item model: " + ids);
byte abyte[] = Client.instance.decompressors[1].decompress(ids);
File map = new File("./models/" + ids + ".gz");
FileOutputStream fos = new FileOutputStream(map);
fos.write(abyte);
fos.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static ItemDefinition get(int id) {
for (int i = 0; i < 10; i++) {
if (cache[i].id == id) {
return cache[i];
}
}
cacheIndex = (cacheIndex + 1) % 10;
ItemDefinition itemDef = cache[cacheIndex];
buffer.position = streamIndices[id];
itemDef.id = id;
itemDef.setDefaults();
/* if (Hardcode.readOSRSItem(itemDef)) {
if (!itemDef.name.contains("hat") && !itemDef.name.contains("boot") && !itemDef.name.contains("cape")) {
itemDef.maleWieldY += 8;
itemDef.femaleWieldY += 8;
}
if (itemDef.name.contains("hat")) {
itemDef.maleWieldZ = 5;
itemDef.femaleWieldZ = 5;
}
} else {
itemDef.readValues(buffer);
}*/
itemDef.readValues(buffer);
if (itemDef.modifiedModelColors != null) {
for (int i2 = 0; i2 < itemDef.modifiedModelColors.length; i2++) {
if (itemDef.originalModelColors[i2] == 0) {
itemDef.originalModelColors[i2] = 1;
}
}
}
for (int a : BLACK_FIX) {
if (itemDef.id == a) {
itemDef.modifiedModelColors = new int[1];
itemDef.originalModelColors = new int[1];
itemDef.modifiedModelColors[0] = 0;
itemDef.originalModelColors[0] = 1;
}
}
int customId = itemDef.id;
if (customId >= 13700 && customId <= 13709) {
/*
* final ItemDefinition stat = get(14876); definition.name = "Tier "
* + (1 + (customId - 13700)) + " Emblem"; definition.actions =
* stat.actions.clone(); //definition.modifiedModelColors =
* stat.modifiedModelColors.clone();
* //definition.originalModelColors =
* stat.originalModelColors.clone(); definition.modelID =
* stat.modelID; definition.modelOffset1 = stat.modelOffset1;
* definition.modelOffset2 = stat.modelOffset2;
* definition.modelRotation1 = stat.modelRotation1;
* definition.modelRotation2 = stat.modelRotation2;
* definition.groundActions = stat.groundActions; definition.value =
* stat.value; definition.modelZoom = stat.modelZoom;
* definition.certID = -1; definition.certTemplateID = -1;
* definition.stackable = false;
*/
itemDef.certID = -1;
itemDef.certTemplateID = -1;
itemDef.stackable = false;