The problem is that sometimes more expensive stuff gets dropped over less expensive stuff.
Here's my shit code in sendItemsOnDeath method.. I started trying random shit so it's pretty fucked up
anyone have code for custom item values so that they protect properly? Problem I think is that it reads other values from the cache. not sure doe
Code:
Item lastItem = new Item(1, 1);
for (int i = 0; i < keptAmount; i++) {
for (Item item : containedItems) {
int price = item.getDefinitions().getValue();
for (int d : pvpItems)
if((item.getId()) != (d)){
price = 0;
}
switch(item.getId()) {
case 11724:
case 11726:
price = 11500000;
break;
case 13740:
price = 20000000;
break;
case 18359:
price = 22500000;
break;
case 22494:
price = 24000000;
break;
case 19784:
case 11694:
price = 25000000;
break;
case 14484:
price = 27500000;
break;
case 20151:
case 20155:
price = 35000000;
break;
}
for (int d : pvpItems)
if ((lastItem.getId() != d) && (price >= lastItem.getDefinitions().getValue()) ) {
lastItem = item;
}
}
keptItems.add(lastItem);
containedItems.remove(lastItem);
lastItem = new Item(1, 1);
}
inventory.rese