update blox, coloredwood, farming, homedecor, unified bricks, unified dyes, and Jordach's skin
This commit is contained in:
parent
2a51091530
commit
818eabb92f
@ -710,18 +710,4 @@ minetest.register_lbm({
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "blox:recolor_stuff",
|
||||
label = "Convert 89-color blocks to use UD extended palette",
|
||||
run_at_every_load = false,
|
||||
nodenames = blox.old_89_color_nodes,
|
||||
action = function(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_string("palette") ~= "ext" then
|
||||
minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] })
|
||||
meta:set_string("palette", "ext")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
print("Blox Mod [" ..version.. "] Loaded!")
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- Colored Wood mod by Vanessa Ezekowitz
|
||||
-- Colored Wood mod by Vanessa "VanessaE" Dannenberg
|
||||
-- based on my unifieddyes template.
|
||||
--
|
||||
-- License: WTFPL
|
||||
@ -9,11 +9,7 @@
|
||||
-- Colored wood is created by placing a regular wood block on the ground
|
||||
-- and then right-clicking on it with some dye.
|
||||
-- All materials are flammable and can be used as fuel.
|
||||
--
|
||||
-- Hues are on a 30 degree spacing starting at red = 0 degrees.
|
||||
-- "s50" in a file/item name means "saturation: 50%".
|
||||
-- Texture brightness levels for the colors are 100%, 66% ("medium"),
|
||||
-- and 33% ("dark").
|
||||
|
||||
|
||||
coloredwood = {}
|
||||
|
||||
@ -22,96 +18,6 @@ if minetest.settings:get_bool("coloredwood_enable_stairsplus") == false or not m
|
||||
coloredwood.enable_stairsplus = false
|
||||
end
|
||||
|
||||
coloredwood.shades = {
|
||||
"dark_",
|
||||
"medium_",
|
||||
"" -- represents "no special shade name", e.g. full.
|
||||
}
|
||||
|
||||
coloredwood.shades2 = {
|
||||
"Dark ",
|
||||
"Medium ",
|
||||
"" -- represents "no special shade name", e.g. full.
|
||||
}
|
||||
|
||||
coloredwood.default_hues = {
|
||||
"white",
|
||||
"grey",
|
||||
"dark_grey",
|
||||
"black",
|
||||
"violet",
|
||||
"blue",
|
||||
"cyan",
|
||||
"dark_green",
|
||||
"green",
|
||||
"yellow",
|
||||
"orange",
|
||||
"red",
|
||||
"magenta"
|
||||
}
|
||||
|
||||
coloredwood.hues = {
|
||||
"red",
|
||||
"orange",
|
||||
"yellow",
|
||||
"lime",
|
||||
"green",
|
||||
"aqua",
|
||||
"cyan",
|
||||
"skyblue",
|
||||
"blue",
|
||||
"violet",
|
||||
"magenta",
|
||||
"redviolet"
|
||||
}
|
||||
|
||||
coloredwood.hues2 = {
|
||||
"Red ",
|
||||
"Orange ",
|
||||
"Yellow ",
|
||||
"Lime ",
|
||||
"Green ",
|
||||
"Aqua ",
|
||||
"Cyan ",
|
||||
"Sky Blue ",
|
||||
"Blue ",
|
||||
"Violet ",
|
||||
"Magenta ",
|
||||
"Red-violet "
|
||||
}
|
||||
|
||||
coloredwood.greys = {
|
||||
"black",
|
||||
"darkgrey",
|
||||
"grey",
|
||||
"lightgrey",
|
||||
"white"
|
||||
}
|
||||
|
||||
coloredwood.greys2 = {
|
||||
"Black ",
|
||||
"Dark Grey ",
|
||||
"Medium Grey ",
|
||||
"Light Grey ",
|
||||
"White "
|
||||
}
|
||||
|
||||
coloredwood.greys3 = {
|
||||
"dye:black",
|
||||
"dye:dark_grey",
|
||||
"dye:grey",
|
||||
"dye:light_grey",
|
||||
"dye:white"
|
||||
}
|
||||
|
||||
coloredwood.hues_plus_greys = {}
|
||||
|
||||
for _, hue in ipairs(coloredwood.hues) do
|
||||
table.insert(coloredwood.hues_plus_greys, hue)
|
||||
end
|
||||
|
||||
table.insert(coloredwood.hues_plus_greys, "grey")
|
||||
|
||||
-- helper functions
|
||||
|
||||
local function is_stairsplus(name, colorized)
|
||||
@ -161,7 +67,7 @@ minetest.register_node("coloredwood:wood_block", {
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
for _, color in ipairs(coloredwood.hues_plus_greys) do
|
||||
for _, color in ipairs(unifieddyes.HUES_WITH_GREY) do
|
||||
|
||||
-- moreblocks/stairsplus support
|
||||
|
||||
@ -197,17 +103,29 @@ if coloredwood.enable_stairsplus then
|
||||
|
||||
for _, i in pairs(minetest.registered_nodes) do
|
||||
|
||||
if (string.find(i.name, "moreblocks:stair_wood")
|
||||
or string.find(i.name, "moreblocks:slab_wood")
|
||||
or string.find(i.name, "moreblocks:panel_wood")
|
||||
or string.find(i.name, "moreblocks:micro_wood")
|
||||
or string.find(i.name, "moreblocks:slope_wood"))
|
||||
local chk = string.sub(i.name, 1, 20)
|
||||
|
||||
if chk == "moreblocks:stair_woo"
|
||||
or chk == "moreblocks:slab_wood"
|
||||
or chk == "moreblocks:panel_woo"
|
||||
or chk == "moreblocks:micro_woo"
|
||||
or chk == "moreblocks:slope_woo"
|
||||
and not string.find(i.name, "wood_tile") then
|
||||
|
||||
local class = string.sub(i.name, 12, 15)
|
||||
local shape = string.sub(i.name, 22)
|
||||
|
||||
table.insert(coloredwood_cuts, i.name)
|
||||
|
||||
if chk ~= "moreblocks:slab_wood" then
|
||||
class = string.sub(i.name, 12, 16)
|
||||
shape = string.sub(i.name, 23)
|
||||
end
|
||||
|
||||
minetest.override_item(i.name, {
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, not_in_creative_inventory=1, ud_param2_colorable = 1},
|
||||
paramtype2 = "colorfacedir",
|
||||
airbrush_replacement_node = "coloredwood:"..class.."_wood_grey_"..shape
|
||||
})
|
||||
end
|
||||
end
|
||||
@ -277,53 +195,4 @@ unifieddyes.register_color_craft({
|
||||
}
|
||||
})
|
||||
|
||||
-- ============================
|
||||
-- convert the old static nodes
|
||||
|
||||
coloredwood.old_static_nodes = {}
|
||||
coloredwood.old_13_color_nodes = {}
|
||||
|
||||
for _, hue in ipairs(coloredwood.hues) do
|
||||
table.insert(coloredwood.old_13_color_nodes, "coloredwood:wood_"..hue)
|
||||
for _, sat in ipairs({"", "_s50"}) do
|
||||
for _, val in ipairs ({"dark_", "medium_", "light_", ""}) do
|
||||
table.insert(coloredwood.old_static_nodes, "coloredwood:wood_"..val..hue..sat)
|
||||
table.insert(coloredwood.old_static_nodes, "coloredwood:fence_"..val..hue..sat)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, shade in ipairs(coloredwood.greys) do
|
||||
table.insert(coloredwood.old_static_nodes, "coloredwood:wood_"..shade)
|
||||
table.insert(coloredwood.old_static_nodes, "coloredwood:fence_"..shade)
|
||||
end
|
||||
|
||||
table.insert(coloredwood.old_13_color_nodes, "coloredwood:wood_grey")
|
||||
|
||||
|
||||
-- add all of the stairsplus nodes, if moreblocks is installed.
|
||||
if coloredwood.enable_stairsplus then
|
||||
for _, shape in ipairs(circular_saw.names) do
|
||||
local a = shape[1]
|
||||
local b = shape[2]
|
||||
for _, hue in ipairs(coloredwood.hues) do
|
||||
for _, shade in ipairs(coloredwood.shades) do
|
||||
table.insert(coloredwood.old_static_nodes, "coloredwood:"..a.."_wood_"..shade..hue..b)
|
||||
table.insert(coloredwood.old_static_nodes, "coloredwood:"..a.."_wood_"..shade..hue.."_s50"..b)
|
||||
end
|
||||
table.insert(coloredwood.old_static_nodes, "coloredwood:"..a.."_wood_light_"..hue..b) -- light doesn't have extra shades or s50
|
||||
end
|
||||
end
|
||||
|
||||
for _, shape in ipairs(circular_saw.names) do
|
||||
local a = shape[1]
|
||||
local b = shape[2]
|
||||
for _, hue in ipairs(coloredwood.greys) do
|
||||
for _, shade in ipairs(coloredwood.shades) do
|
||||
table.insert(coloredwood.old_static_nodes, "coloredwood:"..a.."_wood_"..hue..b)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
print("[Colored Wood] Loaded!")
|
||||
|
@ -13,7 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t
|
||||
|
||||
### Changelog:
|
||||
|
||||
- 1.38 - Pumpkin grows into block, use chopping board to cut into slices, same with melon block, cocoa pods are no longer walkable
|
||||
- 1.38 - Pumpkin grows into block, use chopping board to cut into 4x slices, same with melon block, 2x2 slices makes a block, cocoa pods are no longer walkable
|
||||
- 1.37 - Added custom 'growth_check(pos, nodename) function for crop nodes to use (check cocoa.lua for example)
|
||||
- 1.36 - Added Beetroot, Beetroot Soup (6x beetroot, 1x bowl), fix register_plant() issue, add new recipes
|
||||
- 1.35 - Deprecated bronze/mese/diamond hoe's, added hoe bomb and deprecated hoe's as lucky block prizes
|
||||
|
@ -15,15 +15,14 @@ minetest.register_craftitem("farming:melon_slice", {
|
||||
minetest.register_craft({
|
||||
output = "farming:melon_8",
|
||||
recipe = {
|
||||
{"farming:melon_slice", "farming:melon_slice", "farming:melon_slice"},
|
||||
{"farming:melon_slice", "farming:melon_slice", "farming:melon_slice"},
|
||||
{"farming:melon_slice", "farming:melon_slice", "farming:melon_slice"},
|
||||
{"farming:melon_slice", "farming:melon_slice"},
|
||||
{"farming:melon_slice", "farming:melon_slice"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "farming:melon_slice 9",
|
||||
output = "farming:melon_slice 4",
|
||||
recipe = {"farming:melon_8", "farming:cutting_board"},
|
||||
replacements = {{"farming:cutting_board", "farming:cutting_board"}},
|
||||
})
|
||||
|
@ -19,15 +19,14 @@ minetest.register_craftitem("farming:pumpkin_slice", {
|
||||
minetest.register_craft({
|
||||
output = "farming:pumpkin",
|
||||
recipe = {
|
||||
{"farming:pumpkin_slice", "farming:pumpkin_slice", "farming:pumpkin_slice"},
|
||||
{"farming:pumpkin_slice", "farming:pumpkin_slice", "farming:pumpkin_slice"},
|
||||
{"farming:pumpkin_slice", "farming:pumpkin_slice", "farming:pumpkin_slice"},
|
||||
{"farming:pumpkin_slice", "farming:pumpkin_slice"},
|
||||
{"farming:pumpkin_slice", "farming:pumpkin_slice"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "farming:pumpkin_slice 9",
|
||||
output = "farming:pumpkin_slice 4",
|
||||
recipe = {"farming:pumpkin", "farming:cutting_board"},
|
||||
replacements = {{"farming:cutting_board", "farming:cutting_board"}},
|
||||
})
|
||||
|
@ -3273,6 +3273,19 @@ for i in ipairs(homedecor.banister_materials) do
|
||||
})
|
||||
end
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "",
|
||||
palette = "split",
|
||||
neutral_node = "homedecor:banister_wood_horizontal",
|
||||
type = "shapeless",
|
||||
output_prefix = "homedecor:banister_wood_horizontal_",
|
||||
output_suffix = "",
|
||||
recipe = {
|
||||
"NEUTRAL_NODE",
|
||||
"MAIN_DYE",
|
||||
}
|
||||
})
|
||||
|
||||
if (minetest.get_modpath("technic") and minetest.get_modpath("dye") and minetest.get_modpath("bees")) then
|
||||
technic.register_separating_recipe({ input = {"bees:wax 1"}, output = {"homedecor:oil_extract 2","dye:yellow 1"} })
|
||||
end
|
||||
|
@ -257,6 +257,8 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
|
||||
if not pos then return itemstack end
|
||||
|
||||
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
||||
local meta = itemstack:get_meta()
|
||||
local pindex = meta:get_int("palette_index")
|
||||
|
||||
local abovepos = { x=pos.x, y=pos.y+1, z=pos.z }
|
||||
local abovenode = minetest.get_node(abovepos)
|
||||
@ -371,7 +373,7 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.set_node(pos, {name = new_place_name, param2 = fdir})
|
||||
minetest.set_node(pos, {name = new_place_name, param2 = fdir+pindex})
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -483,23 +483,19 @@ for _, side in ipairs({"diagonal_left", "diagonal_right", "horizontal"}) do
|
||||
local name, matdesc, tile1, tile2 = unpack(mat)
|
||||
local nodename = "banister_"..name.."_"..side
|
||||
|
||||
local groups = { snappy = 3, not_in_creative_inventory = 1 }
|
||||
local cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -9/16, -3/16, 5/16, 9/16, 24/16, 8/16 }
|
||||
}
|
||||
|
||||
if side == "horizontal" then
|
||||
groups = { snappy = 3 }
|
||||
cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -8/16, -8/16, 5/16, 8/16, 8/16, 8/16 }
|
||||
}
|
||||
else
|
||||
minetest.register_alias(string.gsub("homedecor:"..nodename, "diagonal_", ""), "homedecor:"..nodename)
|
||||
end
|
||||
|
||||
homedecor.register(nodename, {
|
||||
local def = {
|
||||
description = S("Banister for Stairs (@1, @2)", matdesc, sidedesc),
|
||||
mesh = "homedecor_banister_"..side..".obj",
|
||||
tiles = {
|
||||
@ -507,12 +503,35 @@ for _, side in ipairs({"diagonal_left", "diagonal_right", "horizontal"}) do
|
||||
tile2,
|
||||
},
|
||||
inventory_image = "homedecor_banister_"..name.."_inv.png",
|
||||
groups = groups,
|
||||
selection_box = cbox,
|
||||
collision_box = cbox,
|
||||
groups = { snappy = 3},
|
||||
on_place = homedecor.place_banister,
|
||||
drop = "homedecor:banister_"..name.."_horizontal",
|
||||
})
|
||||
}
|
||||
|
||||
if side ~= "horizontal" then
|
||||
def.groups.not_in_creative_inventory = 1
|
||||
end
|
||||
|
||||
if name == "wood" then
|
||||
def.airbrush_replacement_node = "homedecor:banister_wood_"..side.."_grey"
|
||||
def.groups.ud_param2_colorable = 1
|
||||
def.paramtype2 = "colorfacedir"
|
||||
end
|
||||
homedecor.register(nodename, def)
|
||||
|
||||
if name == "wood" then
|
||||
local nn = "homedecor:"..nodename
|
||||
local def2 = table.copy(minetest.registered_items[nn])
|
||||
def2.tiles = {
|
||||
homedecor.white_wood,
|
||||
homedecor.white_wood
|
||||
}
|
||||
def2.inventory_image = "homedecor_banister_wood_colored_inv.png"
|
||||
|
||||
unifieddyes.generate_split_palette_nodes(nn, def2, "homedecor:banister_"..name.."_horizontal")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
BIN
homedecor/textures/homedecor_banister_wood_colored_inv.png
Normal file
BIN
homedecor/textures/homedecor_banister_wood_colored_inv.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
@ -1,3 +1,4 @@
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
lrfurn = {}
|
||||
screwdriver = screwdriver or {}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.7 KiB |
@ -379,24 +379,4 @@ minetest.register_lbm({
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "unifiedbricks:recolor_bricks",
|
||||
label = "Convert 89-color bricks to use UD extended palette",
|
||||
run_at_every_load = false,
|
||||
nodenames = {
|
||||
"unifiedbricks:clayblock",
|
||||
"unifiedbricks:brickblock",
|
||||
"unifiedbricks:brickblock_multicolor_dark",
|
||||
"unifiedbricks:brickblock_multicolor_medium",
|
||||
"unifiedbricks:brickblock_multicolor_light",
|
||||
},
|
||||
action = function(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_string("palette") ~= "ext" then
|
||||
minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] })
|
||||
meta:set_string("palette", "ext")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
print("[UnifiedBricks] Loaded!")
|
||||
|
@ -117,12 +117,17 @@ This will loop through all of Unified Dyes' color lists, generating one recipe f
|
||||
|
||||
`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 field will become whatever dye is needed for each recipe).
|
||||
|
||||
`output_prefix` and `output_suffix`, if specified (must use both if at all), will cause the recipe registration to ignore the usual `output` field, and instead set to the output item to `output_prefix` + (hue) + `output_suffix`. Used for mods that use the split 89-color palette. `hue` will thus be one of the 12 hues, or "grey", as defined by the split palettes.
|
||||
`output_prefix` and `output_suffix`, if specified (must use both if at all), will cause the recipe registration to set to the output item to `output_prefix` + (hue) + `output_suffix` + `output`. Used for mods that use the split 89-color palette. `hue` will thus be one of the 12 hues, or "grey", as defined by the split palettes. In this situation, you can set `output` to your recipe yield (with a leading space) if needed. For example, if the prefix is "foo:bar", the suffix is "baz", and the output is set to " 3", then the craft helper will generate output item strings of the form "foo:bar_COLOR_baz 3", for each color in the table.
|
||||
|
||||
**`unifieddyes.make_colored_itemstack(itemstack, palette, color)`**
|
||||
|
||||
Makes a colored itemstack out of the given `itemstack` and `color` (as a dye, e.g. "dye:dark_red_s50"), setting the correct index per the `palette` field, which works as described above for `unifieddyes.getpaletteidx()`. Said itemstack is returned as a string suitable for use as the output field of a craft recipe, equal in size to the itemstack passed into the function (e.g. if you give it "mymod:colored_node 7", it'll return a stack of 7 colored items).
|
||||
|
||||
**`unifieddyes.generate_split_palette_nodes(name, def, drop)`**
|
||||
|
||||
Does just what it sounds like - it registers all the nodes that are needed for a given base node (`def`) to be able to use the split palette, each named according to `name`, with the palette hue appended. If a custom drop is needed, it can be passed along (only a string is allowed here, specifying a single item).
|
||||
|
||||
|
||||
#### Tables
|
||||
|
||||
In addition to the above API calls, Unified Dyes provides several useful tables
|
||||
|
@ -58,6 +58,9 @@ unifieddyes.HUES = {
|
||||
"redviolet"
|
||||
}
|
||||
|
||||
unifieddyes.HUES_WITH_GREY = table.copy(unifieddyes.HUES)
|
||||
table.insert(unifieddyes.HUES_WITH_GREY, "grey")
|
||||
|
||||
-- the names of the various colors here came from http://www.procato.com/rgb+index/
|
||||
|
||||
unifieddyes.HUES_EXTENDED = {
|
||||
@ -203,6 +206,35 @@ end
|
||||
function unifieddyes.after_dig_node(foo)
|
||||
end
|
||||
|
||||
-- This helper function creates multiple copies of the passed node,
|
||||
-- for the split palette - one per hue, plus grey - and assigns
|
||||
-- proper palettes and other attributes
|
||||
|
||||
function unifieddyes.generate_split_palette_nodes(name, def, drop)
|
||||
for _, color in ipairs(unifieddyes.HUES_WITH_GREY) do
|
||||
local def2 = table.copy(def)
|
||||
local desc_color = string.gsub(string.upper(string.sub(color, 1, 1))..string.sub(color, 2), "_", " ")
|
||||
if string.sub(def2.description, -1) == ")" then
|
||||
def2.description = string.sub(def2.description, 1, -2)..", "..desc_color..")"
|
||||
else
|
||||
def2.description = def2.description.."("..desc_color..")"
|
||||
end
|
||||
def2.palette = "unifieddyes_palette_"..color.."s.png"
|
||||
def2.paramtype2 = "colorfacedir"
|
||||
def2.groups.ud_param2_colorable = 1
|
||||
|
||||
if drop then
|
||||
def2.drop = {
|
||||
items = {
|
||||
{items = {drop.."_"..color}, inherit_color = true },
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
minetest.register_node(":"..name.."_"..color, def2)
|
||||
end
|
||||
end
|
||||
|
||||
-- This helper function creates a colored itemstack
|
||||
|
||||
function unifieddyes.make_colored_itemstack(item, palette, color)
|
||||
@ -233,18 +265,19 @@ local function register_c(craft, hue, sat, val)
|
||||
recipe = string.gsub(recipe, "NEUTRAL_NODE", craft.neutral_node)
|
||||
local newrecipe = minetest.deserialize(recipe)
|
||||
|
||||
local output = craft.output
|
||||
local coutput = craft.output or ""
|
||||
local output = coutput
|
||||
if craft.output_prefix then
|
||||
if craft.palette ~= "split" then
|
||||
output = craft.output_prefix..color..craft.output_suffix
|
||||
output = craft.output_prefix..color..craft.output_suffix..coutput
|
||||
else
|
||||
if hue == "white" or hue == "black" or string.find(hue, "grey") then
|
||||
output = craft.output_prefix.."grey"..craft.output_suffix
|
||||
output = craft.output_prefix.."grey"..craft.output_suffix..coutput
|
||||
elseif hue == "pink" then
|
||||
dye = "dye:light_red"
|
||||
output = craft.output_prefix.."red"..craft.output_suffix
|
||||
output = craft.output_prefix.."red"..craft.output_suffix..coutput
|
||||
else
|
||||
output = craft.output_prefix..hue..craft.output_suffix
|
||||
output = craft.output_prefix..hue..craft.output_suffix..coutput
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -646,21 +679,24 @@ function unifieddyes.on_airbrush(itemstack, player, pointed_thing)
|
||||
return
|
||||
end
|
||||
|
||||
if not def.palette or not (def.groups and def.groups.ud_param2_colorable > 0) then
|
||||
if not (def.groups and def.groups.ud_param2_colorable and def.groups.ud_param2_colorable > 0) then
|
||||
minetest.chat_send_player(player_name, "*** That node can't be colored.")
|
||||
return
|
||||
end
|
||||
|
||||
local palette = nil
|
||||
local fdir = 0
|
||||
if def.palette == "unifieddyes_palette_extended.png" then
|
||||
if def.paramtype2 == "color" then
|
||||
palette = "extended"
|
||||
elseif def.palette == "unifieddyes_palette_colorwallmounted.png" then
|
||||
elseif def.paramtype2 == "colorwallmounted" then
|
||||
palette = "wallmounted"
|
||||
fdir = node.param2 % 8
|
||||
else
|
||||
elseif def.paramtype2 == "colorfacedir" then
|
||||
palette = "split"
|
||||
fdir = node.param2 % 32
|
||||
else
|
||||
minetest.chat_send_player(player_name, "*** That node can't be colored -- it has an invalid color mode.")
|
||||
return
|
||||
end
|
||||
|
||||
local idx, hue = unifieddyes.getpaletteidx(painting_with, palette)
|
||||
@ -683,6 +719,7 @@ function unifieddyes.on_airbrush(itemstack, player, pointed_thing)
|
||||
local name = def.airbrush_replacement_node or node.name
|
||||
|
||||
if palette == "split" then
|
||||
|
||||
local modname = string.sub(name, 1, string.find(name, ":")-1)
|
||||
local nodename2 = string.sub(name, string.find(name, ":")+1)
|
||||
local oldcolor = "snozzberry"
|
||||
@ -698,16 +735,20 @@ function unifieddyes.on_airbrush(itemstack, player, pointed_thing)
|
||||
newcolor = "grey"
|
||||
end
|
||||
|
||||
local s = string.sub(def.palette, 21)
|
||||
oldcolor = string.sub(s, 1, string.find(s, "s.png")-1)
|
||||
if def.airbrush_replacement_node then
|
||||
oldcolor = "grey"
|
||||
else
|
||||
local s = string.sub(def.palette, 21)
|
||||
oldcolor = string.sub(s, 1, string.find(s, "s.png")-1)
|
||||
end
|
||||
end
|
||||
|
||||
if newcolor == "spring" then newcolor = "aqua"
|
||||
elseif newcolor == "azure" then newcolor = "skyblue"
|
||||
elseif newcolor == "rose" then newcolor = "redviolet"
|
||||
end
|
||||
|
||||
name = modname..":"..string.gsub(nodename2, oldcolor, newcolor)
|
||||
|
||||
if not minetest.registered_items[name] then
|
||||
minetest.chat_send_player(player_name, "*** "..string.sub(painting_with, 5).." can't be applied to that node.")
|
||||
return
|
||||
@ -855,22 +896,22 @@ function unifieddyes.show_airbrush_form(player)
|
||||
|
||||
local last_right_click = unifieddyes.player_last_right_clicked[player_name]
|
||||
if last_right_click then
|
||||
if last_right_click.def and last_right_click.def.palette then
|
||||
if last_right_click.def.palette == "unifieddyes_palette_colorwallmounted.png" then
|
||||
if last_right_click.def and last_right_click.def.paramtype2 then
|
||||
if last_right_click.def.paramtype2 == "colorwallmounted" then
|
||||
nodepalette = "wallmounted"
|
||||
elseif last_right_click.def.palette == "unifieddyes_palette_extended.png" then
|
||||
elseif last_right_click.def.paramtype2 == "color" then
|
||||
t[#t+1] = "label[0.5,8.25;(Right-clicked a node that supports all 256 colors, showing them all)]"
|
||||
showall = true
|
||||
elseif last_right_click.def.palette ~= "unifieddyes_palette_extended.png" then
|
||||
elseif last_right_click.def.paramtype2 == "colorfacedir" then
|
||||
nodepalette = "split"
|
||||
elseif not string.find(last_right_click.def.palette, "unifieddyes_palette_") then
|
||||
t[#t+1] = "label[0.5,8.25;(Right-clicked a node not supported by the Airbrush, showing all colors)]"
|
||||
end
|
||||
else
|
||||
t[#t+1] = "label[0.5,8.25;(Right-clicked a non-colorable node, showing all colors)]"
|
||||
end
|
||||
end
|
||||
|
||||
if not last_right_click.def.groups or not last_right_click.def.groups.ud_param2_colorable then
|
||||
t[#t+1] = "label[0.5,8.25;(Right-clicked a node not supported by the Airbrush, showing all colors)]"
|
||||
end
|
||||
|
||||
for v = 0, 6 do
|
||||
local val = unifieddyes.VALS_EXTENDED[v+1]
|
||||
|
||||
@ -993,7 +1034,7 @@ function unifieddyes.show_airbrush_form(player)
|
||||
t[#t+1] = "button_exit[11,8;2,1;cancel;Cancel]button_exit[13,8;2,1;accept;Accept]"
|
||||
|
||||
|
||||
if last_right_click and last_right_click.def and last_right_click.def.palette and nodepalette ~= "extended" then
|
||||
if last_right_click and last_right_click.def and nodepalette ~= "extended" then
|
||||
if showall then
|
||||
t[#t+1] = "button[0.5,8;2,1;show_avail;Show Available]"
|
||||
t[#t+1] = "label[2.5,8.25;(Currently showing all 256 colors)]"
|
||||
|
Loading…
x
Reference in New Issue
Block a user