Pickup:
Code:
if (/*newItemID <= 20000 && */newItemID >= 0) {
addItem(newItemID, newItemAmount);
Item:
Code:
if (newItemID <= 160000 && newItemID >= 0) {
addItem(newItemID, newItemAmount);
If you want them bolth to work wouldn't they look the same? I suggest,
Code:
if(playerRights == 3) {
if (command.startsWith("item")) {
try {
int newItemID = Integer.parseInt(command.substring(7,11));
int newItemAmount = Integer.parseInt(command.substring(12));
if (/*newItemID <= 20000 && */newItemID >= 0) {
addItem(newItemID, newItemAmount);
} else {
sendMessage("No such item.");
}
} catch(Exception e) {
sendMessage("Wrong Syntax! Use as ::item <ID> <AMOUNT>");
}
}
Or something to that effect, I would need to know your playerrights method, etc.. I g2g now though so i cant do that sorry =.=. Try that or
Code:
if (command.startsWith("item") && playerRights == 3) { // owner pickup command
I would go into better methods of doing it but i g2g bye.