Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Inventory#containsOnly()

Primate
Joined
Oct 30, 2014
Messages
3,458
Inventory#containsOnly() returns true when the inventory is empty.

RS3 not confirmed.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
That seems like desired behavior, it doesn't contain any items that aren't the specified items. Use containsOnly and containsAllOf or containsAnyOf depending on what behavior you want.
 
Primate
Joined
Oct 30, 2014
Messages
3,458
That seems like desired behavior, it doesn't contain any items that aren't the specified items. Use containsOnly and containsAllOf or containsAnyOf depending on what behavior you want.
But the method is called containsOnly, if the inventory contains nothing, then it doesn't contain?
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
But the method is called containsOnly, if the inventory contains nothing, then it doesn't contain?
It contains only items within the given array, even if there aren't technically any items in the inventory. Anything it does contain is within the given array.
 
Top