mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-22 15:33:52 +01:00
fix hue table type for wallmounted in craft helper
This commit is contained in:
parent
992bca7e15
commit
b49ed1724b
4
API.md
4
API.md
@ -124,7 +124,9 @@ If your mod used the old paradigm where you craft a neutral-colored item, place
|
||||
|
||||
`type` can be "shapeless" or unspecified/`nil`, and works the same as in the normal call.
|
||||
|
||||
`recipe` is the same as in the normal call, except that Unified Dyes will replace all instances of the string "NEUTRAL_NODE" with the item specified in the preceding `neutral_node` field (this can be the same as the output node, minus the stack size anyway). Every instance of "MAIN_DYE" will be replaced with a portion of dye, as Unified Dyes' recipe helper works through its color lists (i.e. this key will become whatever dye is needed for each recipe).
|
||||
`neutral_node` should specify the name of whatever item or node serves as the base, neutrally-colored material in your recipe. If there isn't one, set this to an empty string.
|
||||
|
||||
`recipe` is the same as in the normal call, except that Unified Dyes will replace all instances of the string "NEUTRAL_NODE" with the item specified in the preceding `neutral_node` field. Every instance of "MAIN_DYE" will be replaced with a portion of dye, as Unified Dyes' recipe helper works through its color lists (i.e. this key will become whatever dye is needed for each recipe).
|
||||
|
||||
If your mod never has never used Unified Dyes at all, in short, do the following:
|
||||
|
||||
|
8
init.lua
8
init.lua
@ -185,7 +185,11 @@ end
|
||||
local function register_c(craft, hue, sat, val)
|
||||
local color = ""
|
||||
if val then
|
||||
if craft.palette == "wallmounted" then
|
||||
color = "dye:"..val..hue..sat
|
||||
else
|
||||
color = "dye:"..val..hue[1]..sat
|
||||
end
|
||||
else
|
||||
color = "dye:"..hue -- if val is nil, then it's grey.
|
||||
end
|
||||
@ -230,6 +234,10 @@ function unifieddyes.register_color_craft(craft)
|
||||
for _,val in ipairs(vals_table) do
|
||||
for _,sat in ipairs(sats_table) do
|
||||
|
||||
print("[UD] craft = ")
|
||||
print(dump(craft))
|
||||
print("[UD] hue = "..dump(hue).." ~~ sat = "..dump(sat).." ~~ val = "..dump(val))
|
||||
|
||||
if sat == "_s50" and val ~= "" and val ~= "medium_" and val ~= "dark_" then break end
|
||||
register_c(craft, hue, sat, val)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user