Jump to content

Inconstancies with Entity getHeight()


Ragnar Lothbrok

Recommended Posts

I'm having trouble with the Entity getHeight() method returning the wrong value.

Here's my code:

RS2Object patch = getObjects().closest(p -> IntStream.of(p.getModelIds()).anyMatch(i -> i == 7768));
if (patch != null) {
	if (patch.getHeight() < 80) {
		// Plant Seed Code
	} else {
		// Water Code
	}
}
  

The problem is after the seed is planted I'm still getting 0 back for the height when is should now be 80 - this doesn't seem to be constant however as sometimes I'm getting the correct result. If I use the debug on the client I can see that the height is in-fact 80.

Am I just doing something stupid here or is this a client bug?

Edited by Ragnar Lothbrok
Link to comment
Share on other sites

There may be a different RS2Object instance for every tile of the patch, even multiple ones on the same tile and only one visible representing the current growth cycle of the patch. That's just an idea of what to look for, I doubt that's the problem but I'm saying you should check how many of those entities are actually there and look at their properties and how they change when the seed is planted (through code).

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...