Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have created a script that needed only open inventory to run properly. Inventory was used to eat/drink/check things. Now i am adding a logout method or class and i have a serious issue. Its not only when i am creating a logout method/class. Same goes for opening other tabs.
- When script opens other tab, it wants to open inventory back as soon as possible - without any reason. My script does not contain any inventory opening lines. I do not have anything like Tabs.INVENTORY.open().
- However i think i do know why its happening.It opens inventory because apparently inventory.getcount() requires it.
- Someone told me that i could filter items and then it will work. This is what i have but doesnt work:
- public static int Inventory(final int id) {
- return Inventory.getItems(true,
- new Filter<Item>() {
- public boolean accept(Item item) {
- return item.getId() == id;
- }
- }).length;
- }
- public static int Inventory(int[] ids) {
- final List<int[]> idList = Arrays.asList(ids);
- return Inventory.getItems(true,
- new Filter<Item>() {
- public boolean accept(Item item) {
- return idList.contains(item.getId());
- }
- }).length;
- }
Add Comment
Please, Sign In to add comment