Conversation
WalkthroughTwo delegated override methods were added to the Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/tileobject/Rs2TileObjectModel.java (1)
95-105: Null check ingetName()is placed after dereferencingcompositionYou call
composition.getImpostorIds()before checking whethercompositionis null, then later doif(composition == null) return null;. IfgetObjectDefinitioncan ever return null (which this check suggests you expect), the dereference happens first and would NPE, making the later null check effectively inconsistent with the intended guard.Consider reordering the null check ahead of any use of
composition, and guarding again after resolving the impostor:- ObjectComposition composition = Microbot.getClient().getObjectDefinition(tileObject.getId()); - if(composition.getImpostorIds() != null) - { - composition = composition.getImpostor(); - } - if(composition == null) - return null; - return Rs2UiHelper.stripColTags(composition.getName()); + ObjectComposition composition = Microbot.getClient().getObjectDefinition(tileObject.getId()); + if(composition == null) + return null; + + if(composition.getImpostorIds() != null) + { + composition = composition.getImpostor(); + if(composition == null) + return null; + } + + return Rs2UiHelper.stripColTags(composition.getName());
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/tileobject/Rs2TileObjectModel.java(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*.java
📄 CodeRabbit inference engine (AGENTS.md)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*.java: Gameplay automation lives inrunelite-client/src/main/java/net/runelite/client/plugins/microbot; keep new scripts and utilities inside this plugin
Register new automation undernet.runelite.client.plugins.microbotand reuse the scheduler pattern shown inExampleScript
Files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/tileobject/Rs2TileObjectModel.java
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/**/*.java
📄 CodeRabbit inference engine (AGENTS.md)
Shared helpers sit under
.../microbot/util
Files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/tileobject/Rs2TileObjectModel.java
**/*.java
📄 CodeRabbit inference engine (AGENTS.md)
**/*.java: Keep indentation with tabs, follow the brace placement already inMicrobotPlugin.java, and prefer lines under 120 characters
UseUpperCamelCasefor types,lowerCamelCasefor members, and prefix configuration interfaces with the plugin name (e.g.,ExampleConfig)
Rely on Lombok for boilerplate where already adopted
Files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/tileobject/Rs2TileObjectModel.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build
🔇 Additional comments (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/tileobject/Rs2TileObjectModel.java (1)
143-155: New TileObject overrides correctly delegate to the wrapped instance
getOpOverride(int index)andisOpShown(int index)both directly forward to the underlyingtileObject, matching the delegation pattern used by the rest of this adapter and satisfying the updatedTileObjectcontract; no logic inconsistencies here.
When working on fix for another person, I was having issues compiling the client due to these methods not being implemented when updating the RL version here - fa321d1