July 3, 20169 yr 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, 20169 yr by Ayylmao420
July 3, 20169 yr That looks like an unsafe way of doing groundItem.isOnScreen() Edited July 3, 20169 yr by FrostBug
July 3, 20169 yr Author That looks like an unsafe way of doing groundItem.isOnScreen() What is the difference between isVisible() and isOnScreen() ?
July 3, 20169 yr What is the difference between isVisible() and isOnScreen() ? They're probably the same.
July 3, 20169 yr Author They're probably the same. That won't help me really since isVisible() fails aswell when item is stacked.
July 3, 20169 yr 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.
July 3, 20169 yr 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.
July 4, 20169 yr Author 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, 20169 yr by Ayylmao420
July 4, 20169 yr 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
Create an account or sign in to comment