Jump to content

Stacked grounditems


Ayylmao420

Recommended Posts

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 by Ayylmao420
Link to comment
Share on other sites

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 by Ayylmao420
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...