-
Notifications
You must be signed in to change notification settings - Fork 94
feat: Version-accurate models rendering #294
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
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
/deploy |
WalkthroughThe changes update the dependency version of the Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client Message
participant H as HandleMessage Function
participant M as setMesherData Function
C->>H: Send "mesherData" message with data and config
H->>M: Call setMesherData(blockstatesModels, blocksAtlas, (outputFormat==='webgpu'), true, version)
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
/deploy |
Deployed to Vercel Preview: https://prismarine-7vgr6r8r1-zaro.vercel.app |
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 (1)
renderer/viewer/lib/mesher/mesher.ts (1)
96-96
: Added version-specific model rendering support.The modification adds two new parameters to the
setMesherData
function call:
- A hardcoded boolean value
true
(presumably a flag for some feature)data.config.version
- The version parameter needed for accurate model renderingThis change aligns with the PR objective to add version-specific mesher data handling.
While the code works as intended, consider using a named constant for the hardcoded boolean value to improve code readability and maintainability:
- setMesherData(data.blockstatesModels, data.blocksAtlas, data.config.outputFormat === 'webgpu', true, data.config.version) + const USE_VERSION_SPECIFIC_MODELS = true; + setMesherData(data.blockstatesModels, data.blocksAtlas, data.config.outputFormat === 'webgpu', USE_VERSION_SPECIFIC_MODELS, data.config.version)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
package.json
(1 hunks)renderer/viewer/lib/mesher/mesher.ts
(1 hunks)
🔇 Additional comments (2)
package.json (1)
152-152
:✅ Verification successful
Dependency update for mc-assets package.
The
mc-assets
dependency has been updated from a previous version to^0.2.42
. This update appears to support the new version-specific mesher data handling feature introduced in this PR.
🏁 Script executed:
#!/bin/bash # Check for the changelog or release notes for mc-assets to understand what's new in version 0.2.42 # Try to find information about the package from npm echo "Checking mc-assets package information..." curl -s https://registry.npmjs.org/mc-assets | jq '.["dist-tags"], .versions["0.2.42"].description' # Check if the package exists on GitHub echo "Checking for repository information..." curl -s https://registry.npmjs.org/mc-assets | jq '.repository.url' # If it's on GitHub, we could fetch release notes, but without knowing the exact repo URL, we'll skip thatLength of output: 461
Confirmed Dependency Update for mc-assets to ^0.2.42
The updated dependency in
package.json
(line 152) has been verified against the npm registry. The current release, marked as"latest": "0.2.42"
, and the repository URL (git+https://github.com/zardoy/mc-assets.git
) confirm that the package update is valid. The upgrade aligns with the new mesher data handling feature introduced in this PR.renderer/viewer/lib/mesher/mesher.ts (1)
88-90
:✅ Verification successful
Ensure consistent versioning and configuration.
The code initializes the world with
data.config.version
if it doesn't exist yet, then updates the configuration. This logic now works with the new version-specific mesher data handling.Let's check if there are any potential issues with how version information is handled elsewhere in the codebase:
🏁 Script executed:
#!/bin/bash # Check how version is used in the World class and other related components echo "Checking how version is used in the codebase..." # Look for World constructor usage with version parameter echo "=== World constructor with version parameter ===" rg -A 3 -B 3 "new World\([^)]*version" --glob "!node_modules/**" # Look for config.version usage in the codebase echo "=== config.version usage ===" rg -A 2 -B 2 "config\.version" --glob "!node_modules/**" # Check if there are any places that might need to be updated for version-accurate rendering echo "=== Places potentially related to mesher data ===" rg -A 2 -B 2 "mesherData|blockstatesModels|setMesherData" --glob "!node_modules/**"Length of output: 10006
Consistent version initialization confirmed
The version is consistently handled across the codebase. The reviewed snippet in
renderer/viewer/lib/mesher/mesher.ts
:world ??= new World(data.config.version) world.config = { ...world.config, ...data.config } globalThis.world = worldcorrectly initializes the world with
data.config.version
if necessary, and then updates its configuration. Verification shows that theWorld
class and related functions are using the version consistently, including within mesher data handling and config updates.
PR Type
Enhancement
Description
Added support for version-specific mesher data handling.
Updated
setMesherData
to include version and additional parameters.Changes walkthrough 📝
mesher.ts
Update mesher data handling for version accuracy
renderer/viewer/lib/mesher/mesher.ts
setMesherData
to accept version parameter.Summary by CodeRabbit