Im A Baller 348 Posted December 29, 2016 AbstractItemContainer#getSlotForNameContaining(String name) - very useful for both banking and using inventory slots for items such as Potions(4,3,2..), Waterskins(4,3,2..), Glory(6,5,4,...), Ring of dueling(8,7,6...), and the list goes on. This method would find a slot that holds any given item whose name contains the given string. If no such item is found, it would return a -1. I'm currently just using my own ghetto implementation: public int getSlotForNameContaining(AbstractItemContainer<Item> container, String contained) { for(int i = 0; i < 28; i++) { if(container.slotNameContains(i, contained)) { return i; } } return -1; }
Im A Baller 348 Author Posted December 29, 2016 Aren't you able to use a filter? Probably should have used a filter instead of the method above. Good point, though that doesn't necessarily negate the utility of this method
Nuclear Nezz 2107 Posted December 29, 2016 I think what he means is Item item = getX().get(filter);item.getSlot();
Recommended Posts
Archived
This topic is now archived and is closed to further replies.