Skip to content
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

fix: light blocks are rendered as unknown blocks #251

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

Phoenix616
Copy link

@Phoenix616 Phoenix616 commented Jan 24, 2025

User description

This fixes that light blocks would show up as unknown blocks with a question mark texture when they should be invisible

The bug:
image

After the fix:
image


PR Type

Bug fix


Description

  • Fixed rendering issue where light blocks appeared as unknown blocks.

  • Added light to the set of invisible blocks in the mesher constants.


Changes walkthrough 📝

Relevant files
Bug fix
worldConstants.ts
Add light blocks to invisible blocks set                                 

prismarine-viewer/viewer/lib/mesher/worldConstants.ts

  • Added light to the INVISIBLE_BLOCKS set.
  • Ensures light blocks are treated as invisible.
  • +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Copy link

    codesandbox bot commented Jan 24, 2025

    Review or Edit in CodeSandbox

    Open the branch in Web EditorVS CodeInsiders

    Open Preview

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Remove duplicate constant declaration

    Remove the duplicate line that defines INVISIBLE_BLOCKS. Currently, the same
    constant is being declared twice, which will cause a compilation error.

    prismarine-viewer/viewer/lib/mesher/worldConstants.ts [1-2]

     export const INVISIBLE_BLOCKS = new Set(['air', 'void_air', 'cave_air', 'barrier', 'light'])
    -export const INVISIBLE_BLOCKS = new Set(['air', 'void_air', 'cave_air', 'barrier'])
    • Apply this suggestion
    Suggestion importance[1-10]: 10

    Why: The suggestion correctly identifies a critical issue where the same constant is declared twice, which would cause a compilation error. Removing the duplicate declaration is essential for the code to work properly.

    10

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant