Def cleanup (#585)
* Object definition cleanup * Update ShopAssistant.java * stackables * notables * unused files * more junk * almost done * working * moving old methods to deprecated * update * fixed pickpocket typos * Update Pickpocket.java * Remove redundant method. Fix stall stealing * Documentation for deprecated methods * WIP commit partial removal. Has test and dump classes * Final cleanup * Move definitions from data folder to cfg * Temporarily moving definition loaders to GameEngine This is until loading can be done asynchronously. * Correct indentation.
This commit is contained in:
1 parent
b2212d357e
commit
eab153ee3f
98 files changed
+21771
-285672
No files matched your search
@@ -4,8 +4,9 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apollo.cache.def.ItemDefinition;
|
||||
|
||||
import com.rs2.GameConstants;
|
||||
import com.rs2.GameEngine;
|
||||
|
||||
public class ItemData {
|
||||
|
||||
@@ -148,7 +149,7 @@ public class ItemData {
|
||||
"sallet", "Facemask", "Bearhead"};
|
||||
|
||||
public static boolean isFullBody(int itemId) {
|
||||
String weapon = getItemName(itemId);
|
||||
String weapon = ItemDefinition.lookup(itemId).getName();
|
||||
if (weapon == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -161,7 +162,7 @@ public class ItemData {
|
||||
}
|
||||
|
||||
public static boolean isFullHelm(int itemId) {
|
||||
String weapon = getItemName(itemId);
|
||||
String weapon = ItemDefinition.lookup(itemId).getName();
|
||||
if (weapon == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -174,7 +175,7 @@ public class ItemData {
|
||||
}
|
||||
|
||||
public static boolean isFullMask(int itemId) {
|
||||
String weapon = getItemName(itemId);
|
||||
String weapon = ItemDefinition.lookup(itemId).getName();
|
||||
if (weapon == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -186,54 +187,11 @@ public class ItemData {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getItemName(int id) {
|
||||
for (ItemList element : GameEngine.itemHandler.itemList) {
|
||||
if (element != null) {
|
||||
if (element.itemId == id) {
|
||||
return element.itemName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean[] itemStackable = new boolean[GameConstants.ITEM_LIMIT];
|
||||
public static boolean[] itemIsNote = new boolean[GameConstants.ITEM_LIMIT];
|
||||
public static int[] targetSlots = new int[GameConstants.ITEM_LIMIT];
|
||||
static {
|
||||
int counter = 0;
|
||||
int c;
|
||||
|
||||
try {
|
||||
FileInputStream dataIn = new FileInputStream(new File("./data/data/stackable.dat"));
|
||||
while ((c = dataIn.read()) != -1) {
|
||||
if (c == 0) {
|
||||
itemStackable[counter] = false;
|
||||
itemStackable[291] = true;
|
||||
} else {
|
||||
itemStackable[counter] = true;
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
dataIn.close();
|
||||
} catch (IOException e) {
|
||||
System.out.println("Critical error while loading stackabledata! Trace:");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
counter = 0;
|
||||
try {
|
||||
FileInputStream dataIn = new FileInputStream(new File("./data/data/notes.dat"));
|
||||
while ((c = dataIn.read()) != -1) {
|
||||
itemIsNote[counter] = c == 0;
|
||||
counter++;
|
||||
}
|
||||
dataIn.close();
|
||||
} catch (IOException e) {
|
||||
System.out.println("Critical error while loading notedata! Trace:");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
counter = 0;
|
||||
try {
|
||||
FileInputStream dataIn = new FileInputStream(new File("./data/data/equipment.dat"));
|
||||
|
||||
Reference in new issue
Block a user