Skip to content

Fix Queryable API gaps: isDespawned bug, missing methods, missing example files#1697

Merged
chsami merged 9 commits intodevelopmentfrom
copilot/review-latest-api
Mar 14, 2026
Merged

Fix Queryable API gaps: isDespawned bug, missing methods, missing example files#1697
chsami merged 9 commits intodevelopmentfrom
copilot/review-latest-api

Conversation

Copy link

Copilot AI commented Mar 14, 2026

The new Queryable API had a logic bug in isDespawned(), several methods documented but unimplemented, and missing example files for two of the four entity types.

Bug Fixes

  • Rs2TileItemModel.isDespawned() – logic was inverted and didn't handle the no-timer case (getDespawnTime() == -1):
    // Before: returned true while item was still alive
    return getDespawnTime() > Microbot.getClient().getTickCount();
    
    // After: correctly returns true only when the despawn timer has expired
    int despawnTime = getDespawnTime();
    return despawnTime != -1 && despawnTime <= Microbot.getClient().getTickCount();
  • TileItemApiExample Example 16 – was filtering with .where(item -> item.isDespawned()) intending to keep live items; corrected to .where(item -> !item.isDespawned())

Missing Implementations (documented but absent)

  • Rs2TileItemModel.pickup() – convenience wrapper over click("Take")
  • Rs2PlayerModel – added isFriend(), isClanMember(), isFriendsChatMember(), getSkullIcon(), getOverheadIcon(), all delegating to the underlying Player API via the client thread

New Query Method

  • count() added to IEntityQueryable / AbstractEntityQueryable – avoids allocating a full list just to count matches:
    int nearbyGuards = npcCache.query().withName("Guard").within(10).count();

Missing Example Files

  • PlayerApiExample.java – listed in README.md directory structure but did not exist
  • TileObjectApiExample.java – tile objects were the only entity type with no usage examples

Docs

  • QUERYABLE_API.md: added count() to API reference; corrected obj.interact()obj.click() (the model exposes click(), not interact()); synced player method list with actual implementation
  • README.md: added TileObjectApiExample.java to directory structure and examples list

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repo.runelite.net
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.8-all/6gdy1pgp427xkqcjbxw3ylt6h/gradle-8.8/lib/gradle-launcher-8.8.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.8-all/6gdy1pgp427xkqcjbxw3ylt6h/gradle-8.8/lib/agents/gradle-instrumentation-agent-8.8.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.8 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

…ssing player model methods

Co-authored-by: chsami <23292806+chsami@users.noreply.github.com>
Copilot AI changed the title [WIP] Review new latest API for improvements Fix Queryable API gaps: isDespawned bug, missing methods, missing example files Mar 14, 2026
Copilot AI requested a review from chsami March 14, 2026 13:37
@chsami chsami marked this pull request as ready for review March 14, 2026 14:21
@chsami chsami changed the base branch from main to development March 14, 2026 14:21
@chsami chsami merged commit 9000f10 into development Mar 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants