Most people use checks like this.
Code:
if (!((c.playerItems[fromSlot] == itemID + 1) && (c.playerItemsN[fromSlot] > amount))) {
c.sendMessage("You don't have that amount!");
return false;
}
Is this really neccessary? The trade system already has checks on this.
Code:
if (item.amount > amount) {
item.amount -= amount;
c.getItems().addItem(itemID, amount);
} else {
amount = item.amount;
offeredItems.remove(item);
c.getItems().addItem(itemID, amount);
}
What I'm wondering if there really is a reason to have a check like that.