Skip to content

Fix palette warnings by removing palette from base nodes#92

Open
Pivert wants to merge 1 commit into
D00Med:masterfrom
Pivert:not_a_suitable_paramtype2
Open

Fix palette warnings by removing palette from base nodes#92
Pivert wants to merge 1 commit into
D00Med:masterfrom
Pivert:not_a_suitable_paramtype2

Conversation

@Pivert
Copy link
Copy Markdown

@Pivert Pivert commented Oct 12, 2025

Pull Request: Fix Palette Warnings by Correcting Paramtype2 Compatibility

Disclaimer

The findings and the PR was issued by AI. Please review accordingly.

Issue Description

This PR addresses a significant issue causing over 1,800 warnings during server startup similar to:

WARNING[ServerStart]: Node scifi_nodes:rock has a palette, but not a suitable paramtype2.

Root Cause Analysis

The problem occurs in nodes.lua where colorable nodes are registered with:

  1. palette = "unifieddyes_palette_extended.png" (assigned at line 535)
  2. paramtype2 = "facedir" (default value from line 528)

According to the Unified Dyes API, these combinations are incompatible. Valid paramtype2 values for palettes are:

  • "color" - for 89-color or 256-color nodes
  • "colorwallmounted" - for 32-color nodes using "wallmounted" mode
  • "colorfacedir" - for nodes using "split" 89-color palettes

Solution Implemented

The fix removes the palette assignment from base nodes while preserving all coloring functionality:

  1. Base nodes: No longer receive palettes but retain ud_param2_colorable group
  2. Colored variants: Continue to have palettes with correct paramtype2 = "color"
  3. Functionality: Airbrush, crafting, and all other coloring features remain intact

Technical Changes

if def.colorable and has_unifieddyes_mod then
-    -- overwrite attributes on the "uncolored" node
-    node_def.palette = "unifieddyes_palette_extended.png"
+    -- Add ud_param2_colorable group to base node to indicate it can be colored
    node_def.groups.ud_param2_colorable = 1
+    -- But don't add palette to base node to avoid paramtype2 mismatch warnings
+    -- The palette will be added only to the "_colored" variant
    node_def.airbrush_replacement_node = "scifi_nodes:"..name.."_colored"
end

Impact

  • ✅ Eliminates 1,800+ startup warnings
  • ✅ Maintains full coloring functionality
  • ✅ Preserves compatibility with Unified Dyes features
  • ✅ No breaking changes for existing worlds or builds

This change follows Unified Dyes best practices by separating the colorable indicator (ud_param2_colorable group) from the actual palette implementation, which should only exist on nodes with compatible paramtype2 values.

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 18448632162

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 0.0%

Totals Coverage Status
Change from base Build 16411495108: 0.0%
Covered Lines: 0
Relevant Lines: 0

💛 - Coveralls

@BuckarooBanzay
Copy link
Copy Markdown
Collaborator

i tried this, the warnings disappear but the nodes can't be colored (for example scifi_nodes:white) anymore :/

oh, and i think i know why the facedir is still in the definition: it is a compatibility thing for already placed nodes, otherwise the param2 values from the facedir would be used as a color-index and you get weirdly colored nodes after the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants