mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-12-05 19:01:04 +00:00
* refactor(commands): organize command plugins into permission-tiered subfolders
* feat(commands): Rename Drops Command to SearchDrops and make Drops an alias
* refactor(client): remove unofficial client-side search command implementation
Remove the hardcoded client-side ::search command interception and definitionSearch
handler from Game.java in favor of the server-side interface-driven
search plugins (::searchitem, ::searchnpc, and ::searchdrops).
### Input Handling
- Game.java:
- Remove ::search prefix checks and inputDialogState mutators during character
typing and backspacing in the chatbox input loop.
### Cleanups & Deprecations
- Game.java:
- Remove definitionSearch(String, int) method, eliminating unused client-side
item/NPC/object cache iteration, fake bank interface manipulation, and local
chat message flooding.
* feat(clipping): implement authentic 377 object and npc reachability, collision bounds, and fallback pathfinding
Implements authentic Revision 377 RS2 collision detection, object interaction reachability, and fallback pathfinding across the game server. Replaces custom coordinate workarounds and hardcoded checks with cache-driven collision rules, decoding opcode 69 (`walkToMask`) and enforcing authentic line-of-sight and perimeter validation for both objects and entities. When an unreachable entity or object is clicked, pathfinding smoothly navigates the player to the nearest valid alternative tile before halting with an authentic "I can't reach that." message.
### Core System Architecture
* `Region.java`:
- Implemented `canReach` to handle all standard RS2 object types: wall objects (types 0–3, 9), wall decorations (types 6–8), multi-tile landscape objects (types 10–11), and ground decorations (type 22).
- Implemented `canReachObject` supporting rectangular object bounding boxes ($sizeX \times sizeY$) and directional walk-to masks rotated according to object orientation (`(walkToMask << face & 0xf) | (walkToMask >> (4 - face))`).
- Implemented `canReachNpcMelee` strictly enforcing cardinal adjacency for $1 \times 1$ NPCs while allowing diagonal melee contact against larger monsters ($size > 1$) when intervening corners are unblocked.
- Implemented `canReachNpc` supporting distance-2 interactions over impassable low barriers (e.g. bank counters, tables) by validating that the intermediate tile is collision-blocked (`(getClipping & 0x1280100) != 0`) while projectile line-of-sight remains clear.
* `ObjectDefinitionDecoder.java` & `ObjectDefinition.java`:
- Decoded opcode 69 (`walkToMask`) from the Revision 377 cache definition buffer (`definition.setWalkToMask(data.get() & 0xFF)`).
- Added `walkToMask` getter and setter to `ObjectDefinition`.
* `PathFinder.java`:
- Updated `findRoute` to return a `boolean` status indicating whether an authentic path or closest alternative destination was found.
- Handled the edge case where the closest alternative coordinate matches the player's current coordinate (`curX == player.getLocalX() && curY == player.getLocalY()`), clearing the queue and returning `false`.
* `Objects.java`:
- Added safety boundaries against negative or out-of-range object definitions (`objectId < 0 || objectId >= ObjectDefinition.count()`).
- Added `getWalkToMask()` helper delegating to the decoded `ObjectDefinition`.
### Object & NPC Interaction Infrastructure
* `ClickObject.java`:
- Implemented `isObjectReached` combining `Region.canReach`, door reachability (`Doors.canReachDoor`, `DoubleDoors.canReachDoor`), and generic door/gate adjacency.
- Added fallback pathfinding (`PathFinder.findRoute(player, objectX, objectY, true, size[0], size[1])`) when an unreachable object is clicked from a distance.
- Triggered instant interaction upon reaching interaction bounds (`if (reached)`), stopping character movement and resetting the walking queue without tick lag.
- Replaced raw magic numbers with `StaticObjectList` (`TARGET_2513`, `DRAMEN_TREE`, `TREE_2409`) and `StaticNpcList` (`TREE_SPIRIT_655`, `SHAMUS`) constants.
* `ClickNPC.java`:
- Extracted shared interaction logic across `FIRST_CLICK`, `SECOND_CLICK`, and `THIRD_CLICK` into a unified `handleNpcInteraction(Player, int, Consumer<Npc>)` method, removing redundant cycle event boilerplate.
- Added fallback pathfinding towards the target NPC's bounds on initial click if not immediately reachable.
- Ensured `"I can't reach that."` is sent only after walking finishes at the closest blocking perimeter (e.g. Al-Kharid border fence).
* `ItemOnNpc.java`:
- Added NPC array index and null validation (`i < 0 || i >= NpcHandler.npcs.length || NpcHandler.npcs[i] == null`).
- Added reachability check via `Region.canReachNpc`, halting player movement and sending `"I can't reach that."` if unreachable.
- Replaced raw item and NPC magic numbers with `StaticItemList` (`SHEARS`, `WOOL`, `COINS_995`, `BUCKET_OF_MILK`, `BUCKET`, `SEASONED_SARDINE`, `FLUFFS_KITTEN`) and `StaticNpcList` (`TOOL_LEPRECHAUN`, `SHEEP_43`, `EMILY`, `GERTRUDES_CAT_2997`) constants.
* `PlayerAssistant.java`:
- Implemented `getFollowNpcLocation` to determine the closest reachable perimeter tile around an NPC, preventing invalid diagonal melee coordinates for $1 \times 1$ NPCs.
- Consolidated fallback route error handling in `followNpc()` for both melee and ranged/magic attack paths.
* `Player.java`:
- Prevented walking directly inside an NPC's collision tile during combat and interaction approach in `getNextWalkingDirection()`.
### Combat Collision & Line of Sight
* `CombatAssistant.java`:
- Added `Region.canReachNpcMelee` verification in both `attackingNpcTick()` and `attackNpc()` to prevent hitting NPCs through walls or fences.
- Added projectile path clearance verification (`PathFinder.isProjectilePathClear`) for ranged weapons, bows, magic spells, and halberds.
- Cleared attack and follow state cleanly when a target cannot be reached without freezing character movement.
### Doors & Gates Mechanics
* `GateHandler.java` & `DoubleGates.java`:
- Replaced raw gate IDs with `StaticObjectList` constants (`GATE_1551`, `GATE_1552`, `GATE_7049`, `GATE_7050`, `GATE_7051`, `GATE_7052`, etc.).
- Added `getOpenGateId`, `getClosedGateId`, and `isOpenGate` to support toggling open gates shut on interaction.
- Consolidated `openDoubleGate` to delegate directly to `openSpecialGate`, eliminating redundant gate despawn/respawn code.
- Added `SoundList.OPEN_GATE` audio triggers on gate interaction.
* `Doors.java` & `DoubleDoors.java`:
- Added `canReachDoor(player, id, x, y, z)` proximity checking for both single and double doors, allowing players to reach doors by checking both current and original coordinates within distance 1.
- Removed unused `isDoor` dead helper methods.
### Cleanups & Deprecations
* `Woodcutting.java`:
- Removed custom coordinate check hack `p.absX == 2717 && p.absY == 3461` ("You can't cut the tree from here!"), now natively handled by authentic object collision bounds.
- Removed redundant movement stopping inside `startWoodcutting`, now handled uniformly at the packet level in `ClickObject.java`.
* `BorderGuardFirstClick.kt`:
- Removed plugin-specific coordinate gate check (`absX <= 3267`) and redundant `facePlayer` calls, relying on global collision flags and `ClickNPC.java` pathfinding.
* feat(client): implement android modern resizable viewport support and platform gating
Add dynamic viewport sizing and modern resizable display mode hooks to the shared 317 client while strictly isolating all mobile changes behind platform checks. All additions are gated behind ClientSettings.ANDROID and ClientSettings.RESIZABLE flags so that desktop client rendering, coordinates, and fixed 512x334 gameplay remain 100% authentic and unaffected. This enables Android Mobile to render an edge-to-edge 3D world with floating HUD panels while guaranteeing complete regression-free desktop parity.
### System Architecture
- Game.java:
- Introduce updateViewportSize(int width, int height) synchronized method to dynamically resize the aRSImageProducer_1165 viewport buffer, recalculate texture scanline offsets, and invoke WorldController.method310 with custom dimensions.
- Enforce explicit ClientSettings.ANDROID platform guards across all viewport-dimension checks to ensure desktop builds unconditionally retain fixed 512x334 behavior.
### Display & Viewport Handling
- WorldController.java:
- Adjust vertical camera offset (anInt494) in portrait mobile mode to (int) (l * 0.38f) when ClientSettings.ANDROID && ClientSettings.RESIZABLE && k < l, ensuring the player character remains centered above bottom UI sheets, falling back to authentic l / 2 on desktop and landscape.
- Game.java:
- Gate action tooltip coordinates behind ClientSettings.ANDROID: modern mobile displays render at (16, 28) in portrait or (72, 28) in landscape, while desktop preserves the original 317 baseline at (4, 15).
- Gate debug and XP overlay positions behind platform checks, preventing mobile offsets from shifting desktop stats.
- Retain desktop frame border drawing (drawFixedFrameBorders()) unconditionally whenever needDrawFrameBorders is raised.
### Input & Click Hit-Testing
- Game.java:
- Update touch target validation in processChatModeClick(), processMinimapActions(), and processTabClick() to verify ClientSettings.ANDROID && (ClientSettings.RESIZABLE || ClientSettings.VIEWPORT_WIDTH > 512).
- Preserve standard 317 desktop tab boundary hit-testing (saveClickX >= 539 && saveClickX <= 573, etc.) when !ClientSettings.ANDROID.
- Update custom settings tab and scrollbar hit-testing to respect target touch areas without altering desktop mouse interactions.
* refactor(server): clean up redundant interaction checks, consolidate packet logic, and harden packet boundaries
Consolidates redundant distance checks and interaction logic made obsolete by cache-driven Revision 377 collision and reachability systems across the server. Enforces strict array bounds and packet validation on item, object, player, and magic interaction packets to prevent remote exploitation and index out-of-bounds exceptions. Eliminates memory leaks, duplicate iterations, and legacy PI distance hacks while preserving 2006 RS2 gameplay authenticity.
### Core & Packet Infrastructure
* `AttackPlayer.java`:
- Added strict array index boundary checks (`player.playerIndex < 0 || player.playerIndex >= PlayerHandler.players.length || PlayerHandler.players[player.playerIndex] == null`) for both `ATTACK_PLAYER` and `MAGE_PLAYER` packets.
- Replaced dead/impossible non-crystal bow condition (`playerEquipment < 4212 && playerEquipment > 4223`) with `!RangeData.usingCrystalBow(player)` to correctly trigger the out-of-arrows message in PvP.
* `ClickNPC.java`:
- Added array index and null validation on `player.npcIndex` in `ATTACK_NPC` and `MAGE_NPC` packet processing.
- Removed duplicate `NpcHandler.npcs[player.npcIndex] == null` check in `ATTACK_NPC`.
- Replaced dead condition (`< 4212 && > 4223`) with `!RangeData.usingCrystalBow(player)` in PvN combat.
* `FollowPlayer.java`:
- Added index boundary validation on target `followPlayer` ID before array indexing.
* `Walking.java`:
- Removed 47 lines of legacy commented-out walking packet code to keep the packet pipeline clean.
### Reachability & Interaction Handlers
* `ItemOnObject.java`:
- Migrated from crude Manhattan distance (`goodDistance(..., 3)`) to `ClickObject.isObjectReached(...)`, validating object boundaries, facing direction, wall clipping, and cache `walkToMask`.
- Preserved explicit 5-tile radius for Ectofuntus interactions while halting unreachable attempts with "I can't reach that.".
* `ItemOnPlayer.java`:
- Added authentic 1-tile reachability distance check (`!player.goodDistance(..., 1)`) with "I can't reach that." before Christmas cracker interactions.
- Added array boundary validation for `playerId` and inventory `slot`.
- Replaced magic number `962` with `StaticItemList.CHRISTMAS_CRACKER`.
* `ItemOnGroundItem.java`:
- Added authentic 1-tile reachability check (`!player.goodDistance(..., 1)`) with "I can't reach that." before firemaking ground logs, preventing remote fire lighting.
- Replaced magic numbers `590`, `7329`, `7330`, and `7331` with `StaticItemList` constants (`TINDERBOX`, `RED_FIRELIGHTER`, `GREEN_FIRELIGHTER`, `BLUE_FIRELIGHTER`).
* `ItemClick2OnGroundItem.java`:
- Removed debugging `System.out.println(...)` output.
- Replaced magic number `590` with `StaticItemList.TINDERBOX`.
* `ItemOnItem.java`:
- Added boundary validation on `usedWithSlot` and `itemUsedSlot` before indexing `player.playerItems`.
* `MagicOnObject.java`:
- Added `player.endCurrentTask()` to properly cancel active player walking/skilling events.
- Added `Region.objectExists` check and a 4-tile reachability check (`!player.goodDistance(..., 4)`) with "I can't reach that.", preventing remote orb charging.
- Replaced raw magic numbers `2150..2153` with `StaticObjectList` constants (`OBELISK_OF_EARTH`, `OBELISK_OF_WATER`, `OBELISK_OF_AIR`, `OBELISK_OF_FIRE`).
* `MagicOnFloorItems.java`:
- Removed redundant second `player.stopMovement()` call inside telegrab packet handling.
### Door & World Object Mechanics
* `ChangeRegions.java`:
- Removed redundant and harmful `Doors.getSingleton().load();` call on region loading (packet 121), which repeatedly re-read `doors.json` from disk and duplicated door instances in memory.
* `Doors.java` & `DoubleDoors.java`:
- Replaced raw distance calculations in `Doors.handleDoor` with `canReachDoor(player, id, x, y, z)`.
- Added `canReachDoor` check to `DoubleDoors.handleDoor` before processing double door state changes.
* `ClickObject.java`:
- Removed obsolete `> 25` tile check in `completeObjectClick` (already guaranteed reachable by `onObjectReached`).
- Removed redundant `stopMovement()` and `resetWalkingQueue()` calls in `case 9472` (already performed upon reach).
- Replaced raw target ID `2513` with `StaticObjectList.TARGET_2513`.
* `AlKharidGateFirstClick.kt`:
- Removed redundant `if (!isNearGate(player))` check, as `ClickObject.isObjectReached` already enforces gate reachability prior to event dispatch.
### Bug Fixes & Edge Cases
* `NpcActions.java`:
- Removed erroneous `player.turnPlayerTo(player.objectX, player.objectY)` in `case 8689` (dairy cow milking), which incorrectly rotated the player to face coordinates `(0, 0)` due to uninitialized object coordinates in NPC packets.
* `ObjectsActions.java`:
- Removed duplicate `player.turnPlayerTo(player.objectX, player.objectY)` calls in lines 1413, 1417, and 1887, already handled uniformly at the start of `ClickObject.completeObjectClick`.
* `DropItem.java` & `PickupItem.java`:
- Consolidated duplicate consecutive loops over `LogData.values()` into a single loop with an early `break;`.
- Removed redundant duplicate `resetPlayerAttack()` call in `PickupItem.java`.
### Cleanups & Deprecations
* `Woodcutting.java`:
- Removed legacy PI distance check `if (Misc.goodDistance(p.objectX, p.objectY, p.absX, p.absY, 3))` in `startWoodcutting`, now handled by authentic 377 collision bounds in `ClickObject.java`.
- Removed redundant duplicate `if (p.isWoodcutting)` guard inside `startWoodcutting`.
* `Fishing.java` & `SilverCrafting.java`:
- Removed redundant chained `.toLowerCase().toLowerCase()` invocations in chat and message strings.
* feat(client): add android platform hooks and 117hd pipeline bridge behind ClientSettings.ANDROID
Integrates dynamic viewport sizing and pure-Java 117HD GPU pipeline bridge hooks into the shared 317 client codebase while strictly isolating all mobile features behind ClientSettings.ANDROID. Ensures 100% authentic fixed 512x334 Revision 377 desktop gameplay without file duplication between desktop and mobile repositories.
### Core / System Architecture
- `HD117Pipeline.java`:
- Introduced pure-Java GPU bridge interface (`HdRendererBackend`) strictly gated by `ClientSettings.ANDROID && ClientSettings.HD_117`.
- Defined callback lifecycle signatures for scene upload, per-frame camera matrix uniform updates, simple/shaped tile dispatch, and model rendering.
- `Game.java`:
- Added synchronized `updateViewportSize(int width, int height)` and `setHD117Enabled(boolean enabled)` guarded by `ClientSettings.ANDROID`.
- Gated mobile touch target areas (`TARGET_VIEWPORT`, `TARGET_MINIMAP`, `TARGET_TAB`) and responsive action tooltips behind `ClientSettings.ANDROID`.
- `ClientSettings.java`:
- Added `RESIZABLE` and `HD_117` flags (`false` by default on desktop) and made RSA modulus/exponent mutable for mobile world switching.
### Display & Viewport Handling
- `WorldController.java`:
- Gated portrait mobile camera vertical offset `(int) (l * 0.38f)` behind `ClientSettings.ANDROID && ClientSettings.RESIZABLE && k < l`, defaulting to authentic `l / 2` on desktop.
- Implemented concentric ring tile traversal `r = 0..drawDistance` and 3D frustum culling (`isHdTileInFrustum`) gated behind `ClientSettings.ANDROID && ClientSettings.HD_117 && HD117Pipeline.isGpuActive()`.
- `Model.java`:
- Gated near-plane clipping threshold `(ClientSettings.ANDROID ? 20 : 50)` so desktop retains authentic 50-unit threshold.
- Preserved vertex normals and model GPU dispatch strictly when `ClientSettings.ANDROID` is active.
- `Class40.java` & `Class43.java`:
- Gated overlay face and tile tracking strictly behind `ClientSettings.ANDROID`.
### Bug Fixes & Edge Cases
- `ObjectManager.java`:
- Gated upper-floor ground tile roof checking (`!hideRoofs && !lowMem`) behind `ClientSettings.ANDROID`, ensuring Lumbridge Castle gatehouse upper floors render properly on mobile while preserving authentic desktop `hideBuggyVarrockSwordShopSnow`.
### Submodule Updates
- `2006Scape-Android`:
- Updated submodule pointer to commit `8b74a318` containing v3.32 launcher UI polish and 117HD OpenGL ES 3.0 renderer.
* chore(mobile): update 2006Scape-Android submodule to v3.33 authentic rs2 launcher ui
Updates the 2006Scape-Android mobile submodule to commit 11e754e2. Integrates authentic 2006 RS2 beveled stone boxes, crimson-and-gold login buttons, and custom stone checkmark widgets.
### Submodule Updates
- `2006Scape-Android`:
- Updated submodule pointer to commit `11e754e2` containing v3.33 authentic 2006 RS2 launcher redesign.
* feat(mobile): update android submodule to v3.34 with live world indicators and stone dividers
Updates the Android mobile client submodule to release v3.34. Introduces real-time server socket reachability indicators on world selector buttons and classic 2006 RS2 etched stone bevel dividers framing launcher panels without modifying server or desktop client logic.
### UI & Visual Improvements
- `2006Scape-Android`:
- Added live socket connectivity pings to World 1 (port 43594) and World 2 (port 43598).
- Integrated authentic etched stone bevel dividers (`divider_rs_stone.xml`) under the header and across configuration sections.
- Formatted Display Mode selectors with two-line layout descriptions (`Fixed 4:3` and `Resizable`).
- Bumped release version to v3.34 (versionCode 94).
* feat(mobile): update android submodule to v3.35 with classic touch ribbon toggle
Updates the Android mobile submodule to release v3.35. Adds a user setting in the client launcher to enable or disable onscreen touch ribbons when running in Classic (Fixed 4:3) display mode.
### Migrated Features
- `2006Scape-Android`:
- Added `Classic Mode Touch Ribbons` launcher toggle under Client Features.
- Wired preference persistence and intent propagation into `GameSurfaceView`.
- Bumped release build to v3.35 (versionCode 95).
* feat(mobile): update android submodule to v3.36 with classic portrait console and landscape lock
Updates the Android mobile submodule to release v3.36. Integrates portrait bottom console layout for Classic (Fixed 4:3) mode and a launcher toggle to lock landscape orientation.
### UI & Visual Improvements
- `2006Scape-Android`:
- Added dedicated two-row bottom thumb console for portrait orientation in Classic mode.
- Added `Lock Landscape in Classic` startup preference toggle.
- Clamped ribbon text width and added landscape safety bounds checks.
- Bumped release build to v3.36 (versionCode 96).
* feat(mobile): update android submodule to v3.37 with portrait launcher support
Updates the Android mobile submodule to release v3.37. Adds full portrait orientation support to the client launcher with a dedicated stacked panel layout and bottom-anchored Play button.
### UI & Visual Improvements
- `2006Scape-Android`:
- Created `res/layout-port/activity_launcher.xml` for portrait orientation.
- Enabled dynamic orientation handling in `LauncherActivity.java` with instant status cache preservation.
- Bumped release build to v3.37 (versionCode 97).
* fix(mobile): update android submodule to v3.38 with centered classic portrait canvas
Updates the Android mobile submodule to release v3.38. Restores exact vertical centering for the 4:3 game canvas in Classic mode across all screen orientations.
### UI & Visual Improvements
- `2006Scape-Android`:
- Centered the 4:3 game canvas vertically in portrait mode.
- Positioned the portrait touch console inside the lower letterbox region below the centered view.
- Bumped release build to v3.38 (versionCode 98).
* feat(mobile): update android submodule to v3.39 with authentic cache sprite ribbons
Updates the Android mobile submodule to release v3.39. Introduces authentic Revision 377 game cache sprite rendering for mobile touch ribbons, accompanied by 3D beveled stone button tiles, RS Red-Stone active tab fills, live rotating compass needle, and glowing runic gems.
### UI & Visual Formatting
- `2006Scape-Android`:
- Converted Revision 377 `sideIcons` and `compass` sprite into ARGB Android Bitmaps with nearest-neighbor crisp filtering.
- Implemented 3D beveled stone tiles with directional chisel lighting (top/left highlight, bottom/right shadow).
- Added authentic RS Red-Stone active tab fills (`#731818`) with glowing gold borders (`#FFD700`).
- Added dynamic real-time compass yaw rotation on the NORTH button tracking `game.minimapInt1`.
- Added RuneScape Gold (`#FF981F`) and Yellow (`#FFFF00`) typography with authentic 1px solid black drop-shadows.
- Added 3D glowing runic gems for utility controls (`DROP` emerald green, `117 HD` cyan).
- Added medieval stone backing pillars in landscape and unified console deck in portrait.
- Bumped release build to v3.39 (versionCode 99).
* fix(mobile): update android submodule to v3.40 with masked circular compass
Updates the Android mobile submodule to release v3.40. Masks out the raw Revision 377 red square boundary surrounding the circular compass sprite for clean presentation on the ribbon stone tile.
### UI & Visual Formatting
- `2006Scape-Android`:
- Clipped raw `compass` sprite to its circular diameter (`dx^2 + dy^2 <= r^2`).
- Chroma-keyed the red border pixels to 100% transparency.
- Bumped release build to v3.40 (versionCode 100).
* fix(mobile): update android submodule to v3.41 with enlarged tightly cropped compass
Updates the Android mobile submodule to release v3.41. Tightly crops the circular compass rose and scales it up to 35dp to match the prominent size of the other tab sprites.
### UI & Visual Formatting
- `2006Scape-Android`:
- Cropped non-transparent compass bounds tightly, removing outer dead space.
- Centered the cropped circular compass rose inside an exact square bitmap.
- Omitted sublabel on the NORTH button and raised icon size to 35dp.
- Bumped release build to v3.41 (versionCode 101).
* feat(mobile): update android submodule to v3.42 with 1:1 authentic tab order ribbons
Updates the Android mobile submodule to release v3.42. Reorders the touch ribbons so that the left ribbon (and portrait row 1) directly mirrors the game's top-row tabs (0..6), and the right ribbon (portrait row 2) mirrors the bottom-row tabs (7..13).
### UI & Visual Formatting
- `2006Scape-Android`:
- Reordered left buttons to: NORTH, Combat (0), Stats (1), Quests (2), Inventory (3), Equip (4), Prayer (5), Magic (6), DROP.
- Reordered right buttons to: CHAT, QoL (7), Friends (8), Ignore (9), Logout (10), Options (11), Music (13), 117 HD, 60 FPS.
- Bumped release build to v3.42 (versionCode 102).
* fix(renderer): dynamic camera traversal bounds and GPU clipping for 117 HD terrain
Resolve missing terrain tiles during camera rotation and zoom in 117 HD mode by dynamically expanding the traversal radius around the player and delegating frustum culling to GPU hardware. Preserves Revision 377 client compatibility while preventing camera orbit clipping across region boundaries.
### Core Architecture
- `WorldController.java`:
- Calculate `effectiveDrawDist` dynamically using `Math.min(60, drawDistance + (hdCamDistToPlayer >> 7) + 12)` for Android HD mode.
- Expand loop bounds `anInt449..anInt450` and `anInt451..anInt452` to prevent camera orbit culling at map borders.
- Remove inaccurate 2D CPU screen-space frustum bounds checking in favor of exact hardware OpenGL ES 3.0 clipping.
- Retain safe camera-depth rejection (`cz < -1280`) to protect shadow casters and multi-tile structures behind the camera.
* feat(renderer): extended software draw distance, synchronized model culling, and QoL zoom gating
Synchronize 3D model culling with active terrain boundaries to prevent entities from floating over the black void, dynamically extend software draw distance during camera orbit zoom, and gate zoom controls in classic display mode behind the QoL client argument. Maintains exact Revision 377 parity while improving visual consistency on mobile widescreen viewports.
### Core Architecture
- `WorldController.java`:
- Calculate `effectiveDrawDist` dynamically up to 38 tiles in software mode on Android based on camera-to-player orbit distance (`hdCamDistToPlayer`).
- Update rasterizer `loopDist` to use `effectiveDrawDist` in software passes so ground tiles fully cover the playfield when zoomed out.
- Expose `effectiveDrawDist` as a public static field for entity and model distance synchronization.
- `Model.java`:
- In software mode on Android, clamp model draw distance strictly to `effectiveDrawDist * 128 + 128` to guarantee models are never rendered over unrendered ground voids.
- In 117 HD mode, scale model distance to match dynamic fog horizon (`4800+` units).
- Preserve desktop Revision 377 culling formula (`drawDistance * 256`) when not running on Android.
- `Game.java`:
- Update `hdCamDistToPlayer` across all Android display modes regardless of whether 117 HD is toggled on or off.
- Restrict `adjustZoom` and `handleMouseWheel` in fixed classic display mode (`!RESIZABLE`) so camera zoom is locked to 0 unless `CUSTOM_SETTINGS_TAB` (QoL) is enabled.
* feat(client): add -resizable modern desktop layout with shared ModernLayout engine and floating stone HUD overlays
Implement a native resizable modern window mode for the desktop client activated via the `-resizable` (or `-resize`) launch argument while preserving 100% shared source parity with the Android client. Consolidates layout geometry, elliptical/rounded-corner hit-testing, and coordinate translation into a pure-Java `ModernLayout` class, and renders zero-flicker double-buffered floating Revision 377 stone HUD widgets (circular lizard minimap, stone-framed chatbox, and symmetrical 4-way masked rounded stone tab block).
### Core / System Architecture
- `ModernLayout.java`:
- Implemented platform-neutral layout engine with zero `java.awt` or `android.*` imports for automatic sharing with the Android `syncSharedSources` build pipeline.
- Added `hit(int x, int y)` routing cursor and click coordinates to `TARGET_MINIMAP`, `TARGET_TAB`, `TARGET_CHAT`, `TARGET_VIEWPORT`, or `TARGET_DEFAULT` when `!inGame`.
- Implemented `isInsideMinimap(int localX, int localY)` using circular compass bounds ($r = 16$ at $(16, 16)$) and elliptical map bounds ($R_x = 76, R_y = 78$ at $(132, 84)$) so clicks in transparent air fall through to `TARGET_VIEWPORT`.
- Implemented `isInsideTabArea(int localX, int localY)` with a 4-way symmetrical corner inset profile (`TAB_CORNER_DX`) matching the sculpted Revision 377 corner stone contour ($234 \times 335$ active ring inside the $249 \times 343$ region).
- Added `toGameCoords(int area, int x, int y)` and `toWindow(int fixedX, int fixedY, int width, int height)` for bidirectional mapping between dynamic window dimensions and classic $765 \times 503$ coordinates.
- `ClientSettings.java`:
- Added `isModernLayout()`, `isDesktopModern()`, `usesTouchTargets()`, and `usesClassicTabHitboxes()` predicates to unify desktop resizable and Android modern layout conditionals.
- `ClientArgs.java`:
- Added `-resizable` and `-resize` launch arguments enabling `ClientSettings.RESIZABLE = true` and automatically hiding the top browser navigation bar (`ClientSettings.SHOW_NAVBAR = false`).
### UI & Visual Formatting
- `DesktopHooks.java` & `AndroidHooks.java`:
- Added offscreen double buffering (`getRenderGraphics` and `flip`) backed by a window-sized `BufferedImage` so 3D viewport rendering and floating HUD overlays composite atomically without 50 Hz screen flickering.
- Implemented `drawModernMinimap` compositing the live $172 \times 156$ minimap producer (`1164`) masked via `AlphaComposite.DstIn` against `hud_minimap_hole.png` and overlaid with `hud_minimap_bezel.png` at $(w - 249, 0)$.
- Implemented `drawModernChat` compositing `hud_chat_frame.png` ($519 \times 165$) with chat parchment (`1166`, $479 \times 96$) at $(17, 19)$ and chat buttons (`1123`, $496 \times 50$) at $(0, 115)$, docked at $(0, h - 165)$.
- Implemented `drawModernTab` stitching the 3-part left vertical stone pillar (`backVmidIP2` $37 \times 133$, `backVmidIP2_2` $553 \times 19$ rightmost $37\text{px}$, and `backVmidIP3` $57 \times 109$ rightmost $37\text{px}$) alongside top tabs (`1125`), tab body (`1163`), right pillar (`backRightIP2`), and left-cropped bottom tabs (`1124` at offset $20\text{px}$), masked to 100% transparency outside the rounded stone contour.
- `hud_chat_frame.png`, `hud_minimap_bezel.png`, & `hud_minimap_hole.png`:
- Added authentic floating stone HUD bezel and alpha mask resources to `2006Scape Client/src/main/resources/`.
### Bug Fixes & Edge Cases
- `Game.java`:
- Added `applyWindowSize(int w, int h)` and `drawModernDesktopOverlays()` to dynamically resize the 3D software rasterizer and `WorldController` frustum while docking floating HUD overlays.
- Tracked `ModernLayout.inGame` across `drawLoginScreen()`, `drawGameScreen()`, and `resetLogout()` so the 9-tile login screen and fullscreen interfaces center cleanly with black letterboxing.
- Fixed `processLoginScreenInput()` to evaluate button hitboxes against the $765 \times 503$ reference frame rather than dynamic window dimensions.
- `RSFrame.java`, `RSApplet.java`, & `RSImageProducer.java`:
- Enabled window resizing and maximize controls when `ClientSettings.RESIZABLE` is active, enforcing a minimum frame size of $765 \times 503$ plus window insets.
- Queued `ComponentListener` resize events safely onto the game thread via `pendingResize` and mapped mouse press, move, drag, and wheel events through `ModernLayout`.
* feat(client): add aspect-ratio-scaled login and loading screens with flicker-free resize rendering
Scale and center the classic 765x503 Revision 377 login screen and startup loading progress bars across resizable desktop window dimensions to match the Android client's welcomeScale architecture. Consolidates background tile assembly and offscreen bilinear scaling into a thread-synchronized composite buffer, eliminating multi-threaded race conditions between game rendering and flame animations while preserving aspect-ratio-locked button hitboxes. Implements flicker-free live window resizing by handling AWT paint cycles immediately and suppressing front-buffer background erasures.
### System Architecture
- `ModernLayout.java`:
- Added `getScaledScreenBounds(int w, int h)` computing aspect-ratio-preserved scaled dimensions and centering offsets `[originX, originY, scaledW, scaledH]`.
- Updated `toGameCoords` and `toWindow` when `!inGame` to bidirectionally project cursor inputs and full-screen coordinates between scaled window dimensions and the classic 765x503 reference coordinate space.
- `DesktopHooks.java`:
- Added `updateLoginTile()` and `redrawScaledLoginScreen()` synchronized under a dedicated `loginLock` mutex to serialize buffer updates across the main game loop, flame worker thread, and AWT Event Dispatch Thread.
- Implemented smooth bilinear interpolation (`KEY_INTERPOLATION` / `VALUE_INTERPOLATION_BILINEAR`) scaling from `loginScreenBuffer` to dynamic window bounds with clean black letterbox/pillarbox margins.
- Decoupled tile `1110` (left torch) from triggering intermediate screen blits so both torch flames composite atomically and flip on tile `1111` (right torch).
- Implemented `checkResize(Component comp)` to synchronously synchronize window dimensions during early startup.
### UI & Visual Formatting
- `Game.java`:
- In `drawLogo()`, atomically populates all 9 background tiles (`1107` through `1115`) into `loginScreenBuffer` as soon as `title.dat` and `logo` are decoded, guaranteeing complete stone archway, pillars, and logo coverage during all loading stages.
- In `drawLoadingText()`, polls window resizing via `DesktopHooks.checkResize()` on each loading step so progress bars ("Unpacking config", "Unpacking textures", etc.) remain centered and scaled to window height on top of the background.
- `RSApplet.java`:
- Enabled `sun.awt.noerasebackground` on client frame creation and suppressed live `graphics.fillRect(0, 0, w, h)` clears in `handleResize()` when modern desktop mode is active to prevent front-buffer black flashes.
- Routed `paint(Graphics g)` and `update(Graphics g)` during `!inGame` directly into `DesktopHooks.redrawScaledLoginScreen(g)`, repainting the scaled buffer immediately on every AWT expose event without waiting for background game loop ticks.
- In `componentResized(ComponentEvent e)`, updates `ModernLayout` bounds and triggers immediate offscreen repaint during interactive window dragging.
- `RSImageProducer.java`:
- Intercepts 765x503 drawing area blits during `!inGame` to route pixel updates directly into `DesktopHooks.drawScaledLoginTile()`.
* feat(client): migrate shared 117 HD core and add desktop OpenGL renderer with -hd flag and ::hd command
Unify the 117 HD / RLHD 3D rendering pipeline across desktop and Android by migrating `HdMaterial`, `HdGroundMaterial`, `HdProceduralGenerator`, `HdSceneUploader`, and GLSL shader definitions into the shared `2006Scape Client` source tree. Introduces `DesktopHd117Renderer` backed by JNA OpenGL (EGL/GLES 3.0+ on Linux and WGL/OpenGL 3.3 on Windows), disabled by default and toggleable via the `-hd` launch argument or the `::hd` in-game client command while preserving full Java 8 `java.nio.Buffer` bytecode compatibility.
### Core / System Architecture
- `HD117Pipeline.java`:
- Removed `ClientSettings.ANDROID` platform restrictions from `isGpuActive()`, `onSceneLoad()`, `beginFrame()`, `endFrame()`, and `onToggle()` so the 117 HD pipeline operates identically across Desktop and Android.
- Consolidated the shared GLSL shader sources (`SHADOW_VERT`, `SHADOW_FRAG`, `SCENE_VERT`, `SCENE_FRAG`, `POST_VERT`, `POST_FRAG`), `adaptGlslForDesktop330()`, and pure-Java 4x4 matrix functions (`setLookAtM`, `orthoM`, `multiplyMM`).
- `DesktopHd117Renderer.java` & `pom.xml`:
- Added `net.java.dev.jna:jna:4.4.0` dependency and implemented `HD117Pipeline.HdRendererBackend` for desktop platforms.
- Implemented cross-platform offscreen OpenGL context initialization using JNA (`libEGL.so.1` + `libGLESv2.so.2` with `EGL_PLATFORM_SURFACELESS_MESA` fallback on Linux, and `opengl32.dll` / `gdi32.dll` / `user32.dll` WGL OpenGL 3.3 context creation on Windows).
- Executed the 3-pass 117 HD pipeline: Pass 1 ($2048 \times 2048$ directional sun shadow depth FBO), Pass 2 (3-vertex height-splatted terrain, Sobel normal mapping, 9-tap PCF soft shadows, Fresnel water waves, 16 dynamic point lights, and distance fog), and Pass 3 (5-tap highlight bloom, S-curve tonemapping, and zero-copy BGRA readout into `DrawingArea.pixels`).
- `DesktopHooks.java`:
- Added `initHdBackend()` to lazily instantiate and register `DesktopHd117Renderer` onto `HD117Pipeline.backend`.
### Migrated 117 HD Shared Modules
- `HdMaterial.java` & `HdGroundMaterial.java`:
- Migrated material layer definitions (`0..49` enhanced RS2 cache textures and `50..63` procedural 117 HD PBR materials) and the 64-layer $128 \times 128$ RGBA8 diffuse + heightfield and Sobel tangent-space normal-map generator (`populateTextureBuffers`) into shared client sources.
- Added deterministic spatial vertex hashing (`getMaterialForVertex`) and 317 floor/HSL classification (`resolve`).
- `HdProceduralGenerator.java`:
- Migrated smooth $105 \times 105$ terrain normal calculation, per-tile underlay/overlay resolution, corner splatting, and dynamic point light extraction from world objects.
- Added `tileIsIndoor` detection from the RS2 map roof flag (`(byteGroundArray[plane][x][z] & 4) != 0`) and adjacent doorway thresholds.
- `HdSceneUploader.java`:
- Migrated 64-byte cache-aligned vertex staging for `Class43` simple tiles, `Class40` shaped tiles, and 3D `Model` geometry with exact $(P, M, N)$ texture triangle UV projection.
### New Commands & Launch Arguments
- `ClientArgs.java`:
- Added `-hd` and `-117hd` launch flags enabling `ClientSettings.HD_117 = true` at startup (disabled by default).
- `Game.java`:
- Added the `::hd` (and `::117hd`) in-game client command available to all players, toggling `setHD117Enabled(!ClientSettings.HD_117)` and printing `"117 HD is now: enabled"` or `"117 HD is now: disabled"` in the chatbox.
- Updated `setHD117Enabled(boolean)` and the 3D viewport render pass (`method146`) to support runtime toggling on both Desktop and Android.
### Bug Fixes & Edge Cases
- `HdSceneUploader.java` & `HD117Pipeline.java`:
- Fixed coplanar stacked polygon Z-fighting on multi-layer models (such as the Varrock Castle blue rug's gold border and white stars, red dining room rug lion crests, and wall shields) by encoding a strictly monotonic per-face priority (`anIntArray1638`) and face-order (`f / faceCount`) fraction into `aMatAndBary.w` and applying a zoom-invariant clip-space depth offset in `SCENE_VERT`.
- Fixed pillow/cylinder shading distortion on flat horizontal floor models (`vyA == vyB && vyB == vyC`) by assigning pure vertical geometric normals $(0, -1, 0)$ instead of corner normals averaged with vertical perimeter skirts.
- Fixed indoor castle checkered flooring by assigning roofed interior tiles (`tileIsIndoor`) a uniform, smooth honed architectural stone material (`HD_STONE_PAVERS_2`) without outdoor Voronoi cobblestone bumps or cross-corner dirt splatting, and made `HD_DIRT_1..2` hue-neutral.
- Replaced GLSL reserved keyword `packed` with `packedVal` in `SCENE_VERT` and cast all `Buffer.position(int)` calls to `((Buffer) ...).position(...)` to prevent `NoSuchMethodError` on Java 8 runtimes.
- `Model.java`, `Class40.java`, & `WorldController.java`:
- Preserved `hdVertexNormals`, `anIntArray1640`, and `isOverlayFace` during scene loading regardless of initial HD state so toggling `::hd` mid-session renders smooth normals and overlay seams without reloading the map region.
* feat(client): add automatic fixed and modern gameframe switching at original 765x503 size in resizable mode
Decouples desktop window resizability from active modern floating HUD mode so that a `-resizable` client automatically renders the authentic 765x503 classic fixed gameframe (with a 512x334 3D viewport and stone border producers) whenever sized at 765x503, and transitions to the full-window modern floating HUD gameframe whenever expanded beyond 765x503. Preserves full Revision 377 coordinate translation, login screen tile caching, and Android client parity.
### Layout Mode & Coordinate Infrastructure
- `ClientSettings.java`:
- Updated `isDesktopModern()` to evaluate `!ANDROID && RESIZABLE && (ModernLayout.windowWidth > 765 || ModernLayout.windowHeight > 503)`, distinguishing window resizability (`RESIZABLE`) from the active modern HUD layout.
- Updated `isModernLayout()` to delegate to `isDesktopModern()` on desktop while preserving `RESIZABLE || VIEWPORT_WIDTH > 512` on Android.
- Updated `usesTouchTargets()` to return `ANDROID || isDesktopModern()` so hit-area target routing is disabled when the desktop window is at the classic 765x503 dimensions.
- `ModernLayout.java`:
- Updated `hit(int x, int y)`, `toGameCoords(int area, int x, int y)`, and `toWindow(int fixedX, int fixedY, int width, int height)` guards from `!ClientSettings.RESIZABLE` to `!ClientSettings.isModernLayout()` so fixed-mode coordinates pass through untranslated at 765x503.
### Dynamic Viewport & Gameframe Switching
- `Game.java`:
- Updated `applyWindowSize(int w, int h)` to dynamically select a `512x334` 3D viewport when `ClientSettings.isDesktopModern()` is false and a full-window `w x h` 3D viewport when `ClientSettings.isDesktopModern()` is true.
- Set `needDrawFrameBorders = !ClientSettings.isDesktopModern()` and `welcomeScreenRaised = true` on resize so returning to 765x503 immediately redraws all 9 classic stone border image producers (`backLeftIP1..backVmidIP2_2`) and fixed UI panels.
- Kept `updateViewportSize(int width, int height)`, `drawLogo()`, and `drawLoadingText()` gated on `!ClientSettings.ANDROID && ClientSettings.RESIZABLE` so viewport resizing and login tile caching remain active across all window sizes.
- `DesktopHooks.java`:
- Updated `checkResize(Component comp)` to run whenever `ClientSettings.RESIZABLE` is enabled on desktop and compute `VIEWPORT_WIDTH` / `VIEWPORT_HEIGHT` as `512x334` at `765x503` or `w x h` when larger.
### AWT Event & Image Producer Routing
- `RSApplet.java`:
- Registered the AWT `ComponentListener` and routed `createClientFrame`, `paint`, `handleResize`, `componentResized`, and `drawLoadingText` whenever `!ClientSettings.ANDROID && ClientSettings.RESIZABLE` is active.
- Reset `touchTargetArea = 0` in the `else` branches of `mousePressed`, `mouseDragged`, and `mouseMoved` when `ClientSettings.isDesktopModern()` transitions to false so stale modern HUD hit targets never leak into classic fixed mode.
- `RSImageProducer.java`:
- Updated `drawGraphics(int i, Graphics g, int k)` to cache login screen tiles via `DesktopHooks.updateLoginTile(...)` whenever `ClientSettings.RESIZABLE && !ClientSettings.ANDROID && !ModernLayout.inGame` is true, while only intercepting with scaled offscreen rendering and `ModernLayout.toWindow(...)` offsets when `ClientSettings.isDesktopModern()` is active.
* fix(combat): resolve autocast interface selection, weapon style sync, and pathfinding clipping
This commit addresses interface synchronization, autocasting state persistence, and authentic 2006 RS2 combat pathfinding and clipping across both player and NPC interactions. Interface 328 configuration bitmasks and style configs have been aligned with authentic Revision 377 cache behavior, ensuring single-style selection and proper style persistence across weapon swaps. Melee reach, projectile line-of-sight, and halberd distance mechanics have been corrected to strictly prevent attacks through solid masonry and low fences.
### Combat Infrastructure
- `Player.java`:
- Reclassified halberds (`isUsingHally()`) as melee combat under `isMeleeCombat()` while keeping `isUsingProjectileCombat()` strictly for actual ranged and magic attacks.
- Implemented centralized attack distance calculation supporting bows, darts, throwing knives, magic spells, halberds (distance 2), and standard melee (distance 1).
- Added authentic `assignAutocast()` handling with interface 328 restoration, spell name text updates on child 352, and bitmask tracking.
### Autocasting & Combat Style Synchronization
- `PlayerAssistant.java` & `ItemAssistant.java`:
- Enhanced `handleWeaponStyle()` to dynamically evaluate active autocasting versus physical staff attack modes (`0` Bash, `2` Focus-Block, `1` Pound).
- Wired `handleWeaponStyle()` into `ItemAssistant.sendWeapon()` to ensure equipped styles are immediately highlighted when swapping between swords, bows, and staves.
- Corrected autocast config 108 bitmask transmission: bit 0 controls active autocast red box (`1`), bit 1 controls spell name visibility (`2`), transmitting `3` when active, `2` when configured, and `0` when reset.
- `ClickingButtons.java`:
- Dispatched `sendConfig(43, -1)` on autocast selection (buttons 1093/1094 and spell selection) to clear melee style highlights on interface 328, preventing simultaneous dual red box highlights.
- Added interface cancel/close button handling for normal (1829/2004), ancient (1689/6161), and slayer staff (12050/12101) autocast menus.
### Pathfinding & Collision Clipping
- `Region.java`:
- Refactored `getClipping(int x, int y, int height, int moveTypeX, int moveTypeY)` to delegate directly to `canMove(x, y, height, dir)` via `Misc.directionFromDelta()`, eliminating start-tile coordinate checks and off-by-one errors on diagonal steps.
- Relaxed `canReachNpc()` distance-2 halberd checks to allow cardinal attacks across open space as well as projectile-penetrable low barriers (fences, railings, counters).
- `CombatAssistant.java`:
- Integrated `Region.canReachNpcMelee()` for 1-tile melee and `Region.canReachNpc()` for halberds in `attackingPlayerTick()` and `attackPlayer()`, preventing PvP attacks through fences, closed doors, and walls.
- Updated NPC melee reach checks in `attackingNpcTick()` and `attackNpc()` to support distance-2 reach when wielding halberds.
- Updated `getRequiredDistance()` to return `CombatConstants.HALBERD_ATTACK_DISTANCE` when using halberds.
- `NpcData.java` & `NpcCombat.java`:
- Updated `checkClip(Npc n)` so ranged and magic NPCs (`!melee`) verify `PathFinder.isProjectilePathClear(...)` before launching attacks.
- Added line-of-sight verification to `multiAttackDamage()` and `multiAttackGfx()` to prevent area spells and dragonfire from penetrating solid obstacles.
- `PlayerAssistant.java`:
- Enhanced `followPlayer()` so ranged and magic attackers halt upon entering attack distance with a clear projectile line of sight.
- Updated `getFollowLocation()` so candidate melee tiles evaluate line-of-sight and reach against obstacles.
- Updated `getFollowNpcLocation()` and `followNpc()` to allow valid 2-tile safe-spotting positions for halberd users.
- `NpcHandler.java`:
- Updated `followPlayer()` so pursuing NPCs do not freeze when separated by barriers; ranged/magic NPCs require clear projectile paths to halt, while melee NPCs require valid melee reach.
### Bug Fixes & Edge Cases
- `AttackPlayer.java` & `ClickNPC.java`:
- Unified follow distance initialization to use `player.getAttackDistance()`.
- Replaced raw projectile checks for halberds with `Region.canReachNpc()` to prevent diagonal distance-2 halberd attacks against NPCs.
- Handled frozen state attack resets when target cannot be reached behind obstacles.
### Cleanups & Deprecations
- `NpcHandler.java` & `NpcData.java`:
- Consolidated redundant attack distance checks and removed duplicate hardcoded switch branches.
- Deprecated legacy hardcoded distance conditionals in favor of unified `distanceRequired()` and `getAttackDistance()` lookups.
* feat(client): isolate modal openInterface into dedicated producer and expose dynamic bounds
This update decouples modal interfaces (Bank, Shop, Trade) from the main game scene rasterizer when running on mobile resizable layouts. By rasterizing modal interfaces into an independent off-screen buffer with transparent backgrounds, the client enables responsive floating positioning without viewport stretching or clipping. Exact interface dimensions are resolved dynamically through the interface cache to eliminate artificial padding and coordinate misalignments.
### Core Architecture & Producer Pipelines
- `src/main/java/Game.java`:
- Implemented dedicated off-screen `openInterfaceProducer` (12 \times 334$) and pre-allocated line offsets `openInterfaceOffsets` for Android resizable rendering.
- Initialized isolated drawing area before rasterizing `drawInterface()` and cleared pixels to zero (`DrawingArea.setAllPixelsToZero()`) to ensure transparent compositing over the 3D scene.
- Added `getOpenInterfaceWidth()` and `getOpenInterfaceHeight()` helper methods querying `RSInterface.interfaceCache` to report true interface boundaries (88 \times 314$ for bank interfaces).
- Normalized mouse input tracking and scrollbar hit-testing to top-left origin coordinates under mobile resizable configurations.
* fix(client): return canonical 512x334 bounds for modal viewport interfaces
Resolves an issue where query methods for open modal interface dimensions returned sub-container cache widths (e.g. 154x110) rather than the standard 512x334 viewport interface dimensions. In Revision 317, parent interface definitions in cache store sub-element sizes while modal interfaces are rasterized across the standard 512x334 drawing canvas. Returning canonical 512x334 dimensions ensures consumers correctly sample and crop the full interface surface.
### System Architecture & Viewport Dimensions
- `src/main/java/Game.java`:
- Updated `getOpenInterfaceWidth()` and `getOpenInterfaceHeight()` to return canonical 12 \times 334$ dimensions for all modal viewport interfaces.
- Eliminated erroneous sub-element `RSInterface.interfaceCache` width/height queries that caused partial rendering and severe viewport cropping.
* fix(client): preserve opaque black text drop shadows and primitive fills
Prevents intentional black text glyphs, text drop shadows, and drawing primitives from being erased as transparent background pixels on direct alpha composited viewports. Remaps zero color arguments (black) to 0x000001 so off-screen alpha producers distinguish drawn black pixels from unwritten transparent background pixels.
### Rasterization & Alpha Transparency
- `src/main/java/TextDrawingArea.java`:
- Remapped `i1 == 0` in `method392` to `1` (`0x000001`) to ensure drop shadows (`_shadow` pass) and black text render as solid opaque pixels rather than transparent alpha cutouts.
- Remapped `j1 == 0` in `method394` to `1` for identical shadow preservation across colored text drawing.
- `src/main/java/DrawingArea.java`:
- Remapped zero color fills and horizontal/vertical drawing lines to `1` to prevent solid black geometric frames from punching transparent holes through modal interfaces.
* fix(client): revert DrawingArea zero-fill color remapping to restore sprite transparency
Reverts zero-color remapping in DrawingArea fillArea and line routines. ItemDef.getSprite initializes transparent 32x32 sprite rasters using DrawingArea.fillArea(32, 0, 0, 32, 0), where color 0 is required as the transparent keying value for sprite clipping. Reverting restores transparent item backgrounds across inventory and bank containers while TextDrawingArea retains opaque black drop shadow preservation for typography.
### Rasterization & Sprites
- `src/main/java/DrawingArea.java`:
- Reverted `_color == 0` remapping in `fillArea`, `drawHorizontalLine`, and `drawVerticalLine` to restore authentic 0-keyed alpha transparency in dynamic sprite generation.
* feat(plugins): implement client plugin engine, ground items overlay, menu swapper, and script runtime
Implements an extensible client plugin and scripting architecture for 2006Scape, enabling modular overlays, menu modifications, and automation hooks while preserving vanilla 317 client timing and protocol integrity. Replaces the legacy hardcoded QoL options tab with an interactive tab and viewport modal interface for configuring built-in and externally loaded plugins. Integrates seamless cross-platform hooks to support runtime script interpretation, ground item tracking, and dynamic menu action rewrites.
### System Architecture
* `PluginManager.java`:
* Central singleton managing plugin and script lifecycles (`init`, `onGameTick`, `onRenderOverlays`, `onPostBuildMenu`, `onMenuAction`, `onChatMessage`, `onGroundItemSpawn`, `onCommand`).
* Implements event dispatching with isolated try-catch error boundaries and state persistence for user preferences.
* `ClientPlugin.java` & `ClientScript.java`:
* Base lifecycle interfaces defining metadata (`getName`, `getDescription`, `getVersion`, `getAuthor`), configuration schemas, and activation states.
* `PluginContext.java` & `PluginGraphics.java`:
* Encapsulates safe client interactions, viewport coordinate transforms, world-to-screen projections, and 317 `DrawingArea` rendering utilities.
* `ExternalPluginLoader.java` & `ScriptInterpreter.java`:
* Facilitates loading external compiled plugins (.jar / .dex) and parsing custom automation scripts at runtime from user storage.
### Migrated Features
* `PluginPanelUI.java`:
* Migrated legacy Tab 7 options into a modernized in-game plugin configuration hub and interactive modal UI.
* Implemented clickable toggle buttons, category navigation, dynamic scrollable configuration panels, and modal dismiss handling.
* `Game.java` & `AndroidHooks.java`:
* Integrated plugin dispatch triggers across game loop ticks, chat message reception, ground item registration, and action menu construction.
* Added native dialog hooks and bridge methods to delegate plugin management to native Android or desktop modal UIs.
### New Features & Additions
* `GroundItemsOverlayPlugin.java`:
* Renders world-projected labels and item quantity text for items on the ground with configurable price-tier coloring and despawn timers.
* Automatically filters and highlights valuable drops based on configurable coin value thresholds.
* `MenuEntrySwapperPlugin.java`:
* Rewrites contextual right-click option menus to swap default actions (e.g., Talk-to -> Bank/Trade, Shift-click drop).
* Provides configurable entry prioritization based on opcode and menu index ordering.
* `ChickenFeatherFarmerScript.java`:
* Example automated routine demonstrating state machine architecture for targeting NPCs, pathing, and collecting dropped items.
### Bug Fixes & Edge Cases
* `processMenuClick`:
* Intercepts viewport modal click events to prevent unintended pathfinding or entity interaction clicks when interacting with open plugin menus.
* `onGroundItemSpawn`:
* Validates coordinate bounds and height plane offsets to avoid out-of-bounds array access during region chunk transitions.
* fix(ui): show explicit on-off toggle states and clean up redundant qol buttons
Improves plugin configuration usability by adding explicit visual state rendering and click interactions for boolean and integer config items within the Plugin Hub modal. Cleans up the Tab 7 QoL panel by removing hardcoded buttons for Menu Entry Swapper and Feather Farmer, restoring the canonical client quality-of-life options while delegating plugin controls entirely to the modal hub.
### Core / System Architecture
* `PluginManager.java`:
* Added `getConfigValue`, `getConfigBoolean`, `getConfigInt`, and `setConfigValue` accessor/mutator methods to query live config properties with default fallbacks.
* Automatically serializes altered plugin and script configurations to `plugin_settings.properties` and triggers live `onConfigChanged` callbacks.
### UI & Visual Formatting
* `PluginPanelUI.java`:
* Replaced ambiguous `"TOGGLE"` button labels with explicit colored states: `[ ON ]` with green fill (`0x1e6828`), green border (`0x3cd04f`), and emerald text (`0x50c878`), vs `[ OFF ]` with red fill (`0x6e2222`), red border (`0xd03c3c`), and coral text (`0xff7070`).
* Added integer value indicators rendered between `[-]` and `[+]` stepper buttons in gold (`0xffd700`).
* Added touch-forgiving click handling for the Config subtab in `handleModalClick`, allowing instant toggling of boolean settings and bounds-checked stepping of numeric values.
### Cleanups & Deprecations
* `drawTab7` & `handleTab7Click`:
* Removed redundant persistent buttons for Menu Entry Swapper and Feather Farmer from the Tab 7 sidebar.
* Restored standard QoL button stack below `PLUGIN HUB [Open Modal]`: Player Names, Item Drops Visible, Draw Distance, Exp Info, Debug Info, and Visual Fixes with 36px vertical stride.
* fix(combat): resolve npc attack opcode mapping and accurate chicken combat tracking
Fixes an issue where the Chicken Feather Farmer script became stuck in a stagnant "Fighting chicken" state while standing idle. Resolves the client NPC interaction action ID mapping to dispatch authentic packet 72 (`ATTACK_NPC`) rather than dialogue packet 155, and introduces precise target-matching logic to discern active combat from passive entity interactions.
### Core / System Architecture
* `PluginContext.java`:
* `interactNpc`: Explicitly maps the `"Attack"` action to actionId `412` (the 317 client action ID sending packet 72 `ATTACK_NPC`) instead of fallback option index 0 which incorrectly sent packet 155 (`FIRST_CLICK` / `Talk-to`).
* `getPlayerInteractingNpc`: Added helper to query the exact NPC instance `myPlayer` is currently interacting with via `interactingEntity` bounds validation.
* `getNpcAttackingPlayer`: Added helper scanning `npcIndices` to detect any NPC currently targeting the player (`npc.interactingEntity == myPlayerIndex + 32768`).
* `isPlayerInCombat`: Refactored to require an alive, combat-capable opponent (`combatLevel > 0`) or active incoming attacks, eliminating false combat flags caused by previous dialogue interactions (e.g. Fred the Farmer).
* `NpcWrapper.isDead`: Added check for chicken death animation (`anim == 5389`) in addition to zero health points.
### Migrated Command Plugins
* `ChickenFeatherFarmerScript.java`:
* Replaced generic `isPlayerInCombat()` / `isPlayerIdle()` check with specific chicken target verification: checks if the player is actively fighting a living chicken or being attacked by one before falling through to target scanning.
* Automatically retaliates against attacking chickens and dispatches authentic attack interactions to the nearest idle chicken when not in combat.
* fix(combat): resolve NPC fence attack reach, multi-tile wandering clipping, and step-away desync
Enforces authentic 2006 RS2 melee clipping and entity positioning boundaries between players and NPCs across Revision 377 tile and object collision flags. Fixes a critical ray trace off-by-one bug in NPC combat line-of-sight that permitted melee attacks across fences and obstacles, and resolves multi-tile NPC wandering overlap and follow/step-away desynchronization.
### Core / System Architecture
- `Region.java`:
- Updated `canReachNpcMelee(int playerX, int playerY, int height, int npcX, int npcY, int npcSize)` to perform bidirectional wall and fence collision validation.
- Ensures both the player's tile (`playerX, playerY`) and the NPC's corresponding border tile (`npcX, playerY`, `npcMaxX, playerY`, etc.) are checked against directional wall bits (`0x8`, `0x80`, `0x2`, `0x20`), preventing attacks across one-sided or multi-sided boundary fences.
- `NpcData.java`:
- Refactored `checkClip(Npc n)` to eliminate the broken Bresenham ray trace for melee attacks, which previously incremented coordinates to the destination tile before querying clipping flags.
- Directly delegates melee reach checks to `Region.canReachNpcMelee()`, guaranteeing authentic path and fence blocking, and returns `false` immediately if the target is underneath the NPC (`inNpc`).
- Preserves `PathFinder.isProjectilePathClear()` for ranged and magic combat, maintaining authentic safespots over low fences.
### Bug Fixes & Edge Cases
- `Npc.java`:
- Rewrote `getNextWalkingDirection()` player and NPC collision detection from single-tile South-West corner comparison (`p.absX == nextX && p.absY == nextY`) to complete bounding-box footprint validation (`p.absX >= nextX && p.absX < nextX + mySize && p.absY >= nextY && p.absY < nextY + mySize`).
- Completely prevents multi-tile NPCs (e.g. 2x2 Cows, Bears, 3x3 Demons) from randomly wandering onto and overlapping players.
- `NpcHandler.java`:
- Made `stepAway()` and `followPlayer()` mutually exclusive during NPC retaliation processing: when `playerInside` is true, the NPC exclusively attempts to step away and cannot initiate attacks.
- Replaced `getRandomAndHomeNPCWalking()` inside `followPlayer()` with `getNextNPCMovement()`, unifying collision-checked movement and eliminating duplicate coordinate increments and client-server direction desyncs.
* fix(feather-farmer): implement combat target locking and ground bone looting and burying
Resolved multi-target thrashing and missing bone prayer processing in the automated Chicken Feather Farmer script. The client engine now evaluates NPC interacting entity targets against the dynamic server-assigned player ID (unknownInt10) rather than the static local player array index constant, enabling accurate combat detection. Ground bones are now actively collected and sequentially buried within the coop radius while locking onto active combat targets until defeat.
### Script Combat Engine
- `ChickenFeatherFarmerScript.java`:
- Added stateful target locking (`currentTargetNpcIndex`, `lastAttackTime`) preventing target swapping mid-combat.
- Implemented `isEngagedWithTarget` to verify target vitality, proximity, and reciprocal interaction state before scanning for new enemies.
- Prioritized active combat lock and retaliatory defense before ground looting to ensure engagements complete naturally.
- Added ground bone looting for Item ID 526 ("Bones") and sequential inventory bone burying with 900ms cycle spacing.
- Enhanced feather looting to bypass inventory full checks when stackable feathers are already in inventory.
- Accurate chicken kill tracking upon target death detection rather than per-click dispatch.
### Plugin Context Infrastructure
- `PluginContext.java`:
- Updated `NpcWrapper` to evaluate `isAttackingPlayer` and `isUnderAttackByOther` using `game.unknownInt10` and `game.myPlayerIndex`.
- Added `getNpcByIndex(int index)` for direct entity inspection by index.
- Fixed `getNpcAttackingPlayer()` and `findNearestAttackableNpc()` to properly recognise NPCs targeting the local player.
- Extended death animation detection to cover both Chicken (5389) and Rooster (57) models.
* fix(spawns): adjust Farmer Groat chicken spawn out of stone wall boundary
Resolves an entity placement conflict where a Chicken (NPC 41) spawned directly inside the perimeter stone wall of Farmer Groat's chicken coop near Lumbridge. Revision 377 cache map data places an impassable stone wall (Object 1902) and wall buttress (Object 1838) at tile (3233, 3300), which blocked entity movement and melee attack pathing through the coop boundary. Relocating the spawn coordinates two tiles west inside the coop perimeter restores authentic movement wandering and melee attack reachability.
### Bug Fixes & Edge Cases
- `spawns.json`:
- Adjusted Chicken spawn X coordinate from 3233 to 3231 at Y=3300 (height 0).
- Cleared tile collision overlap with Revision 377 East stone wall (Object ID 1902, type 0, orientation 2) and corner buttress (Object ID 1838, type 5, orientation 2).
- Resolved unreachable melee attack state ("I can't reach that.") caused by directional wall clipping flags (0x8 and 0x80) between pen interior and wall boundary.
- Enabled proper 1-tile wandering radius within the pen interior bounds (X=3227..3232, Y=3296..3300).
* fix(combat): resolve NPC follow destination clipping and Fred chicken spawns
Resolves entity reachability failures and boundary clipping where Chicken (NPC 41) entities at Farmer Fred's farm wandered into the western stone wall (Object 979) at tile (3184, 3277) and players received "I can't reach that." errors during combat. Melee follow target selection in PlayerAssistant now verifies candidate tiles against solid object clipping flags and pathfinder accessibility, preventing the engine from attempting to path players onto impassable boundary wall or building tiles. Chicken spawn coordinates at Farmer Fred's pen are relocated inward from the boundary to keep wandering paths strictly within the pen interior.
### Combat & Pathfinding Infrastructure
- `PlayerAssistant.java`:
- Updated `getFollowNpcLocation(Npc npc)` to filter out candidate attack tiles blocked by solid objects (`(getClipping(x, y, player.heightLevel) & 0x1280100) != 0`).
- Added `PathFinder.accessible()` validation on candidate attack tiles, ensuring the selected destination is genuinely reachable from the player's current location before routing.
- Prevents nearest-distance selection from picking impassable building or wall tiles (e.g. tile `(3184, 3276)`), eliminating erroneous "I can't reach that." combat lockouts.
### Bug Fixes & Edge Cases
- `spawns.json`:
- Relocated duplicate chicken spawns at Farmer Fred's coop from `(3185, 3277)` to `(3186, 3277)` and `(3188, 3277)`.
- Keeps the chickens' 1-tile wandering radius within `X = 3185..3189`, preventing entities from wandering onto the Revision 377 western stone wall line at `X = 3184`.
* fix(npcs): resolve asymmetric wandering bounds in random walking routine
Fixes a fundamental arithmetic and inequality defect in NpcHandler's random walking routine that skewed all 1-tile wandering NPCs into wandering up to two tiles South-West while completely preventing movement North and East. By correcting the proposed coordinate delta evaluation against the NPC's home spawn coordinates, entity wandering now adheres to authentic symmetric boundaries in all four directions.
### Core / System Architecture
- `NpcHandler.java`:
- Fixed `MoveX == -1` boundary check from `absX - MoveX > makeX - 1` to `absX + MoveX >= makeX - 1`, eliminating double-negation that permitted NPCs to wander 2 tiles West of their home coordinate.
- Fixed `MoveX == 1` boundary check from strict `<` to inclusive `<=` (`absX + MoveX <= makeX + 1`), restoring authentic Eastward wandering from spawn.
- Symmetrically corrected `MoveY == -1` and `MoveY == 1` boundary checks, restoring authentic Northward wandering and restricting Southward movement to 1 tile.
- Prevents pen-bound entities (e.g. Chickens at Farmer Fred's coop) from over-wandering their configured radius onto perimeter wall tiles.
* feat(plugins): implement RuneLite plugin and script hub, ground items, swapper, static IDs, and automation scripts
Introduces a high-performance, modular plugin and automation script framework for the Revision 377 client and Android platform. Implements full UI modals, config persistence, dynamic dex/jar loading, RuneLite-style overlays, static ID constants (ItemID, ObjectID, NpcID, SkillID), and tick-safe scripts for chicken feather farming and cow combat.
### Plugin & Script Infrastructure
- PluginManager.java, ClientPlugin.java, ClientScript.java
* Core lifecycle management supporting enable/disable toggles, config change notifications, and background script tick processing.
* Added external JAR/DEX loading capabilities through ExternalPluginLoader.java and Android SAF via PluginDocumentsProvider.java.
- PluginPanelUI.java
* Complete interactive modal interface featuring tab switching ("Plugins", "Scripts", "Config"), scrolling viewport, toggle switches, and numeric stepper controls.
* Adaptive orientation layouts for portrait and landscape mobile screens with non-overlapping descriptions and scroll bars.
- PluginContext.java & PluginGraphics.java
* High-level client API exposing entity querying, spatial coordinate transforms, ground item manipulation, authentic menu injection, and hardware-accelerated overlay drawing.
### Built-in Plugins & Automation Scripts
- GroundItemsOverlayPlugin.java
* RuneLite-style ground item labels, configurable price tiers (Low, Medium, High, Insane), tile collapsing, item highlights, and lootbeams.
* Configurable label opacity and semi-transparent backgrounds with responsive touch menu actions.
- MenuEntrySwapperPlugin.java
* Menu action prioritization for Bank, Pickpocket, Trade, and custom left-click overrides.
- ChickenFeatherFarmerScript.java & CowKillerScript.java
* Tick-safe combat automation with target lock, retaliation, ground item looting (feathers, bones, cowhide, raw beef, raw chicken), and automatic bone burial for Prayer XP.
* Smart gate and door approach navigation with state verification and cooldown prevention.
### Static ID & Game Definition APIs
- StaticItemList.java, StaticObjectList.java, StaticNpcList.java, SkillConstants.java
* Ported 26,000+ server-side Revision 377 static ID constants directly into the client package.
- ItemID.java, ObjectID.java, NpcID.java, SkillID.java
* Added RuneLite-compatible ID alias classes and skill identifier utilities eliminating magic numbers across all scripts.
### Bug Fixes & Edge Cases
- Gate Navigation & Prevention of Infinite Loops
* Fixed PluginContext.interactObject action verification to prevent falling back to packet 502 ("Close") when "Open" is absent.
* Added isOpenGateOrDoor to distinguish open gates (IDs 1552, 1556, 1560, 1561, 7051, 7052) from closed gates.
* Reordered script loop priority so gate approach and opening precedes looting and combat targeting, eliminating fence path-blocking.
- Text & Stepper UI Overlaps
* Resolved description truncation and button overlap across modal tabs and fixed numeric stepper value overflowing past increment buttons.
* fix(world): synchronize dynamic gate and door collision in region clipping
Implement bidirectional object collision manipulation in Region and synchronize dynamic gate and door state transitions to eliminate pathfinding desyncs. When wooden and metal gates or doors swing open or closed, directional wall and solid object collision flags are now updated accurately in the server's collision matrix to match client-side object transforms and prevent false unreachable path rejections during NPC combat.
### Core / System Architecture
- Region.java:
- Implemented removeObject(int objectId, int x, int y, int height, int type, int direction) along with helper overloads accepting Objects and ID coordinates.
- Implemented bitwise removeClipping and removeProjectileClipping routines (&= ~shift) mirroring addClipping to safely clear collision flags without wiping floor or tile metadata.
- Implemented removeClippingForSolidObject, removeProjectileClippingForSolidObject, removeClippingForVariableObject, and removeProjectileClippingForVariableObject to accurately reverse collision flags across directional straight walls (type 0), diagonal walls (types 1 & 3), corner walls (type 2), and solid objects (types 9+).
- Added object instance removal from realObjects list on object unregister.
### Bug Fixes & Edge Cases
- GateHandler.java:
- Updated openSpecialGate, openSingleGate, and openMetalGateWalk to unclip closed gate objects in Region upon opening and dynamically add clipping for open gates.
- Updated manual gate closing branches to remove open gate collision and restore closed gate collision.
- Fixed "I can't reach that" false rejections in PlayerAssistant.followNpc() and PathFinder.accessible() when interacting across open cow pen and farm gates.
- ObjectManager.java:
- Updated doubleGateTicks and singleGateTicks to dynamically remove open gate collision flags and restore closed gate collision flags in Region upon timer expiration.
- Doors.java & DoubleDoors.java:
- Connected door opening and closing mechanics to Region.removeObject and Region.addObject to ensure single and double swinging doors maintain parity between visual placement and pathfinding collision.
* fix(pathfinding): resolve premature attack rejections, circular BFS buffers, and NPC wall leashing
Refactors RS2 pathfinding, projectile line of sight, and melee attack routing to authentic Revision 377 collision rules. Resolves premature 'I can't reach that' rejections across fences and gates by delegating inaccessible positions to follow route generation, and replaces LinkedList BFS queues with primitive circular buffers.
### Core / System Architecture
- `PathFinder.java`:
- Replaced `LinkedList<Integer>` queues in `findRoute()` and `accessible()` with primitive `int[4096]` circular buffers using bitwise wrapping `(writePath + 1) & 4095`.
- Converted BFS retrieval from O(N) pointer traversals to O(1) direct array index access, eliminating GC allocations during tile search.
### Bug Fixes & Edge Cases
- `ClickNPC.java`, `CombatAssistant.java`, and `PlayerAssistant.java`:
- Removed premature rejection checks that aborted attacks on click when Chebyshev proximity was satisfied across an obstacle (e.g. pen fences and gates).
- Maintained movement toward nearest accessible attack tile via `getFollowNpcLocation()`, only sending 'I can't reach that.' if no candidate attack tile is accessible.
- `PathFinder.java`:
- Added early return when source and destination match to prevent division-by-zero (Double.NaN) in Bresenham delta calculations.
- `Npc.java` & `NpcHandler.java`:
- Added `walkingHomeStuckTicks` counter to NPC state.
- Implemented authentic RS2 leashing: if an NPC is blocked by walls/fences while walking home for 10 consecutive ticks, it teleports back to its original `(makeX, makeY)` spawn point and resets `walkingHome`.
- `PlayerAssistant.java`:
- Pre-filtered follow candidate nodes by distance and clipping masks before invoking full BFS accessibility checks.
- Enabled `moveNear = true` in `followPlayer()` so player following approaches adjacent reachable tiles when the target tile is blocked.
### Cleanups & Deprecations
- `PathFinder.java`:
- Removed debug chatbox message `sendMessage("ERROR!")` when pathfinding to the player's current coordinate.
* fix(packets): add authentic pathfinding to item-on actions, ground pickup, and restore player movement clipping
Synchronizes packet interaction workflows with authentic Revision 377 movement and collision behavior. Item-on-object, item-on-npc, item-on-ground, and magic-on-object packets now route and follow until in interaction proximity rather than aborting prematurely, ground item pickups require standing directly on the item tile or line-of-contact across tables, and server-side player movement collision verification is restored in getNextWalkingDirection().
### Core / System Architecture
- `Player.java`:
- Restored server-side step collision verification with `Region.canMove()` in `getNextWalkingDirection()`.
- Position updates (`currentX`, `currentY`, `absX`, `absY`) are guarded so blocked steps immediately clear the walking queue without coordinate desynchronization.
- `ClickObject.java` & `ClickNPC.java`:
- Exposed `onObjectReached()` and `handleNpcInteraction()` as static utilities for packet handlers.
### Bug Fixes & Edge Cases
- `ItemOnObject.java`:
- Delegated item-on-object processing through `ClickObject.onObjectReached()`, enabling players to use items on furnaces, anvils, and ranges from a distance.
- `ItemOnNpc.java`:
- Routed item-on-npc interactions through `ClickNPC.handleNpcInteraction()` so players approach NPCs (e.g. shearing sheep) before executing.
- `ItemOnPlayer.java` & `ItemOnGroundItem.java`:
- Added approach cycle events that pathfind until line-of-contact is achieved before executing the item action.
- `PickupItem.java` & `Walking.java`:
- Enforced exact tile positioning for ground items on traversable tiles, preventing pickup through fences and walls.
- Enabled cardinal line-of-contact pickup for items situated on non-walkable objects (e.g. tables).
- Cleared `player.walkingToItem` on walking packets to cancel stale pickup tasks.
- `MagicOnObject.java`:
- Added approach routing and `PathFinder.isProjectilePathClear()` line-of-sight checks for spellcasting on world objects.
* feat(scripts): add collision reachability API, world-gated scripts, and gate-safe chicken/cow automation
Adds a collision-aware reachability and line-of-sight API to PluginContext, restricts automation scripts to World 1 while keeping plugins on both worlds, and fixes gate/door handling and "I can't reach that" loops in the Chicken Feather Farmer and Cow Killer scripts.
### Core Automation Architecture
* `PluginContext.java`:
- Added directional collision masks and `getClipping`, `isTileWalkable`, and two-sided `canStep` validation (exit and entry wall flags, strict diagonal checks) backed by the client CollisionMap.
- Added `canMeleeReach` mirroring server `Region.canReachNpcMelee` (cardinal adjacency for 1x1 NPCs, wall flags on both tiles).
- Added `hasLineOfSight` raycasting (coordinates, NPCs, ground items) and bounded BFS `canReach` overloads for tiles, NPCs, ground items, and objects.
- Added `randomDelay(minMs, maxMs)` producing bell-curve timing jitter.
- Added `isAnyGateOpenNearby` and `isAnyGateOrDoorOpenNearby` using Revision 377 open gate IDs and "Close" actions.
### World Availability & Plugin Hub
* `PluginManager.java`:
- Added `isScriptsAvailable()` (World 1 only); script lists, start, ticks, and event hooks are blocked on World 2, plugins remain active on both worlds.
- `::scripts` redirects to the Plugins tab on World 2.
* `PluginPanelUI.java`:
- Header and tab strip adapt per world (Plugins | Scripts | Config on World 1, Plugins | Config on World 2) and Scripts tab clicks redirect to Plugins on World 2.
### Script Intelligence
* `ChickenFeatherFarmerScript.java`:
- Targets only "Gate" objects (house doors excluded) and never clicks a gate when any open gate is nearby, preventing open double gates from being toggled shut.
- Opens gates only when the anchor or visible chickens are unreachable or lack line of sight.
- Filters chickens and loot by `canReach` and `hasLineOfSight`; quick-loots feathers within one tile before retaliating.
- Uses `randomDelay` for all loop delays.
* `CowKillerScript.java`:
- Same gate guard, reachability, line-of-sight, quick-loot (cowhide), and humanized delay changes.
### Bug Fixes & Edge Cases
* Both scripts implement `onChatMessage` to drop the target lock when the server replies "I can't reach that.", preventing infinite attack retries through coop walls.
* Port Astraeus dialogue factory and migrate Al-Kharid guard
Add Astraeus's chainable dialogue factory alongside the legacy DialogueHandler, with player-owned dialogue state and packet/button routing. Preserve legacy dialogue behavior when no factory dialogue is active, and clear factory state when a dialogue ends.
Move the Al-Kharid border guard toll dialogue into the plugin system, including both toll choices, decline and insufficient-coins responses, and the completed Prince Ali path. Remove the obsolete button-action plugin and legacy handler cases.
Make guard first-click interactions require adjacent reach, and update Al-Kharid gate collision while open so the player can route through. Broadcast temporary gate object changes to nearby players and restore closed collision and visuals after crossing.
Compile the server and run git diff --check.
* Flatten plugin source directory layout
Move all plugin sources from plugins/plugin/<package> to plugins/<package>, removing the redundant directory level while leaving declared plugin.* packages and internal imports unchanged.
Update PluginService's path-to-class-name resolution to prepend the plugin package prefix for sources discovered beneath ./plugins. Keep recursive discovery working for nested Kotlin and Java plugins in the new layout.
Compile the server and run git diff --check.
* Extract NPC interaction routing service
Move shared NPC reach checks, route selection, and deferred interaction handling out of packet implementations into NpcInteraction. Delegate NPC option clicks and item-on-NPC actions to the shared service.
Replace stale queued walking commands and routes when an out-of-reach NPC is clicked so the interaction route survives player post-processing. Route Talk-to actions to an adjacent tile, including when the player starts inside the NPC footprint.
* fix(world): synchronize global object updates and replace per-player gate state with world-global tracking
Fix server-client desynchronization when crossing map regions around dynamic gates and replace legacy per-player gate state tracking with authentic 2006 RS2 world-global gate state. Previously, gates auto-closing while players were out of range left stale open-gate entries in `globalObjects`, causing returning players to see an open gate while server `Region` clipping blocked passage.
### World Object Synchronization
- `ObjectHandler.java`:
- Moved `removeAllObjects(o)` and `globalObjects.add(o)` outside the 60-tile player broadcast loop in `placeObject(Objects)` so `globalObjects` always reflects world object state changes even when no player is nearby (such as gate auto-close ticks firing after a player leaves the region).
- Updated `updateObjects(Player)` to filter against the player's loaded 104x104 map scene bounds (`0 <= localX, localY < 104`) instead of a 60-tile Euclidean radius, and send object spawns/removals via the 5-argument `PacketSender.object(...)` so objects in outer region corners are not skipped on region reload.
### Global Gate State & Timers
- `GateHandler.java`:
- Replaced the per-player `gateStatus` field (`CLOSED`, `PARTIAL_OPEN`, `OPEN`) with a shared `ConcurrentHashMap` (`OPEN_GATES`) keyed by canonical gate coordinates `(x, y, height)` via `gateKey`, `isGateOpenAt`, `markGateOpen`, and `markGateClosed`.
- Updated `openSingleGate`, `openSpecialGate`, and `openMetalGateWalk` to check global gate state (`isGateOpenAt` and `isOpenGate`) and cancel any active auto-close timer when a gate is closed manually.
- `ObjectManager.java`:
- Refactored `singleGateTicks` and `doubleGateTicks` to bind their `CycleEvent` to the gate's global `timerOwner` object rather than an individual `Player`, checking `GateHandler.isGateOpenAt(...)` instead of `player.getGateHandler().gateStatus` or `player.disconnected` so world gates always close cleanly after their timer expires.
* fix(world): complete doubleGateTicks global gate state cleanup in ObjectManager
Stage the remaining hunk in `ObjectManager.doubleGateTicks` that was omitted in `de52bace`, resolving the compilation error where `player` was still referenced in `execute` and `stop`. This completes the transition of double-gate auto-close timers to world-global gate tracking without touching unrelated working-tree changes.
### Global Gate State & Timers
- `ObjectManager.java`:
- Replaced `player.getGateHandler().gateStatus = player.getGateHandler().CLOSED` in `doubleGateTicks` with `GateHandler.markGateClosed(closedX1, closedY1, objectH)` and removed the stale `player` reference in `stop()`.
* feat(client): expand plugin/script API, SemVer, BFS pathing, and Al-Kharid banking
Expanded the client plugin and script engine across movement, banking/shops, combat/skilling primitives, lifecycle reliability, semantic versioning, and ScriptInterpreter parity while fixing Al-Kharid banking and toll-gate navigation in CowKillerScript.
### Core Infrastructure
- `PluginContext.java` & `PluginGraphics.java`:
- Added run energy helpers (`isRunEnabled`, `setRunEnabled`, `ensureRunEnabled`), area/position helpers (`WorldArea`, `isInArea`, `isAt`), collision-aware BFS pathfinding (`findPath`, `walkToSmart`, `walkToSmartOrOpenDoors`), and multi-floor climbing (`climb`, `climbUp`, `climbDown`, `navigateToPlane`).
- Added `Withdraw-X`/`Deposit-X` (`actionId 53` + packet `208`), `setWithdrawAsNote`, `depositAllExcept(String...)`, `selectDialogueOption(String)`, `getDialogueOptions`, and Shop/Make-X APIs (`buyItem`, `sellItem`, `makeCookingAmount`, `clickMakeOption`).
- Added `useItemOnItem`, `useItemOnObject`, Equipment API (`getEquipment`, `isWearing`, `equipItem`, `unequipItem`), `setAttackStyle`, `toggleSpecialAttack`/`setSpecialAttack`, `Prayer` & `Spell` enums, `players()`/`PlayerQuery`, HP/food/emergency teleport helpers, and `drawPathOverlay`/`drawAreaOverlay`.
- Fixed `canReach(SceneObjectWrapper)` adjacent-tile reachability and monotonic `walkPath` index tracking.
- `ClientScript.java`, `ClientPlugin.java`, `PluginManager.java`, `SemVer.java`, `ExternalPluginLoader.java`, `PluginPanelUI.java`, `ScriptInterpreter.java`:
- Added `waitUntil`, stuck watchdog (`isStuck`, `resetWatchdog`), named timers (`markTimer`, `hasElapsed`), and `onLogin`/`onDisconnect`/`onPlayerDeath` hooks.
- Added SemVer 2.0.0 parsing/constraint matching (`SemVer`), `@version`/`@minApi` metadata parsing, `API_VERSION = "2.0.0"` gating, version display in `PluginPanelUI`, load error reporting, varargs/enum reflection in `ScriptInterpreter`, and startup copying of `SampleTreeCutter.script`.
### Scripts & Bug Fixes
- `CowKillerScript.java` & `ChickenFeatherFarmerScript.java`:
- Fixed Al-Kharid toll-gate dialogue handling, open main-road waypoints (`X = 3281`), `ItemID.COINS_995` retention/20gp top-up, `returnedToPastureGate` flag, and same-side Border Guard filtering.
- Integrated `ensureRunEnabled`, `walkToSmart`/`walkToSmartOrOpenDoors`, `waitUntil`, `markTimer`/`hasElapsed`, `useSpecialAttack`, `onPlayerDeath`, and optional `showDebugOverlay`.
* feat(client): add online plugin repo, scrollable choice dropdown, F2P web walker, and script interpreter upgrades
Replaced the built-in automation scripts and sample resources with an online plugin/script repository client (`PluginRepoClient`), upgraded `ScriptInterpreter` to support full-featured `.script` files, and added `WorldWebWalker` + `ScriptLogger` for map-wide F2P pathing and action logging. Set the initial client plugin/script API baseline to `1.0.0` while preserving built-in QoL plugins (`MenuEntrySwapperPlugin`, `GroundItemsOverlayPlugin`).
### Online Plugin Repository & Hub UI
- `PluginRepoClient.java`: Added GitHub-backed repository client (`index.json` parser, SemVer install/update/uninstall status, and cache-busted `httpGet` with `no-cache` and `?t=` timestamp).
- `PluginPanelUI.java`: Replaced the config tab with the **Online Repo** tab (`Install` / `Update` / `Remove`), added `getVisibleConfigItems` for conditional `when:<key>` config visibility, and replaced the `< ... >` choice cycler with a 172px scrollable dropdown popup (`DROPDOWN_MAX_VISIBLE = 6`).
- `PluginConfigItem.java`: Added `visibleWhen` support (`setVisibleWhen` / `getVisibleWhen`).
- `ExternalPluginLoader.java`: Removed built-in sample script extraction and legacy sample cleanup.
### Script Interpreter, Commands & Logging
- `ScriptInterpreter.java`: Added `onConfigChanged` forwarding on `InterpretedPlugin`/`InterpretedScript`, `else if` chains, `while` loops (1,000-iteration safety cap), `+=`/`-=` compound assignments, integral arithmetic preservation, hex literals (`0x...`), `|min|max` and `|when:<key>` on `@config`, `// @command` metadata parsing, and static class/field/method access (`Math`, `System`, `RSColors`, `ItemID`, `SkillID`, `NpcID`, `ObjectID`, `PluginContext`).
- `ClientScript.java`: Added `getCommandNames()`, made `formatCompactNumber` and `clearWait` `public`, and wired `ScriptLogger` into lifecycle/status transitions.
- `PluginManager.java`: Set `API_VERSION = "1.0.0"`, removed built-in `ChickenFeatherFarmerScript` and `CowKillerScript` registrations and hardcoded `::feather`/`::cow` commands, and added dynamic script-defined `::` command dispatch gated by per-plugin/script `chatCommands` config.
- `MenuEntrySwapperPlugin.java` & `GroundItemsOverlayPlugin.java`: Added `chatCommands` toggle to config items.
- `ScriptLogger.java`: Added rotating file (`<cacheDir>/logs/scripts.log`, 1 MB cap) and `[ScriptLog]` stdout logging for script lifecycle, status changes, `walkTo`, and `menuAction`.
### Smart Pathing & World Web Walker
- `WorldWebWalker.java`: Added 59-node F2P overworld road/bridge graph (Lumbridge, Draynor, Port Sarim, Rimmington, Falador, Taverley, Barbarian Village, Edgeville, Varrock, and Al-Kharid via the free northern pass) with Dijkstra routing.
- `PluginContext.java`: Added `createArea`, `walkPathCoords`, partial BFS fallback (`findPath(..., allowPartial)` up to 55-tile radius / 9,500 iterations), expanded `canReach` (45-tile radius / 6,000 iterations), monotonic `activeWebRoute` tracking, committed-goal hysteresis, and `ScriptLogger` action hooks.
### Cleanups & Removals
- Removed `ChickenFeatherFarmerScript.java`, `CowKillerScript.java`, `SampleTreeCutter.script`, and `samples.txt` from the client bundle (migrated to `2006scape-plugins`).
* fix(combat): enforce cardinal-only melee, fix NPC corner-sticking, halberd reach, and PathFinder LoS
Align melee combat reach, multi-tile NPC following, halberd range, and projectile line-of-sight checks with authentic 2006 RS2 behavior. Removing the `npcSize > 1` diagonal corner melee bypass prevents large NPCs from fighting on corner tiles and visually clipping into players, while cardinal fallback pathing and symmetric Bresenham raycasting resolve stuck NPCs and steep-angle LoS inaccuracies.
### Melee Reach & Halberd Support
- `Region.java`:
- Removed the `npcSize > 1` diagonal corner exceptions from `canReachNpcMelee(...)` so standard 1-tile melee is strictly cardinal-adjacent for all NPC sizes.
- Added `canReachHalberd(...)` supporting 2-tile cardinal and diagonal halberd reach verified with `PathFinder.isProjectilePathClear(...)`, preserving strict 1-tile `canReachNpc` behavior for non-halberd interactions.
- `ClickNPC.java`, `PlayerAssistant.java`, `CombatAssistant.java`:
- Removed `npcSize > 1` diagonal melee bypasses in melee range checks and `getFollowNpcLocation(...)`, routing players to cardinal edge tiles for standard melee.
- Switched halberd reach checks to `Region.canReachHalberd(...)` and gated `attackPlayer(...)` `isProjectilePathClear(...)` on `player.isUsingProjectileCombat()`.
### NPC Movement & Overlap Escape
- `NpcHandler.java`:
- Updated `followPlayer(...)` so 1-tile diagonal corner approaches and under-NPC escapes check `Region.canMove(...)` and fall back to the alternate cardinal axis when blocked, while farther diagonal approaches set both axes for `handleClipping(i)`.
- `Npc.java`:
- Updated `getNextWalkingDirection()` to allow an NPC that is already overlapping a player (e.g. a `3x3`+ NPC with a player on its center tile) to step away instead of freezing in place, while still blocking any NPC from stepping onto non-overlapping players.
### Pathfinding & Line of Sight
- `PathFinder.java`:
- Localized `destX` and `destY` in `findRoute(...)` before comparing against `player.getLocalX()` / `player.getLocalY()` so `!moveNear` same-tile early returns trigger accurately.
- Added `0..103` bounds validation in `accessible(...)` to reject out-of-scene targets immediately without flooding the 104x104 grid.
- Replaced the single-axis `isProjectilePathClear(...)` loop with a major-axis Bresenham/DDA raycast (`absDx >= absDy` vs `absDy > absDx`) so steep-slope LoS checks trace symmetrically.
* fix(npcs): initialize NPCDefinition before loading spawns so multi-tile NPCs retain their true size
Fix an initialization order bug in `NpcHandler()` where `loadSpawnList()` ran before `NPCDefinition.init()`, causing every spawned multi-tile NPC in the world to fall back to `size = 1`. Because `Npc.getSize()` cached that `1` permanently, multi-tile NPCs such as 2x2 Cows pathed and checked melee adjacency as 1x1 entities on the server while rendering as 2x2 on the client, clipping into players.
### NPC Initialization
- `NpcHandler.java`:
- Moved `NPCDefinition.init()` ahead of `loadNPCList()` and `loadSpawnList()` in `NpcHandler()` so `new Npc(...)` resolves each NPC's true `size` from `npcDefinitions.json` at startup.
* perf(hd): optimize 117HD pipeline, add Hd117Plugin, and fix multi-plane depth/archway rendering
Optimizes CPU and GPU performance across the shared 117HD pipeline, converts 117HD into a configurable built-in client plugin, and resolves multi-story depth poke-through and open-air archway material artifacts. All changes are scoped to the 2006Scape Client with zero server modifications.
### Core Architecture & Performance
- WorldController.java:
- Replaced O(R^3) concentric tile scan with an O(R^2) 4-edge ring perimeter walk via renderHdTileColumn.
- Added horizontal cxCam frustum culling in isHdTileInFrustum to skip out-of-FOV tiles and models.
- Tracked hdMaxPlane and HD117Pipeline.drawingPlane / drawingWall for multi-plane depth ordering.
- HdSceneUploader.java & Model.java:
- Built static terrain into 4 GL_STATIC_DRAW buckets (0..3 by Ground.anInt1321) once per region load, eliminating per-frame terrain CPU work and VBO uploads.
- Separated terrain, shadow-casting models/actors, and translucent geometry into distinct buffers.
- Added an 8 MB hard-capped LRU Model geometry cache (MAX_CACHED_MODEL_FLOATS = 2000000) keyed by Model.hdCacheVersion and plane.
- Removed per-tile WATER_NORMAL allocations and deduplicated shared-corner resolveGroundRgb lookups.
### Shaders, Rendering & Bug Fixes
- HD117Pipeline.java & DesktopHd117Renderer.java:
- Switched shadow sampling from 9-tap manual PCF to 4-tap hardware sampler2DShadow PCF with GL_LINEAR and GL_COMPARE_REF_TO_TEXTURE, plus early-out for emissive and sun-backfacing fragments.
- Added SCENE_FRAG_DIRECT for single-pass contrast tonemapping and BGRA swizzle without a post-process FBO.
- Added plane-ordered depth bias (vPlane * 3.0) and SURF_WALL (4) in SCENE_VERT so ground-floor walls and lower-plane objects never poke through upper-plane floors.
- HdProceduralGenerator.java:
- Replaced the roofNeighbors >= 2 indoor heuristic with isOpenAirPassThrough on plane 0 so open-air archways retain outdoor cobblestone instead of smooth indoor marble.
### New Plugin & Configurability
- Hd117Plugin.java, PluginManager.java, & Game.java:
- Added built-in '117 HD' ClientPlugin with live configuration for Shadows, Shadow Resolution (512/1024/2048), Shadow Quality, Dynamic Lighting, Atmospheric Fog, Draw Distance, Ground Textures, Normal Mapping, HD Water Shader, Saturation, Brightness, and Contrast Tonemapping.
* feat(plugins): migrate Cook's Assistant, Dairy Cow, and Flour Mill to plugins with persistent plugin data
Migrate Cook's Assistant, Dairy Cow milking, and Flour Mill mechanics out of core Java handlers into modular Kotlin plugins backed by a namespaced per-player `PlayerPluginData` store. This decouples quest and world-object progression from hardcoded `Player` fields while preserving backwards-compatible character save migration and authentic 2006 RS2 behavior.
### Core Plugin Infrastructure
- `PlayerPluginData.java`, `Player.java`:
- Added `PlayerPluginData` (`plugin-data.<plugin>.<key>`) on `Player` with typed getters/setters (`putString`, `putInt`, `putLong`, `putBoolean`, `getString`, `getInt`, `getLong`, `getBoolean`) and `KEY_PREFIX` validation.
- `PlayerLoadDataEvent.java`, `PlayerSaveDataEvent.java`, `PlayerSave.java`:
- Added `PlayerLoadDataEvent` and `PlayerSaveDataEvent` hooks in `PlayerSave` to serialize/deserialize `plugin-data.*` entries and expose unmapped legacy keys (`legacyData`) for seamless quest migration.
- `PlayerObjectsLoadedEvent.java`, `ObjectManager.java`:
- Dispatched `PlayerObjectsLoadedEvent` in `ObjectManager.loadCustomSpawns(Player)` so region-dependent plugin object spawns (such as a full flour bin) restore on login and region change.
- `QuestStatusEvent.java`, `QuestAssistant.java`, `DialogueFactory.java`:
- Renamed `Quests.questStatus()` to `isImplemented()`, dispatched `QuestStatusEvent` in `QuestAssistant.sendStages(Player)`, and simplified `DialogueFactory.onNext()` to delegate directly to `execute()`.
### Migrated Quest & Object Plugins
- `plugins/quests/cooksassistant/` (`CooksAssistantNpcPlugin.kt`, `CooksAssistantJournalPlugin.kt`, `CooksAssistantQuestStatusPlugin.kt`, `CooksAssistantLoadDataPlugin.kt`):
- Implemented Cook's Assistant dialogue, ingredient collection (`EGG`, `BUCKET_OF_MILK`, `POT_OF_FLOUR`), reward payout (`500` coins, `300` Cooking XP, `1` QP) with immediate `QuestAssistant.sendStages(player)` refresh, quest journal (`button 28165`), quest list color status (`string 7333`), and legacy `cookAss` save migration.
- `plugins/objects/dairycow/` (`DairyCowMilking.kt`, `DairyCowObjectPlugin.kt`, `DairyCowItemOnObjectPlugin.kt`):
- Implemented dairy cow milking for both first-click and `BUCKET`-on-object interactions (returning `"Nothing interesting happens."` for other items), with a 7-tick `CycleEvent` and bucket re-validation before awarding `BUCKET_OF_MILK`.
- `plugins/objects/flourmill/` (`FlourMillActions.kt`, `FlourMillObjectPlugin.kt`, `FlourMillItemOnObjectPlugin.kt`, `FlourMillPluginState.kt`, `FlourMillRegionPlugin.kt`):
- Implemented hopper grain loading (`GRAIN` up to `30`), hopper controls (`HOPPER_CONTROLS`) with `disconnected`/distance-guarded `CycleEvent`, `POT`-on-`FLOUR_BIN` and first-click flour collection, empty-bin (`1781`) message, and persistent `objects.flourmill` `grain`/`flour` state across logouts.
### Cleanups & Deprecations
- Removed legacy Java classes `CooksAssistant.java`, `MilkCow.java`, and `FlourMill.java`, along with their hardcoded fields (`cookAss`, `milking`, `flourAmount`, `grain`) in `Player.java` and switch cases in `QuestAssistant.java`, `QuestRewards.java`, `DialogueHandler.java`, `DialogueOptions.java`, `UseItem.java`, `NpcActions.java`, `ObjectsActions.java`, `PlayerSave.java`, and `ObjectManager.java`.
* feat(plugins): migrate combat style, autocast menu, spell select, and cancel buttons to plugins
Migrate all combat attack-style and autocast spell-selection button handling out of `ClickingButtons.java` and `Player.java` into modular Kotlin `ButtonActionEvent` plugins. This also adds support for the missing `7212` autocast cancel button and aligns autocast toggling, cancel preservation, and level/staff validation with authentic 2006 RS2 behavior.
### Migrated Combat & Autocast Plugins
- `plugins/buttons/combat/CombatStyleButtonsPlugin.kt`:
- Mapped all weapon combat style buttons (`9125`–`48010`) to `fightMode` (`0`–`3`) via `STYLE_BY_BUTTON`, guarding on `player.isDead` and resetting active autocast when switching to a melee/ranged style.
- `plugins/buttons/combat/AutocastMenuButtonsPlugin.kt`:
- Handled "Choose Spell" (`1097`) and "Attack with" (`1093`, `1094`) to open Modern (`1829`), Ancient (`1689` with Ancient staff `4675`), or Slayer (`12050` with Slayer's staff `4170`) spell selection, and toggle autocast between active (`config 108 = 3`) and paused (`config 108 = 2`, restoring `config 43 = fightMode`) when `autocastId >= 0`.
- `plugins/buttons/combat/AutocastSpellSelectPlugin.kt`:
- Consolidated all autocast spell buttons across interfaces `1829`, `1689`, `12050`, and legacy `7038`–`47024` IDs, validating `player.isDead`, spellbook/staff requirements, and Magic level (`MagicData.MAGIC_SPELLS`) without requiring runes in inventory until cast.
- `plugins/buttons/combat/AutocastCancelButtonPlugin.kt`:
- Handled autocast cancel buttons (`2004`, `6161`, `7212`, `12101`, `24017`) by refreshing the equipped weapon's combat tab (`sendWeapon`) and restoring `fightMode` highlight when not autocasting, preserving any previously selected autocast spell.
### Cleanups & Deprecations
- `ClickingButtons.java`, `Player.java`:
- Removed hardcoded combat style switch cases, `1093`/`1094`/`1097` and `2004`–`24017` autocast handlers, and `isAutoButton`, `autocastIds`, and `assignAutocast` from `Player`.
* fix(combat): normalize poisoned arrow tiers/GFX and enforce authentic ranged/magic NPC combat distance
Fixes ammo recognition, bow-tier checks, and projectile/drawback graphics for poisoned arrow variants while aligning ranged and magic NPC combat pathing with authentic 2006 RS2 (Revision 377) mechanics. Players now stop cleanly at exact maximum attack range with clear line of sight instead of overshooting into melee range when running or attacking on cooldown.
### Poisoned Arrow Normalization
- `RangeData.java`:
- Added `(p+)` (`5616`–`5621`) and `(p++)` / `(s)` (`5622`–`5627`) bronze through rune arrow IDs to `ARROWS`.
- Added `getBaseArrowId(int)` to map `(p)`, `(p+)`, and `(p++)`/`(s)` variants back to their base arrow ID, and normalized `getRangeStartGFX` and `getRangeProjectileGFX` lookups.
- Updated `correctBowAndArrows` for `MAGIC_LONGBOW` and `MAGIC_SHORTBOW` to return `RUNE_ARROW` (or `BROAD_ARROWS_4172` when equipped) so poisoned rune arrows pass bow-tier validation.
- `RangeMaxHit.java`:
- Normalized the arrow ID in `getRangeStr(int)` via `RangeData.getBaseArrowId(int)` so poisoned arrows inherit their base arrow's ranged strength.
- `ClickNPC.java`, `AttackPlayer.java`, `CombatAssistant.java`:
- Normalized `player.playerEquipment[player.playerArrows]` with `RangeData.getBaseArrowId(...)` in bow-arrow tier checks.
### Ranged & Magic NPC Combat Movement
- `ClickNPC.java`:
- Set `player.followNpcId = player.npcIndex` immediately after validation in both `ATTACK_NPC` and `MAGE_NPC`, even when `player.attackTimer > 0`, preventing the client's walk-to-melee packet from continuing during attack cooldown.
- Added `isInProjectileRangeWithLos(Player)` so `stopMovement()` on click only triggers when both within `getAttackDistance()` and with clear projectile line of sight (`PathFinder.isProjectilePathClear`).
- `Player.java`:
- Updated `getNextWalkingDirection()` to stop walking (`resetWalkingQueue(); return -1;`) on any step where `npcIndex > 0` and projectile combat is already within `getAttackDistance()` with clear projectile line of sight, preventing running players (2 tiles/tick) from overshooting max range (e.g., 7/9 tiles for shortbows).
- `PlayerAssistant.java`, `CombatAssistant.java`:
- Preserved `player.followNpcId` when stopping in range in `followNpc()`, `attackingNpcTick()`, and `attackNpc()` so players automatically re-follow NPCs that walk out of range or line of sight.
* feat(quests): add Druidic Ritual, Cook's range plugin, and native RS2 quest varp stages
Implement Druidic Ritual with authentic Taverley world interactions, convert
Cook's Assistant and the Lumbridge Cook's range to 2006 RS2 behaviour, and
refactor all 16 implemented quests to store and sync authentic RS2 varp
stage values natively with one-time character save migration.
### Druidic Ritual & Taverley World Fixes
- plugins/quests/druidicritual/DruidicRitualNpcPlugin.kt, DruidicRitualJournalPlugin.kt, DruidicRitualCauldronPlugin.kt, DruidicRitualQuestStatusPlugin.kt, DruidicRitualConstants.kt:
- Implement full Druidic Ritual quest flow (Kaqemeex, Sanfew, Cauldron of Thunder, Herblore lesson dialogue, and 4 QP / 250 Herblore XP reward) using varp 80 (stages 0..4).
- plugins/quests/druidicritual/DruidicRitualPrisonDoorPlugin.kt:
- Add Cauldron of Thunder prison door (2143/2144) handling with double-door swing animation and first-attempt level 19 Suit of armour (453) pedestal scenery swap/ambush, restoring scenery on death, timeout, or logout.
- data/cfg/spawns.json & src/.../Climbing.java:
- Move Sanfew (454) upstairs to (2899, 3429, 1) and wire staircase 1738 at (2898, 3428) to climb upstairs.
- src/.../PlayerAssistant.java:
- Remove the pre-quest level 3 / 175 Herblore XP grant on loginScreen().
### Cook's Assistant & Cook's Range Plugin
- plugins/quests/cooksassistant/CooksAssistantConstants.kt, CooksAssistantNpcPlugin.kt, CooksAssistantJournalPlugin.kt, CooksAssistantQuestStatusPlugin.kt, CooksAssistantLoadDataPlugin.kt:
- Extract shared CooksAssistantConstants, add authentic 2006 RS2 Lumbridge ingredient directions, support one-by-one ingredient hand-in, and restore the 2006 reward (1 QP, 300 Cooking XP, Cook's range access).
- plugins/quests/cooksassistant/CooksRangePlugin.kt, ItemOnObject.java, Cooking.java:
- Gate COOKING_RANGE (114) behind Cook's Assistant completion and apply the Lumbridge Cook's range reduced burn bonus.
### Native RS2 Quest Varp Refactor & Save Migration
- src/.../QuestAssistant.java, QuestRewards.java, DialogueHandler.java, NpcActions.java, ObjectsActions.java, NpcHandler.java, Barrows.java, ClickItem.java, ItemOnNpc.java, ItemAssistant.java, UseItem.java, CombatAssistant.java, PlayerAssistant.java, and quests/impl/*.java:
- Refactor all implemented quests to use authentic RS2 varp stage values natively (varps 29, 31, 63, 67, 71, 80, 107, 122, 130, 144, 145, 147, 160, 178, 179, 180) and sync them via sendConfig.
- src/.../Player.java & PlayerSave.java:
- Add questVarpVersion and migrateQuestStagesToVarp(player) to migrate pre-existing character saves once on load.
* feat(plugins): expose widget color and varps in PluginContext and refresh Plugin Hub index
Extend the external plugin API to support quest color/varp state detection
and ensure the Plugin Hub automatically refreshes stale repository indexes
without requiring a client restart.
### Plugin API Additions
- PluginContext.java:
- Add getWidgetColor(int widgetId) to expose RSInterface.textColor for
packet-122 colored quest entries.
- Add getVarp(int varpId) to safely read game.variousSettings[varpId].
### Plugin Hub Repo Refresh
- PluginRepoClient.java:
- Track lastFetchMs and re-fetch index.json in ensureLoaded() when more
than 10 seconds have elapsed since the previous fetch.
* Added scrolling for scrollbars in client
# Conflicts:
# 2006Scape Client/src/main/java/Game.java
* Added comment for magic numbers
* Added some barrows fixes (#682)
- Set Ahrim the Blighted (2025) maxHit to 20 and Dharok the Wretched (2026) maxHit to 29 in npcDefinitions.json.
- Adjust Dharok spawn position at barrowsKillCount == 5 in Barrows.java to (c.getX()-1, c.getY()).
- Add named destination 'barrows' (3565, 3308, 0) to Teleport.kt.
* Fixed screenshots
DesktopHooks.takeScreenshot() cast the applet to Window, which threw a ClassCastException on every desktop screenshot. Capture the frame that contains the applet instead.
* Fixed client ignoring -dev and -ip server args
Game copies ClientSettings.SERVER_IP into Game.server in its constructor, which runs before ClientArgs.apply(), so the client always connected to the default server even though the title showed [Local].
* feat(commands): add extra named destinations and aliases to Teleport plugin
Expands the admin `::teleport` / `::tele` command plugin with additional common 2006 RS2 towns, minigames, and island destinations alongside alias resolution for both spellbook cities and custom named locations. Coordinates are sourced directly from existing server spawn and travel/teleport definitions.
### Command Infrastructure
- `plugins/commands/admin/Teleport.kt`:
- Added 12 custom destinations to `NAMED_LOCATIONS` alongside `barrows` (`3565, 3308, 0`): `taverley` (`2896, 3428, 0`), `edgeville` (`3088, 3500, 0`), `al kharid` (`3293, 3174, 0`), `karamja` (`2911, 3152, 0`), `draynor` (`3103, 3249, 0`), `duel arena` (`3313, 3234, 0`), `castle wars` (`2441, 3090, 0`), `pest control` (`2659, 2676, 0`), `port sarim` (`3041, 3202, 0`), `rellekka` (`2620, 3686, 0`), `brimhaven` (`2772, 3234, 0`), and `entrana` (`2834, 3335, 0`).
- Added `CITY_ALIASES` entries (`tav`, `taverly`, `edge`, `alkharid`, `duel`, `cw`, `castlewars`, `pc`, `pestcontrol`, `portsarim`, `sarim`, `relekka`) and resolved `CITY_ALIASES` prior to checking `NAMED_LOCATIONS` so aliases work uniformly across all destinations.
- Updated `NAMED_LOCATIONS` teleport feedback to title-case multi-word destination names and updated `VALID_CITIES_MESSAGES` to list all supported destinations.
* feat(commands): migrate setlevel/level/skill command to developer plugin with skill name support
Moves the legacy `setlevel` / `level` / `skill` command out of `Commands.java` into a modular Kotlin developer command plugin (`DeveloperCommandEvent`) and adds skill name and abbreviation resolution alongside numeric skill IDs.
### Migrated Command Plugins
- `plugins/commands/developer/SetLevel.kt`:
- Subscribes to `DeveloperCommandEvent` (`playerRights == 3`) for `setlevel`, `level`, and `skill`.
- Supports numeric skill IDs (`0`–`20`) as well as full skill names and common abbreviations (e.g., `attack`/`att`/`atk`, `defence`/`defense`/`def`, `strength`/`str`, `hitpoints`/`hp`, `ranged`/`range`, `prayer`/`pray`, `magic`/`mage`, `woodcutting`/`wc`, `firemaking`/`fm`, `herblore`/`herb`, `runecrafting`/`runecraft`/`rc`), normalizing spaces, underscores, and hyphens.
- Clamps target levels to `1..99`, updates skill XP/level via `PlayerAssistant.getXPForLevel` and `PlayerAssistant.getLevelForXP`, refreshes the skill, triggers `levelUp`, and sends a confirmation message.
### Cleanups & Deprecations
- `src/main/java/com/rs2/net/packets/impl/Commands.java`:
- Removed the legacy `setlevel`, `level`, and `skill` switch cases from `adminCommands`.
* fix(quests): restore dark red journal titles and authentic Cook's Assistant completion text
Aligns the Cook's Assistant and Druidic Ritual quest journal scrolls (`interface 8134`) with authentic 2006 RS2 formatting. Restores the dark red (`@dre@`) quest title styling on line `8144` and updates the completed Cook's Assistant journal summary to list all quest rewards.
### Quest Journal Updates
- `plugins/quests/cooksassistant/CooksAssistantJournalPlugin.kt`:
- Removed the per-stage overwrites of string `8144` so `@dre@Cook's Assistant` (dark red) persists across all stages.
- Updated `STAGE_COMPLETE` text (`8147`–`8152`) to summarize helping the cook for the Duke of Lumbridge's birthday and list all rewards (`1 Quest Point`, `300 Cooking Experience`, `500 coins`, and access to the cook's range).
- `plugins/quests/druidicritual/DruidicRitualJournalPlugin.kt`:
- Updated string `8144` to `@dre@Druidic Ritual` so the journal title renders in dark red.
* feat(plugins): split Online Repo into Plugins and Scripts sub-tabs
Separate external plugins and scripts into dedicated sub-tabs inside the
Plugin Hub Online Repo modal to match the local Plugins and Scripts tabs.
### Online Repo Sub-Tabs
- PluginPanelUI.java:
- Add currentRepoSubTab state (0: Plugins, 1: Scripts) and
getFilteredRepoEntries() filtering by entry.type.
- Render Plugins and Scripts sub-tabs in the Online Repo header beside the
Refresh button.
- Update getContentHeight(), drawRepoList(), and handleModalClick() to
use the active sub-tab's filtered list and reset scrollOffset on switch.
* feat(plugins): add passThroughDoors option to PluginContext.findPath
Allow visual pathfinders such as Quest Helper to route paths straight
through closed doors and gates without altering default script pathing.
### Pathfinding API
- PluginContext.java:
- Add findPath(targetWorldX, targetWorldY, maxSearchRadius, allowPartial,
passThroughDoors) overload while preserving default passThroughDoors=false
on the 3-arg and 4-arg overloads.
- Pre-scan local scene doors/gates with an Open action (excluding Pay-toll)
and allow cardinal BFS transitions across those tiles when enabled.
* feat(client): add Plugin Hub search, Update All, SHA cache-busting, and ::hd plugin dispatch
Enhance the Plugin Hub UI, online repository client, command routing, and scene object interaction in the shared 2006Scape client.
### Core & Command Infrastructure
- `ClientPlugin.java` & `PluginManager.java`:
- Added `handlesCommandsWhenDisabled()` (default `false`) so toggleable plugins can still receive chat commands when disabled.
- Updated `PluginManager.onCommand(...)` to dispatch to plugins where `p.isEnabled() || p.handlesCommandsWhenDisabled()` while still respecting `isChatCommandsEnabled(p)`.
- `Hd117Plugin.java` & `Game.java`:
- Moved `::hd` and `::117hd` out of `Game.java` into `Hd117Plugin.onCommand(...)` using `PluginManager.get().togglePlugin(this)`, keeping the Plugin Hub toggle, saved config, and `setHD117Enabled(...)` in sync.
- `Game.java`:
- Intercepted `readChar(-796)` in `method73()` when `PluginPanelUI.isSearchFocused()` is `true` so keystrokes route to `PluginPanelUI.handleKeyChar(j)` instead of the chatbox.
### Plugin Hub UI & Online Repo
- `PluginPanelUI.java`:
- Added search/filter bar (`searchQuery`, `searchFocused`, `isSearchFocused()`, `handleKeyChar(int ch)`, `drawSearchBar(...)`, `handleSearchBarClick(...)` with inline `"X"` clear button) across Plugins, Scripts, and Online Repo tabs.
- Added `Update All` button, `Online Repo (N)` update count badge, `vOld -> vNew` version diff labels, and inline error banner.
- `PluginRepoClient.java`:
- Centralized repository constants (`PLUGIN_REPO_SLUG`, `PLUGIN_REPO_BRANCH`, `PLUGIN_REPO_URL`, `PLUGIN_REPO_RAW_BASE`).
- Added `resolveLatestMainSha()` (via `info/refs?service=git-upload-pack`) and `rewriteRawMainUrl(...)` to bypass Fastly CDN caching on `raw.githubusercontent.com` `/main/` URLs.
### Bug Fixes & Edge Cases
- `PluginContext.java`:
- Updated `SceneObjectWrapper` to derive `localX`/`localY` (`worldX`/`worldY`) from the `uid` south-west anchor (`uid & 0x7f`, `(uid >> 7) & 0x7f`).
- Deduplicated multi-tile objects by `uid` in `getSceneObjects(...)` and updated `interactObject(...)` to send the `uid` anchor coordinates to `invokeMenuAction(...)`.
* fix(woodcutting): prevent chopping trees that are already stumps
Validate the dynamic object manager state before starting or continuing a woodcutting action so players cannot chop a felled tree stump before it respawns.
### Bug Fixes & Edge Cases
- `Woodcutting.java`:
- Added `GameEngine.objectManager.getObject(x, y, p.heightLevel)` check in `startWoodcutting(...)` to return early if the target tile currently holds `tree.getStump()` (or if `tree == null`).
- Added the same stump check inside `WoodcuttingEvent.execute(...)` to stop the event if the tree was felled while chopping.
* fix(combat): reset autocastId when disabling autocast via combat menu button
Ensure clicking the autocast toggle button to disable magic completely clears autocast state so subsequent attacks use the selected melee combat style instead of re-enabling magic.
### Bug Fixes & Edge Cases
- `AutocastMenuButtonsPlugin.kt`:
- Replaced manual `player.autocasting = false` + config `108 = 2` with `player.playerAssistant.resetAutocast()` (clearing `autocastId = -1`, `autocasting = false`, resetting config `108` to `0`, and restoring config `43` to `player.fightMode`).
- Cleared `player.spellId = 0` and `player.usingMagic = false` to prevent lingering spell state on the next attack.
* fix(combat): set rangeItemUsed before triggering bow pullback GFX on NPC attacks
Ensure the bow pullback arrow graphic renders on the very first ranged attack against an NPC instead of reading an uninitialized `rangeItemUsed` value.
### Bug Fixes & Edge Cases
- `CombatAssistant.java`:
- Moved `player.gfx100(RangeData.getRangeStartGFX(player));` in `attackNpc(...)` to after `player.rangeItemUsed` is assigned for crystal bows and regular arrows, matching `attackPlayer(...)`.
* fix(trade): allow trading stackable items into existing inventory stacks (#166)
Fix trade space validation on the first accept screen so stackable and noted items already present in the receiver's inventory do not require extra free slots, and align the status text with 2006 RS2.
### Bug Fixes & Edge Cases
- `ClickingButtons.java` (`case 13092`):
- Count `requiredSlots` only for offered items that are not stackable/noted (`ItemDefinition.lookup(item.id).isStackable()`) or not already present in the receiver's inventory (`ot.getItemAssistant().playerHasItem(item.id)`).
- Added `Integer.MAX_VALUE` stack-overflow check (`(long) ot.getItemAssistant().getItemAmount(item.id) + item.amount > Integer.MAX_VALUE`) before allowing stackable merges.
- Updated trade interface `3431` messages to `"Other player doesn't have enough inventory space."` and `"You don't have enough inventory space."` and removed the custom chat messages.
* fix(objects): prevent ladder/trapdoor spam-click and Edgeville shed void teleports (#195)
Fix ladder and trapdoor climbing handlers so Edgeville shed trapdoor entries land cleanly inside Edgeville Dungeon and spam-clicking ladders or staircases cannot stack multiple teleports into the void.
### Bug Fixes & Edge Cases
- `ClimbOther.java`:
- Fixed `useOther(...)` for the Edgeville shed trapdoor `(3097, 3468)` to teleport directly to `(3096, 9867)` instead of offsetting from `player.absX`/`player.absY + 6400`.
- `ObjectsActions.java`:
- Added `break;` after matching `ClimbData` in `useOther(...)` so open trapdoors sharing ID `10698` are only handled once.
- `Climbing.java`:
- Set `client.climbDelay` immediately when `handleClimbing(...)` is invoked (before scheduling the 1-tick `CycleEvent`) so multiple clicks in the same tick cannot queue duplicate climb events.
- Added `client.absY < 6400` and `client.absY >= 6400` guards on `case 1733` and `case 1734`.
- `UseOther.java`:
- Added `1200ms` `climbDelay` cooldown and `absY >= 6400` / `absY < 6400` direction guards to `useUp(...)` and `useDown(...)`.
* fix(doors): support Dark Warriors' Fortress double doors 14751/14752 (#292)
Fix Dark Warriors' Fortress entrance double doors at `(3021, 3632)` and `(3021, 3631)` so they open to `14753`/`14754` and close properly.
### Bug Fixes & Edge Cases
- `doubledoors.json`:
- Replaced incorrect `1516`/`1519` IDs at `(3021, 3632, 0)` and `(3021, 3631, 0)` with the 377 cache IDs `14751` and `14752` (`face: 2`).
- `DoubleDoors.java`:
- Imported `StaticObjectList.*` (`DOOR_14751`–`DOOR_14754`) and added `ADJACENT_PAIR_STEP`, `DEFAULT_PAIR_STEP`, `ADJACENT_OPEN_ID_STEP`, and `DEFAULT_OPEN_ID_STEP` constants.
- Added `isAdjacentDoubleDoorId(...)` and `updateDoorId(...)` helpers so adjacent-ID double doors (`14751`/`14752` -> `14753`/`14754`) pair with `±1` offset and toggle with `±2` ID delta.
* fix(woodcutting): support chopping hollow trees for bark (#505)
Add hollow tree definitions to `Woodcutting.treeData` and fix `playerTrees(...)` so players can chop hollow trees (`2289` and `4060`) for bark (`3239`).
### Bug Fixes & Edge Cases
- `Woodcutting.java`:
- Added `HOLLOW_SMALL` (`2289` -> stump `2310`) and `HOLLOW_LARGE` (`4060` -> stump `4061`) to `treeData` (level `45`, `83` XP, item `3239` Bark, `40` tick respawn, cut chance `8`).
- Fixed `playerTrees(...)` swapped-index loop (`trees[i1][i]` capped at `6`) to check `treeData.getTree(tree) != null` and iterate all rows/elements of `trees`.
* fix(doors): pair 377 cache door IDs and register missing palace doors (#547)
Fix door ID toggling in `Doors.java`, register missing Al-Kharid Palace South and Varrock Palace doors in `doors.json`, and remove the legacy teleport workaround at Al-Kharid Palace South. All door IDs, faces, types, models, and recolors were validated against the Revision 377 cache (`loc.dat` and map region data) so doors toggle cleanly without changing appearance or becoming unclosable.
### Door Infrastructure
- `Doors.java` (`getToggledDoorId`):
- Replaced naive `doorId + 1` / `doorId - 1` toggling with `getToggledDoorId(Doors d)` using `StaticObjectList.*` constants so non-adjacent 377 cache `Open` <-> `Close` pairs keep their exact model IDs and recolors.
- Mapped `DOOR` (`3`) -> `DOOR_1531` (`1531`), `DOOR_59` (`59`) -> `DOOR_1534` (`1534`), and `DOOR_2556` (`2556`) -> `DOOR_1537` (`1537`), returning to `d.originalId` when closed.
- Mapped `LARGE_DOOR_1508` (`1508`) <-> `LARGE_DOOR_1511` (`1511`) to avoid `null` object IDs `1509` and `1510`.
- Mapped `LARGE_DOOR_1512` (`1512`) <-> `LARGE_DOOR_1515` (`1515`) and `LARGE_DOOR_1513` (`1513`) <-> `LARGE_DOOR_1514` (`1514`) based on matching 377 `loc.dat` models and recolors.
### Door Spawns & Cleanups
- `doors.json`:
- Added Varrock Palace large door `(3223, 3491, 0)` (`id: 1512, face: 3, type: 0`).
- Added Al-Kharid Palace South large doors `(3292, 3167, 0)` (`id: 1506, face: 3, type: 0`) and `(3293, 3167, 0)` (`id: 1508, face: 3, type: 0`).
- `ObjectsActions.java`:
- Removed the `case 1506: case 1508:` `movePlayer` teleport hack at Al-Kharid Palace South (`y=3166`/`3167`) now that the doors open normally via `Doors.java`.
* feat(client,server): add WebSocket server support, 117HD chunked scenery, and TeaVM ScriptInterpreter compatibility
Updates shared 2006Scape Client rendering, plugin/script execution, and 2006Scape Server WebSocket transport to support the TeaVM Web client alongside Desktop and Android. Preserves Revision 377 protocol/cache behavior while fixing SD near-plane clipping and Web reflection edge cases.
### Shared Client Rendering & 117HD
- WorldController:
- Bypassed Fixed-mode 512x334 frustum culling in Resizable mode and added per-triangle 3D near-plane clipping (NEAR_Z=48) with 64-bit backface cross-products.
- DesktopHd117Renderer, HD117Pipeline, HdSceneUploader:
- Added 4x4 chunked static scenery VBO support and HD pipeline hooks.
### ScriptInterpreter & Plugin System
- ScriptInterpreter, PluginContext, PluginManager, PluginRepoClient:
- Added direct dispatch for Math, System, String, List/Collection/Map, and Number/Boolean methods plus DesktopHooks.boxReflectValue wrapping for TeaVM.
- Added public static PluginContext.hasAction, walkPath overlay updates, improved toggleSpecialAttack button matching, and UTF-8 localStorage-backed plugin config persistence.
### WebSocket Server Transport
- WebSocketFrameCodec, WebSocketJagGrabChannelInitializer, WebSocketServiceChannelInitializer, FileServer, Constants, docker-compose.yml:
- Added WebSocket framing and service/JAGGRAB channel initializers for browser clients.
- ApolloHandler:
- Filtered benign Linux Connection reset SocketException warnings in exceptionCaught.
* test(client): add JUnit 4.7 dependency and ScriptInterpreter unit tests
Adds JUnit 4.7 test support to the 2006Scape Client Maven build and introduces unit tests for ScriptInterpreter expression parsing, control flow, and execution.
### Test Infrastructure
- `2006Scape Client/pom.xml`:
- Added `junit:junit:4.7` (`test` scope) dependency.
- `2006Scape Client/src/test/java/ScriptInterpreterTest.java`:
- Added unit test suite covering `ScriptInterpreter` functionality (`3/3` tests passing via `mvn test`).
* refactor(client): rename 117HD pipeline, plugin, and renderer to 317HD
Renames all 117HD classes, settings, CLI flags, and renderer references in `2006Scape Client` to 317HD across the shared client and desktop rendering path.
### Core & Rendering Pipeline
- `HD317Pipeline.java`, `DesktopHd317Renderer.java`, `Hd317Plugin.java`:
- Renamed from `HD117Pipeline.java`, `DesktopHd117Renderer.java`, and `Hd117Plugin.java` and updated all internal references.
- `ClientSettings.java`, `ClientArgs.java`, `Game.java`, `PluginManager.java`, `DesktopHooks.java`, `Model.java`, `WorldController.java`, `HdSceneUploader.java`, `HdProceduralGenerator.java`, `HdMaterial.java`, `HdGroundMaterial.java`:
- Updated `HD_117` -> `HD_317`, `-117hd` -> `-317hd`, `setHD117Enabled`/`isHD117Enabled` -> `setHD317Enabled`/`isHD317Enabled`, and all plugin/UI/comment references to `317HD`.
* fix(317hd): render animated world objects (fires, torches) when static scenery is enabled
Fixes animated world objects (`Animable_Sub5` such as fires) disappearing in 317HD mode when static scenery VBOs are active across Desktop, Web, and Android clients.
### 317HD Rendering Pipeline
- `HD317Pipeline.java`:
- Added `public static boolean drawingAnimatedObj` flag to distinguish non-`Model` animated `Animable` objects during per-frame rendering.
- `WorldController.java`:
- Added `renderHdAnimable(...)` helper in `renderHdTile(...)` for `Object1`, `Object2`, `Object3`, and `Object5` draws, setting `HD317Pipeline.drawingAnimatedObj = !(animable instanceof Model)`.
- `HdSceneUploader.java`:
- Updated `appendModel(...)` so `isStaticScenery` is `false` when `HD317Pipeline.drawingAnimatedObj` is `true`, ensuring animated objects skipped during static VBO baking are still uploaded and drawn each frame.
* fix(following): track previous tile and route non-combat following to enable follow dancing
Fixes non-combat player following so players trail behind moving targets and mutual follow dancing works authentically to 2006 RS2. Previously, `followPlayer()` always routed to the closest cardinal neighbor via `getFollowLocation()`, which caused two adjacent players following each other to pick their own current tiles and stand still.
### Player Movement & Following
- `Player.java`:
- Added `prevX` and `prevY` fields to track each player's previous tile independently of `lastX`/`lastY` (which are used for random event returns and save fallbacks).
- Updated `getNextWalkingDirection()` to record `prevX = absX; prevY = absY;` before each walking or running step.
- Initialized `prevX` and `prevY` on login and teleport to `(absX, absY - 1)` when walkable via `Region.canMove`, falling back to `(absX, absY)` otherwise.
- `PlayerAssistant.java`:
- Updated `followPlayer()` to route non-combat following (`playerIndex == 0`) to the target player's `(other.prevX, other.prevY)`, falling back to `getFollowLocation(otherX, otherY)` if the previous tile equals the target's current tile, is clipped, or is inaccessible.
- Added an early `stopMovement()` return when already standing on `(targetX, targetY)` and reset following if the target changes `heightLevel`.
- Preserved `getFollowLocation(otherX, otherY)` and range/line-of-sight checks for combat following (`playerIndex > 0`).
Closes 2006-Scape/2006Scape#582
* feat(npcs): add npcType-indexed NpcTickEvent and implement authentic Imp teleportation plugin
Introduces an `npcType`-indexed `NpcTickEvent` / `NpcTickSubscriber` dispatch pipeline for per-NPC tick plugins with zero allocation overhead on normal NPCs, and implements authentic 2006 RS2 Imp teleportation (`IMP` `708`, `IMP_709` `709`) as a Kotlin plugin. Also adds NPC teleport synchronization in `PlayerHandler` so multi-tile NPC teleports update cleanly on the client.
### Core Event & NPC Infrastructure
- `NpcTickEvent.java`, `NpcTickSubscriber.java`, `EventProvider.java`, `UniversalEventProvider.java`, `Player.java`:
- Added `NpcTickEvent` (exposing `index`, `npc`, `cancelTick()`, and `isTickCancelled()`) and `NpcTickSubscriber` (`npcTypes()`).
- Indexed `NpcTickSubscriber` plugins by `npcType` in `UniversalEventProvider.npcTickSubscribers`; `postNpcTick(int, Npc)` performs an O(1) lookup and returns `false` immediately without event allocation when no subscribers match.
- `NpcHandler.java`:
- Dispatched `Player.postNpcTick(i, npcs[i])` inside `process()`, skipping retaliation and random-walk on that tick if `cancelTick()` is called.
- `Npc.java`, `PlayerHandler.java`:
- Added `Npc.teleported` (cleared in `clearUpdateFlags()`) and updated `PlayerHandler.updateNPC` to remove and re-add teleported NPCs via `addNewNPC` so clients receive new coordinates and arrival graphics immediately.
### New NPC Plugins
- `plugins/npc/imp/ImpTeleportPlugin.kt`:
- Subscribes to `NpcTickEvent` for `IMP` (`708`) and `IMP_709` (`709`).
- Triggers a `1 in 10` teleport chance on non-lethal combat hits (`lastDamageTaken` edge detection while `HP > 0`, not dead, and not frozen).
- Runs a per-Imp idle timer (`70` ticks on spawn, `50`–`200` ticks thereafter) with a `1 in 2` teleport chance when out of combat for more than `8` ticks (`4800ms`).
- Selects a reachable, unclipped tile within `±20` tiles via `Region.getClipping` and `PathFinder.accessible`, plays smoke-puff graphics (`86`) on departure (`stillGfx`) and arrival (`gfx0`), resets NPC combat state and attacker targeting, and cancels the rest of that tick.
Closes 2006-Scape/2006Scape#591
* fix(client): fix web walker routing, door reachability, and special attack detection
Fix overworld road-graph edges in `WorldWebWalker.java` against Revision 377 map clipping, improve `PluginContext.java` pathing and closed-gate reachability, eliminate duplicate `walkTo` spam while moving, and fix special attack energy/active detection and button toggling for `2006Scape Server`.
### Web Walker & Overworld Routing
- `WorldWebWalker.java`:
- Removed fence-crossing edges `{37, 38}` and `{35, 53}`, replacing them with `{37, 53}` so Al-Kharid routes around the north of the fenced field (`38 <-> 59 <-> 53 <-> 37`).
- Removed river-crossing edges `{24, 55}`, `{27, 31}`, and `{30, 31}` where no 2006 RS2 bridge exists; moved node `31` (`Lumbridge Chicken Coop Outside`) to `{3238, 3288}` and connected `{34, 31}` so west-bank routes cross Lumbridge Bridge.
- Added North Varrock Palace bypass nodes `56` (`{3162, 3470}`), `60` (`{3186, 3496}`), `61` (`{3215, 3508}`), `62` (`{3244, 3503}`), `63` (`{3243, 3473}`), and `64` (`{3246, 3443}`) connecting `55 <-> 56 <-> 60..64 <-> 50` (`Varrock East Bank`).
- Widened `findRoute` reachable start-node search from `40` to `50` tiles (`canReach(..., 52, false)`).
### Pathfinding, Door Reachability & Walk Hysteresis
- `PluginContext.java`:
- Widened `canReach` radius cap from `45` to `52` (full `104x104` scene) and scaled BFS iteration caps (`canReach` to `Math.max(6000, (rad * 2 + 1) * (rad * 2 + 1))`, `findPath` to `104 * 104`).
- Added `isTollGate` (`"pay-toll"` substring match) so `"Pay-toll(10gp)"` gates are excluded from free `passThroughDoors` pathing and `openNearestClosedDoor`.
- Added `isDoorReachable` so `openNearestClosedDoor` checks orthogonal neighbors instead of failing `canMeleeReach` across closed wall/gate clipping flags.
- Updated `walkToSmartInternal` to invoke `WorldWebWalker` whenever `findPath(targetWorldX, targetWorldY, 50, false, openDoors).isEmpty()` (even at `dist <= 16` across fences/rivers), pass `openDoors` to local partial `findPath`, guard the `<= 16` partial fallback with `canReach`, and skip duplicate `walkTo` calls while `isPlayerMoving()` is making progress toward the same committed goal.
### Special Attack Detection & Toggling
- `PluginContext.java`:
- Added `collectWidgetsByType` and `findSpecialBarTextWidget` to read filled segment widths (`anInt263 != 0` on `barId - 1 .. barId - 10`) in `getSpecialEnergy()` and `@yel@` text state in `isSpecialAttackActive()` when configs `300`/`301` are not sent by `2006Scape Server`.
- Fixed `toggleSpecialAttack()` to check known special button IDs first (including `12311` for Abyssal whip instead of container `12323`) and exclude `type == 4` text labels from clickable button fallback.
* chore(client): update plugin repository slug to 2006-Scape/Client-Extensions
Point `PluginRepoClient` at the `2006-Scape/Client-Extensions` repository for downloading external plugins and scripts.
### Client Changes
- `PluginRepoClient.java`:
- Updated `PLUGIN_REPO_SLUG` from `"Dark98/2006scape-plugins"` to `"2006-Scape/Client-Extensions"`.
* Fix remapped quest journal stages
Resolve duplicate stage conditions in the Pirate's Treasure and The Knight's Sword journals after quest stages were remapped. Use Hector's key to distinguish the two Pirate's Treasure objectives sharing stage 2, and place the chest and Falador objectives on separate journal lines. Remove the stale Knight's Sword stage 4 and stage 8 entries, show the sword return objective at stage 6 when the player has the blurite sword, and leave quest progression unchanged.
---------
Co-authored-by: ipkpjersi <ipkpjersi@gmail.com>
35 lines
1.1 KiB
Kotlin
35 lines
1.1 KiB
Kotlin
package plugin.integration.discord
|
|
|
|
import com.rs2.Constants
|
|
import com.rs2.game.players.PlayerHandler
|
|
import net.dv8tion.jda.api.entities.Activity
|
|
|
|
object DiscordActivity {
|
|
|
|
private var lastActivityText: String? = null
|
|
|
|
fun getCurrentActivityText(): String {
|
|
return if (DiscordConfig.displayPlayerCount) {
|
|
val count = PlayerHandler.getPlayerCount()
|
|
if (count == 1) "1 Player Online" else "$count Players Online"
|
|
} else {
|
|
Constants.WEBSITE_LINK
|
|
}
|
|
}
|
|
|
|
fun updateActivity(force: Boolean = false) {
|
|
if (Constants.WORLD != 1) return
|
|
try {
|
|
val jda = DiscordBot.jda ?: return
|
|
val activityText = getCurrentActivityText()
|
|
if (force || activityText != lastActivityText) {
|
|
jda.presence.activity = Activity.playing(activityText)
|
|
println("Discord Activity Updated: $activityText")
|
|
lastActivityText = activityText
|
|
}
|
|
} catch (e: Exception) {
|
|
System.err.println("Could not set Discord activity: $e")
|
|
}
|
|
}
|
|
}
|