-
Notifications
You must be signed in to change notification settings - Fork 112
Confirm task completion #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
- Renamed renderer/viewer/lib/worldDataEmitter.ts to WorldView.ts - Renamed WorldDataEmitter class to WorldView (kept WorldDataEmitterWorker unchanged) - Updated all imports and references throughout the codebase: - src/watchOptions.ts - src/globals.d.ts - src/appViewer.ts - renderer/playground/baseScene.ts - renderer/viewer/three/panorama.ts - renderer/viewer/lib/worldrendererCommon.ts - Maintained backward compatibility for WorldDataEmitterWorker class
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
WalkthroughThe changes systematically rename the Changes
Sequence Diagram(s)sequenceDiagram
participant AppViewer
participant WorldView
participant World
AppViewer->>WorldView: Instantiate WorldView(world, renderDistance, position)
WorldView->>World: Interact with world data
AppViewer->>WorldView: Call methods (e.g., update, render)
Suggested labels
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
renderer/viewer/lib/WorldView.ts (1)
358-358
: Add missing newline at end of file.The file is missing a newline at the end, which violates the ESLint rule
@stylistic/eol-last
.Add a newline at the end of the file:
} +
src/appViewer.ts (2)
100-100
: Fix indentation and approve the type change.The type change from
WorldDataEmitter
toWorldView
is correct and consistent with the class renaming refactor.Apply this diff to fix the indentation:
- worldView: WorldView | undefined + worldView: WorldView | undefined
187-187
: Fix indentation and approve the constructor change.The constructor call correctly uses the new
WorldView
class with the same parameters (world, renderDistance, startPosition).Apply this diff to fix the indentation:
- this.worldView = new WorldView(world, renderDistance, startPosition) + this.worldView = new WorldView(world, renderDistance, startPosition)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
renderer/playground/baseScene.ts
(2 hunks)renderer/viewer/lib/WorldView.ts
(2 hunks)renderer/viewer/lib/worldrendererCommon.ts
(1 hunks)renderer/viewer/three/panorama.ts
(2 hunks)src/appViewer.ts
(3 hunks)src/globals.d.ts
(1 hunks)src/watchOptions.ts
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`renderer/**/*.ts`: Do not use the global variable `bot` directly in any file un...
renderer/**/*.ts
: Do not use the global variablebot
directly in any file under therenderer/
directory or its subfolders.
In renderer code, all bot/player state and events must be accessed via explicit interfaces, state managers, or passed-in objects, never by referencingbot
directly.
In renderer code (such as inWorldRendererThree
), use theplayerState
property (e.g.,worldRenderer.playerState.gameMode
) to access player state. The implementation forplayerState
lives insrc/mineflayer/playerState.ts
.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/vars-usage.mdc)
List of files the instruction was applied to:
renderer/viewer/lib/worldrendererCommon.ts
renderer/playground/baseScene.ts
renderer/viewer/lib/WorldView.ts
renderer/viewer/three/panorama.ts
`src/**/*.ts`: You may use the global variable `bot` directly in any file under ...
src/**/*.ts
: You may use the global variablebot
directly in any file under thesrc/
directory.
Insrc/
code, you may use the global variableappViewer
fromsrc/appViewer.ts
directly. Do not importappViewer
or usewindow.appViewer
; use the globalappViewer
variable as-is.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/vars-usage.mdc)
List of files the instruction was applied to:
src/globals.d.ts
src/watchOptions.ts
src/appViewer.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, files under renderer/ directory must not access the global `bot` variable directly according to .cursor/rules/vars-usage.mdc. The updateNameTagVisibility method in renderer/viewer/three/entities.ts currently violates this rule by accessing bot.teamMap and bot.username. Team information should be passed through entity update events from the world data emitter instead.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, team information for entities should be inlined into entity update events from the world data emitter rather than accessing the global bot object from renderer code. This maintains better separation of concerns between the data layer and renderer.
renderer/viewer/lib/worldrendererCommon.ts (4)
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, files under renderer/ directory must not access the global `bot` variable directly according to .cursor/rules/vars-usage.mdc. The updateNameTagVisibility method in renderer/viewer/three/entities.ts currently violates this rule by accessing bot.teamMap and bot.username. Team information should be passed through entity update events from the world data emitter instead.
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: Global variables defined for use in `src/` (such as `appViewer` from `src/appViewer.ts`) should be accessed directly as globals, not imported or accessed via `window`, to ensure consistency and avoid ambiguity.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, team information for entities should be inlined into entity update events from the world data emitter rather than accessing the global bot object from renderer code. This maintains better separation of concerns between the data layer and renderer.
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: In the Mineflayer codebase, maintain a strict separation between game logic (in `src/`) and renderer/view logic (in `renderer/`). The renderer must never access the Mineflayer `bot` global directly; instead, it should interact with game state via explicit interfaces or state managers, such as the `playerState` property.
renderer/playground/baseScene.ts (3)
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: Global variables defined for use in `src/` (such as `appViewer` from `src/appViewer.ts`) should be accessed directly as globals, not imported or accessed via `window`, to ensure consistency and avoid ambiguity.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, files under renderer/ directory must not access the global `bot` variable directly according to .cursor/rules/vars-usage.mdc. The updateNameTagVisibility method in renderer/viewer/three/entities.ts currently violates this rule by accessing bot.teamMap and bot.username. Team information should be passed through entity update events from the world data emitter instead.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, team information for entities should be inlined into entity update events from the world data emitter rather than accessing the global bot object from renderer code. This maintains better separation of concerns between the data layer and renderer.
src/globals.d.ts (5)
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: Global variables defined for use in `src/` (such as `appViewer` from `src/appViewer.ts`) should be accessed directly as globals, not imported or accessed via `window`, to ensure consistency and avoid ambiguity.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, files under renderer/ directory must not access the global `bot` variable directly according to .cursor/rules/vars-usage.mdc. The updateNameTagVisibility method in renderer/viewer/three/entities.ts currently violates this rule by accessing bot.teamMap and bot.username. Team information should be passed through entity update events from the world data emitter instead.
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: Globals that are safe to use without window prefixes are documented in `src/globals.d.ts`.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, team information for entities should be inlined into entity update events from the world data emitter rather than accessing the global bot object from renderer code. This maintains better separation of concerns between the data layer and renderer.
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: In the Mineflayer codebase, maintain a strict separation between game logic (in `src/`) and renderer/view logic (in `renderer/`). The renderer must never access the Mineflayer `bot` global directly; instead, it should interact with game state via explicit interfaces or state managers, such as the `playerState` property.
renderer/viewer/lib/WorldView.ts (3)
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, files under renderer/ directory must not access the global `bot` variable directly according to .cursor/rules/vars-usage.mdc. The updateNameTagVisibility method in renderer/viewer/three/entities.ts currently violates this rule by accessing bot.teamMap and bot.username. Team information should be passed through entity update events from the world data emitter instead.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, team information for entities should be inlined into entity update events from the world data emitter rather than accessing the global bot object from renderer code. This maintains better separation of concerns between the data layer and renderer.
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: Global variables defined for use in `src/` (such as `appViewer` from `src/appViewer.ts`) should be accessed directly as globals, not imported or accessed via `window`, to ensure consistency and avoid ambiguity.
src/watchOptions.ts (3)
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: Global variables defined for use in `src/` (such as `appViewer` from `src/appViewer.ts`) should be accessed directly as globals, not imported or accessed via `window`, to ensure consistency and avoid ambiguity.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, files under renderer/ directory must not access the global `bot` variable directly according to .cursor/rules/vars-usage.mdc. The updateNameTagVisibility method in renderer/viewer/three/entities.ts currently violates this rule by accessing bot.teamMap and bot.username. Team information should be passed through entity update events from the world data emitter instead.
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: Globals that are safe to use without window prefixes are documented in `src/globals.d.ts`.
src/appViewer.ts (4)
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: Global variables defined for use in `src/` (such as `appViewer` from `src/appViewer.ts`) should be accessed directly as globals, not imported or accessed via `window`, to ensure consistency and avoid ambiguity.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, files under renderer/ directory must not access the global `bot` variable directly according to .cursor/rules/vars-usage.mdc. The updateNameTagVisibility method in renderer/viewer/three/entities.ts currently violates this rule by accessing bot.teamMap and bot.username. Team information should be passed through entity update events from the world data emitter instead.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, team information for entities should be inlined into entity update events from the world data emitter rather than accessing the global bot object from renderer code. This maintains better separation of concerns between the data layer and renderer.
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: In the Mineflayer codebase, maintain a strict separation between game logic (in `src/`) and renderer/view logic (in `renderer/`). The renderer must never access the Mineflayer `bot` global directly; instead, it should interact with game state via explicit interfaces or state managers, such as the `playerState` property.
renderer/viewer/three/panorama.ts (3)
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: Global variables defined for use in `src/` (such as `appViewer` from `src/appViewer.ts`) should be accessed directly as globals, not imported or accessed via `window`, to ensure consistency and avoid ambiguity.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, files under renderer/ directory must not access the global `bot` variable directly according to .cursor/rules/vars-usage.mdc. The updateNameTagVisibility method in renderer/viewer/three/entities.ts currently violates this rule by accessing bot.teamMap and bot.username. Team information should be passed through entity update events from the world data emitter instead.
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-06-23T17:08:19.477Z
Learning: Globals that are safe to use without window prefixes are documented in `src/globals.d.ts`.
🧬 Code Graph Analysis (4)
renderer/playground/baseScene.ts (1)
renderer/viewer/lib/WorldView.ts (1)
WorldView
(37-358)
src/watchOptions.ts (1)
renderer/viewer/lib/WorldView.ts (1)
WorldView
(37-358)
src/appViewer.ts (1)
renderer/viewer/lib/WorldView.ts (1)
WorldView
(37-358)
renderer/viewer/three/panorama.ts (1)
renderer/viewer/lib/WorldView.ts (1)
WorldView
(37-358)
🪛 ESLint
renderer/viewer/lib/WorldView.ts
[error] 358-358: Newline required at end of file but not found.
(@stylistic/eol-last)
src/appViewer.ts
[error] 100-100: Expected indentation of 2 spaces but found 6.
(@stylistic/indent)
[error] 187-187: Expected indentation of 4 spaces but found 10.
(@stylistic/indent)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-and-deploy
🔇 Additional comments (11)
renderer/viewer/lib/worldrendererCommon.ts (1)
18-18
: LGTM! Import path correctly updated for the renamed file.The import path has been properly updated to reflect the file rename from
worldDataEmitter.ts
toWorldView.ts
while maintaining the import ofWorldDataEmitterWorker
for backward compatibility.src/globals.d.ts (1)
15-15
: LGTM! Global type declaration correctly updated for the renamed class.The global type declaration has been properly updated to use the new
WorldView
class name and import path, maintaining consistency with the refactoring.renderer/viewer/three/panorama.ts (2)
7-7
: LGTM! Import correctly updated to use the renamed class.The import has been properly updated to use
WorldView
from the new file location, consistent with the refactoring.
189-189
: LGTM! Class instantiation correctly updated to use the renamed class.The instantiation has been properly updated to use
WorldView
instead ofWorldDataEmitter
while maintaining the same constructor parameters.renderer/playground/baseScene.ts (2)
17-17
: LGTM! Import correctly updated to use the renamed class.The import has been properly updated to use
WorldView
from the new file location, consistent with the refactoring.
181-181
: LGTM! Class instantiation correctly updated to use the renamed class.The instantiation has been properly updated to use
WorldView
instead ofWorldDataEmitter
while maintaining the same constructor parameters.renderer/viewer/lib/WorldView.ts (2)
37-37
: LGTM! Class name correctly updated as part of the refactoring.The class has been properly renamed from
WorldDataEmitter
toWorldView
, which is the core change of this refactoring.
41-41
: LGTM! Property type correctly updated to match the renamed class.The
emitter
property type has been properly updated to useWorldView
instead ofWorldDataEmitter
, maintaining consistency with the class rename.src/appViewer.ts (1)
1-1
: LGTM - Import update aligns with class renaming.The import statement correctly updates to use the new
WorldView
class name while maintaining the same module structure.src/watchOptions.ts (2)
5-5
: LGTM - Import update aligns with class renaming.The import statement correctly updates to use the new
WorldView
class name while maintaining the same module structure.
120-120
: LGTM - Function parameter type correctly updated.The function parameter type change from
WorldDataEmitter
toWorldView
is consistent with the class renaming refactor. The function body continues to access valid properties likekeepChunksDistance
on the renamed class.
Summary by CodeRabbit