This will fix the overflow when dropping a ground item. This happens because in 317 clients, the max amount of an item is 999M.
Client class: In the ground item spawn method or search for:
The loop below is for selecting the top item based on the item amount and value:
Code:
int k = 0xfa0a1f01;
Object obj = null;
for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
ItemDef itemDef = ItemDef.forID(item.ID);
int l = itemDef.value;
if (itemDef.stackable) {
l *= item.anInt1559 + 1;
}
if (l > k) {
k = l;
obj = item;
}
}
You have to change the value calculations from int to long.
So it looks like this:
Code:
long minValue = -Integer.MAX_VALUE;
Object obj = null;
for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
ItemDef itemDef = ItemDef.forID(item.ID);
long value = itemDef.value;
if (itemDef.stackable) {
value *= (long) (item.anInt1559 + (long) 1);
}
if (value > minValue) {
minValue = value;
obj = item;
}
}