Ayylmao420 Posted July 3, 2016 Share Posted July 3, 2016 (edited) if (GraphicUtilities.isVisibleOnMainScreen(new RectangleDestination(getBot(), groundItem.getModel().getBoundingBox(groundItem.getGridX(), groundItem.getGridY(), groundItem.getZ())).getBoundingBox())) { } Any ideas why it throws NPE for stacked items(example; if coins are covered with bigger item like kiteshield etc ...) ? Edited July 3, 2016 by Ayylmao420 Quote Link to comment Share on other sites More sharing options...
FrostBug Posted July 3, 2016 Share Posted July 3, 2016 (edited) That looks like an unsafe way of doing groundItem.isOnScreen() Edited July 3, 2016 by FrostBug 1 Quote Link to comment Share on other sites More sharing options...
Ayylmao420 Posted July 3, 2016 Author Share Posted July 3, 2016 That looks like an unsafe way of doing groundItem.isOnScreen() What is the difference between isVisible() and isOnScreen() ? Quote Link to comment Share on other sites More sharing options...
FrostBug Posted July 3, 2016 Share Posted July 3, 2016 What is the difference between isVisible() and isOnScreen() ? They're probably the same. Quote Link to comment Share on other sites More sharing options...
Ayylmao420 Posted July 3, 2016 Author Share Posted July 3, 2016 They're probably the same. That won't help me really since isVisible() fails aswell when item is stacked. Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted July 3, 2016 Share Posted July 3, 2016 That won't help me really since isVisible() fails aswell when item is stacked. Maybe check if the tile is onScreen that the item is sitting at. Quote Link to comment Share on other sites More sharing options...
Alek Posted July 3, 2016 Share Posted July 3, 2016 Ugh, why do you keep making visibility threads. Just do: groundItem.interact("Take"); It figures out if the item is visible or not, rotates the camera, walks to the object, etc. 1 Quote Link to comment Share on other sites More sharing options...
Ayylmao420 Posted July 4, 2016 Author Share Posted July 4, 2016 (edited) Ugh, why do you keep making visibility threads. Just do: groundItem.interact("Take"); It figures out if the item is visible or not, rotates the camera, walks to the object, etc. It is for my custom interaction method, that is why. if (GraphicUtilities.isVisibleOnMainScreen(GraphicUtilities.getModelArea(getBot(), groundItem.getGridX(), groundItem.getGridY(), groundItem.getZ(), groundItem.getModel()))) { } Seems to work now. Edited July 4, 2016 by Ayylmao420 Quote Link to comment Share on other sites More sharing options...
FrostBug Posted July 4, 2016 Share Posted July 4, 2016 It is for my custom interaction method, that is why. if (GraphicUtilities.isVisibleOnMainScreen(GraphicUtilities.getModelArea(getBot(), groundItem.getGridX(), groundItem.getGridY(), groundItem.getZ(), groundItem.getModel()))) { } Seems to work now. Probably failed because the RectangleDestination cannot return a valid bounding box if it isn't on screen Quote Link to comment Share on other sites More sharing options...