Originally Posted by
Eldritch
public void deleteItem(int id, int amount) --> Deletes a certain ID item of the given amount, however will automatically pick the slots starting from the top.
public void deleteItem(int id, int slot, int amount) --> Apparently it loops through all inventory slots checking for the given item. If the ID of the item equals the item the player's attempting to delete (I'm guessing, not quite fully understanding the +1 addition there, as to why it's necessary), it will set the item's id and amount to zero and decrement the variable 'amount' by one (Also not sure as to why this is necessary as the variable is no longer used afterwards), after which it will reset the items in the inventory (I'm guessing resetItems(3214) refers to refreshing the inventory container items, don't quote me on this though). NOTE: The 'slot' variable is NOT used within the method, completely and utterly useless variable.
public void deleteItem2(int id, int amount) --> Loops through inventory slots, same shit as before basically, however this time it will decrement the amount of the item only UNLESS the item's amount is lower than the variable amount (AKA player has less of the item than it's attempting to remove), in which case it will set the item's ID and amount to zero and decrement the amount variable once again for no apparent reason. After which it resets the container again (Once again just guessing).
public void specialDeleteItem(int id, int amount) --> Starts off by getting the item's slot in player's inventory (Returning the method if the ID equals or is below 0 or if the slot is zero), after which it will check if the item still is the item they're trying to modify (Honestly, a quite useless check), after which it will check if the player has more of the item than attempting to delete, in which case it will just decrement the item's amount, otherwise it will set the item's ID and amount to zero once again. Interestingly enough, the container isn't being 'refreshed' this time.
public void specialDeleteItem(int id, int slot, int amount) --> Will immidiately check if the item in the given slot actually is the very same item, after which it'll decrement the amount of possible, otherwise it will just set the amount and ID to zero once again (Just as with others).
Note I didn't include the descriptions of the returning parts in here (Except for one), although I must say.. These methods are poorly coded and could all be combined into just one simple method, or two if you're into simplicity and wish not to constantly include the slot variable (Although I don't really even need the need to get the slot ID.. This is pretty much a dynamic variable that changes all the time, why'd anyone even wish to define it by hand when you can just check the inventory for slot?).
ANOTHER NOTE: I thought this thread had no replies, smh. How did I not see this had already been answered lmao.