2013-02-07 07:38:34 +01:00
|
|
|
--[[
|
|
|
|
|
|
|
|
Unified Dyes
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
This mod provides an extension to the Minetest 0.4.x dye system
|
2013-02-07 07:38:34 +01:00
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
|
|
|
|
Copyright (C) 2012-2013, Vanessa Ezekowitz
|
|
|
|
Email: vanessaezekowitz@gmail.com
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
--]]
|
2013-02-07 07:38:34 +01:00
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
--=====================================================================
|
2014-03-20 02:11:30 +01:00
|
|
|
|
2017-01-25 18:31:40 +01:00
|
|
|
unifieddyes = {}
|
|
|
|
|
2017-01-28 14:05:44 +01:00
|
|
|
local creative_mode = minetest.setting_getbool("creative_mode")
|
|
|
|
|
2014-03-20 02:11:30 +01:00
|
|
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
|
|
|
local S
|
2014-12-27 07:02:35 +01:00
|
|
|
if minetest.get_modpath("intllib") then
|
|
|
|
S = intllib.Getter()
|
2014-03-20 02:11:30 +01:00
|
|
|
else
|
2014-12-27 07:02:35 +01:00
|
|
|
S = function(s) return s end
|
2014-03-20 02:11:30 +01:00
|
|
|
end
|
|
|
|
|
2017-01-26 12:18:37 +01:00
|
|
|
-- helper functions for other mods that use this one
|
|
|
|
|
|
|
|
local HUES = {
|
|
|
|
"red",
|
|
|
|
"orange",
|
|
|
|
"yellow",
|
|
|
|
"lime",
|
|
|
|
"green",
|
|
|
|
"aqua",
|
|
|
|
"cyan",
|
|
|
|
"skyblue",
|
|
|
|
"blue",
|
|
|
|
"violet",
|
|
|
|
"magenta",
|
|
|
|
"redviolet"
|
2017-01-25 23:49:00 +01:00
|
|
|
}
|
|
|
|
|
2017-01-26 12:18:37 +01:00
|
|
|
local HUES2 = {
|
|
|
|
"Red",
|
|
|
|
"Orange",
|
|
|
|
"Yellow",
|
|
|
|
"Lime",
|
|
|
|
"Green",
|
|
|
|
"Aqua",
|
|
|
|
"Cyan",
|
|
|
|
"Sky-blue",
|
|
|
|
"Blue",
|
|
|
|
"Violet",
|
|
|
|
"Magenta",
|
|
|
|
"Red-violet"
|
|
|
|
}
|
2017-01-25 18:31:40 +01:00
|
|
|
|
2017-02-05 01:40:15 +01:00
|
|
|
local default_dyes = {
|
|
|
|
"black",
|
|
|
|
"blue",
|
|
|
|
"brown",
|
|
|
|
"cyan",
|
|
|
|
"dark_green",
|
|
|
|
"dark_grey",
|
|
|
|
"green",
|
|
|
|
"grey",
|
|
|
|
"magenta",
|
|
|
|
"orange",
|
|
|
|
"pink",
|
|
|
|
"red",
|
|
|
|
"violet",
|
|
|
|
"white",
|
|
|
|
"yellow"
|
|
|
|
}
|
|
|
|
|
2017-01-25 18:31:40 +01:00
|
|
|
-- code borrowed from homedecor
|
|
|
|
|
2017-02-18 05:04:47 +01:00
|
|
|
-- call this function to reset the rotation of a "wallmounted" object on place
|
|
|
|
|
|
|
|
function unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
|
|
|
|
local node = minetest.get_node(pos)
|
|
|
|
local yaw = placer:get_look_yaw()
|
|
|
|
local dir = minetest.yaw_to_dir(yaw-1.5)
|
|
|
|
local pitch = placer:get_look_vertical()
|
|
|
|
|
|
|
|
local fdir = minetest.dir_to_wallmounted(dir)
|
|
|
|
|
2017-02-18 05:13:22 +01:00
|
|
|
if pitch < -(math.pi/8) then
|
2017-02-18 05:04:47 +01:00
|
|
|
fdir = 0
|
2017-02-18 05:13:22 +01:00
|
|
|
elseif pitch > math.pi/8 then
|
2017-02-18 05:04:47 +01:00
|
|
|
fdir = 1
|
|
|
|
end
|
|
|
|
minetest.swap_node(pos, { name = node.name, param2 = fdir })
|
|
|
|
end
|
|
|
|
|
|
|
|
-- use this when you have a "wallmounted" node that should never be oriented
|
2017-02-18 19:00:06 +01:00
|
|
|
-- to floor or ceiling...
|
2017-02-18 05:04:47 +01:00
|
|
|
|
|
|
|
function unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
|
|
|
|
local node = minetest.get_node(pos)
|
|
|
|
local yaw = placer:get_look_yaw()
|
|
|
|
local dir = minetest.yaw_to_dir(yaw)
|
|
|
|
local fdir = minetest.dir_to_wallmounted(dir)
|
|
|
|
minetest.swap_node(pos, { name = node.name, param2 = fdir })
|
|
|
|
end
|
|
|
|
|
2017-02-18 19:00:06 +01:00
|
|
|
-- ... and use this one to force that kind of node off of floor/ceiling
|
|
|
|
-- orientation after the screwdriver rotates it.
|
|
|
|
|
|
|
|
function unifieddyes.fix_after_screwdriver_nsew(pos, node, user, mode, new_param2)
|
|
|
|
local new_fdir = new_param2 % 8
|
|
|
|
local color = new_param2 - new_fdir
|
|
|
|
print(new_fdir)
|
|
|
|
|
|
|
|
if new_fdir < 2 then
|
|
|
|
new_fdir = 2
|
|
|
|
minetest.swap_node(pos, { name = node.name, param2 = new_fdir + color })
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-01-25 18:31:40 +01:00
|
|
|
function unifieddyes.select_node(pointed_thing)
|
|
|
|
local pos = pointed_thing.under
|
|
|
|
local node = minetest.get_node_or_nil(pos)
|
|
|
|
local def = node and minetest.registered_nodes[node.name]
|
|
|
|
|
|
|
|
if not def or not def.buildable_to then
|
|
|
|
pos = pointed_thing.above
|
|
|
|
node = minetest.get_node_or_nil(pos)
|
|
|
|
def = node and minetest.registered_nodes[node.name]
|
|
|
|
end
|
|
|
|
return def and pos, def
|
|
|
|
end
|
|
|
|
|
|
|
|
function unifieddyes.is_buildable_to(placer_name, ...)
|
|
|
|
for _, pos in ipairs({...}) do
|
|
|
|
local node = minetest.get_node_or_nil(pos)
|
|
|
|
local def = node and minetest.registered_nodes[node.name]
|
|
|
|
if not (def and def.buildable_to) or minetest.is_protected(pos, placer_name) then
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
2017-01-26 19:51:38 +01:00
|
|
|
function unifieddyes.get_hsv(name) -- expects a node/item name
|
2017-01-26 19:42:36 +01:00
|
|
|
local hue = ""
|
|
|
|
local a,b
|
|
|
|
for _, i in ipairs(HUES) do
|
|
|
|
a,b = string.find(name, "_"..i)
|
|
|
|
if a and not ( string.find(name, "_redviolet") and i == "red" ) then
|
|
|
|
hue = i
|
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-01-26 19:51:38 +01:00
|
|
|
if string.find(name, "_light_grey") then hue = "light_grey"
|
|
|
|
elseif string.find(name, "_lightgrey") then hue = "light_grey"
|
|
|
|
elseif string.find(name, "_dark_grey") then hue = "dark_grey"
|
|
|
|
elseif string.find(name, "_darkgrey") then hue = "dark_grey"
|
|
|
|
elseif string.find(name, "_grey") then hue = "grey"
|
|
|
|
elseif string.find(name, "_white") then hue = "white"
|
|
|
|
elseif string.find(name, "_black") then hue = "black"
|
2017-01-26 19:42:36 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
local sat = ""
|
|
|
|
if string.find(name, "_s50") then sat = "_s50" end
|
|
|
|
|
|
|
|
local val = ""
|
|
|
|
if string.find(name, "dark_") then val = "dark_" end
|
|
|
|
if string.find(name, "medium_") then val = "medium_" end
|
|
|
|
if string.find(name, "light_") then val = "light_" end
|
|
|
|
|
|
|
|
return hue, sat, val
|
|
|
|
end
|
|
|
|
|
2017-01-25 18:31:40 +01:00
|
|
|
-- code borrowed from cheapie's plasticbox mod
|
|
|
|
|
2017-01-29 00:18:27 +01:00
|
|
|
function unifieddyes.getpaletteidx(color, is_color_fdir)
|
2017-01-26 12:18:37 +01:00
|
|
|
local origcolor = color
|
2017-01-25 18:31:40 +01:00
|
|
|
local aliases = {
|
|
|
|
["pink"] = "light_red",
|
|
|
|
["brown"] = "dark_orange",
|
|
|
|
}
|
|
|
|
|
|
|
|
local grayscale = {
|
|
|
|
["white"] = 1,
|
|
|
|
["light_grey"] = 2,
|
|
|
|
["grey"] = 3,
|
|
|
|
["dark_grey"] = 4,
|
|
|
|
["black"] = 5,
|
|
|
|
}
|
|
|
|
|
add API option for "colorwallmounted" paramtype2
(pass "wallmounted" to the "is_color_fdir" field where needed)
Comes with an abridged, 32-color version of the master palette,
containing Red, Orange, Yellow, Green, Cyan, Blue, Violet, and Magenta,
in three shades each, plus the usual black/three greys/white, plus pink
and brown in two of the extrs spaces.
2017-01-29 03:51:46 +01:00
|
|
|
local grayscale_wallmounted = {
|
|
|
|
["white"] = 0,
|
|
|
|
["light_grey"] = 1,
|
|
|
|
["grey"] = 2,
|
|
|
|
["dark_grey"] = 3,
|
|
|
|
["black"] = 4,
|
|
|
|
}
|
|
|
|
|
2017-01-25 18:31:40 +01:00
|
|
|
local hues = {
|
|
|
|
["red"] = 1,
|
|
|
|
["orange"] = 2,
|
|
|
|
["yellow"] = 3,
|
|
|
|
["lime"] = 4,
|
|
|
|
["green"] = 5,
|
|
|
|
["aqua"] = 6,
|
|
|
|
["cyan"] = 7,
|
|
|
|
["skyblue"] = 8,
|
|
|
|
["blue"] = 9,
|
|
|
|
["violet"] = 10,
|
|
|
|
["magenta"] = 11,
|
|
|
|
["redviolet"] = 12,
|
|
|
|
}
|
|
|
|
|
add API option for "colorwallmounted" paramtype2
(pass "wallmounted" to the "is_color_fdir" field where needed)
Comes with an abridged, 32-color version of the master palette,
containing Red, Orange, Yellow, Green, Cyan, Blue, Violet, and Magenta,
in three shades each, plus the usual black/three greys/white, plus pink
and brown in two of the extrs spaces.
2017-01-29 03:51:46 +01:00
|
|
|
local hues_wallmounted = {
|
|
|
|
["red"] = 0,
|
|
|
|
["orange"] = 1,
|
|
|
|
["yellow"] = 2,
|
|
|
|
["green"] = 3,
|
|
|
|
["cyan"] = 4,
|
|
|
|
["blue"] = 5,
|
|
|
|
["violet"] = 6,
|
|
|
|
["magenta"] = 7
|
|
|
|
}
|
|
|
|
|
2017-01-25 18:31:40 +01:00
|
|
|
local shades = {
|
|
|
|
[""] = 1,
|
|
|
|
["s50"] = 2,
|
|
|
|
["light"] = 3,
|
|
|
|
["medium"] = 4,
|
|
|
|
["mediums50"] = 5,
|
|
|
|
["dark"] = 6,
|
|
|
|
["darks50"] = 7,
|
|
|
|
}
|
|
|
|
|
add API option for "colorwallmounted" paramtype2
(pass "wallmounted" to the "is_color_fdir" field where needed)
Comes with an abridged, 32-color version of the master palette,
containing Red, Orange, Yellow, Green, Cyan, Blue, Violet, and Magenta,
in three shades each, plus the usual black/three greys/white, plus pink
and brown in two of the extrs spaces.
2017-01-29 03:51:46 +01:00
|
|
|
local shades_wallmounted = {
|
|
|
|
[""] = 1,
|
|
|
|
["medium"] = 2,
|
|
|
|
["dark"] = 3
|
|
|
|
}
|
|
|
|
|
2017-01-25 18:31:40 +01:00
|
|
|
if string.sub(color,1,4) == "dye:" then
|
|
|
|
color = string.sub(color,5,-1)
|
|
|
|
elseif string.sub(color,1,12) == "unifieddyes:" then
|
|
|
|
color = string.sub(color,13,-1)
|
|
|
|
else
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
add API option for "colorwallmounted" paramtype2
(pass "wallmounted" to the "is_color_fdir" field where needed)
Comes with an abridged, 32-color version of the master palette,
containing Red, Orange, Yellow, Green, Cyan, Blue, Violet, and Magenta,
in three shades each, plus the usual black/three greys/white, plus pink
and brown in two of the extrs spaces.
2017-01-29 03:51:46 +01:00
|
|
|
if is_color_fdir == "wallmounted" then
|
|
|
|
if grayscale_wallmounted[color] then
|
2017-01-30 11:32:17 +01:00
|
|
|
return (grayscale_wallmounted[color] * 8), 0
|
add API option for "colorwallmounted" paramtype2
(pass "wallmounted" to the "is_color_fdir" field where needed)
Comes with an abridged, 32-color version of the master palette,
containing Red, Orange, Yellow, Green, Cyan, Blue, Violet, and Magenta,
in three shades each, plus the usual black/three greys/white, plus pink
and brown in two of the extrs spaces.
2017-01-29 03:51:46 +01:00
|
|
|
end
|
|
|
|
elseif is_color_fdir then
|
|
|
|
if grayscale[color] then
|
2017-01-26 12:18:37 +01:00
|
|
|
return (grayscale[color] * 32), 0
|
2017-01-29 06:06:08 +01:00
|
|
|
end
|
|
|
|
else
|
|
|
|
if grayscale[color] then
|
2017-01-26 12:18:37 +01:00
|
|
|
return grayscale[color], 0
|
|
|
|
end
|
2017-01-25 18:31:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
local shade = ""
|
|
|
|
if string.sub(color,1,6) == "light_" then
|
|
|
|
shade = "light"
|
|
|
|
color = string.sub(color,7,-1)
|
|
|
|
elseif string.sub(color,1,7) == "medium_" then
|
|
|
|
shade = "medium"
|
|
|
|
color = string.sub(color,8,-1)
|
|
|
|
elseif string.sub(color,1,5) == "dark_" then
|
|
|
|
shade = "dark"
|
|
|
|
color = string.sub(color,6,-1)
|
|
|
|
end
|
|
|
|
if string.sub(color,-4,-1) == "_s50" then
|
|
|
|
shade = shade.."s50"
|
|
|
|
color = string.sub(color,1,-5)
|
|
|
|
end
|
|
|
|
|
add API option for "colorwallmounted" paramtype2
(pass "wallmounted" to the "is_color_fdir" field where needed)
Comes with an abridged, 32-color version of the master palette,
containing Red, Orange, Yellow, Green, Cyan, Blue, Violet, and Magenta,
in three shades each, plus the usual black/three greys/white, plus pink
and brown in two of the extrs spaces.
2017-01-29 03:51:46 +01:00
|
|
|
if is_color_fdir == "wallmounted" then
|
2017-02-06 15:22:10 +01:00
|
|
|
if color == "brown" then return 48,1
|
|
|
|
elseif color == "pink" then return 56,7
|
2017-02-06 15:30:04 +01:00
|
|
|
elseif color == "blue" and shade == "light" then return 40,5
|
add API option for "colorwallmounted" paramtype2
(pass "wallmounted" to the "is_color_fdir" field where needed)
Comes with an abridged, 32-color version of the master palette,
containing Red, Orange, Yellow, Green, Cyan, Blue, Violet, and Magenta,
in three shades each, plus the usual black/three greys/white, plus pink
and brown in two of the extrs spaces.
2017-01-29 03:51:46 +01:00
|
|
|
elseif hues_wallmounted[color] and shades_wallmounted[shade] then
|
|
|
|
return (shades_wallmounted[shade] * 64 + hues_wallmounted[color] * 8), hues_wallmounted[color]
|
|
|
|
end
|
2017-02-06 15:22:10 +01:00
|
|
|
else
|
|
|
|
if color == "brown" then
|
|
|
|
color = "orange"
|
|
|
|
shade = "dark"
|
|
|
|
elseif color == "pink" then
|
|
|
|
color = "red"
|
|
|
|
shade = "light"
|
|
|
|
end
|
|
|
|
if hues[color] and shades[shade] then
|
|
|
|
if is_color_fdir then
|
|
|
|
return (shades[shade] * 32), hues[color]
|
|
|
|
else
|
|
|
|
return (hues[color] * 8 + shades[shade]), hues[color]
|
|
|
|
end
|
2017-01-26 12:18:37 +01:00
|
|
|
end
|
2017-01-25 18:31:40 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-01-28 14:05:44 +01:00
|
|
|
function unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger)
|
|
|
|
local prevdye
|
2017-01-29 00:18:27 +01:00
|
|
|
|
2017-01-28 14:05:44 +01:00
|
|
|
if oldmetadata and oldmetadata.fields then
|
|
|
|
prevdye = oldmetadata.fields.dye
|
|
|
|
end
|
2017-01-28 15:02:14 +01:00
|
|
|
|
|
|
|
local inv = digger:get_inventory()
|
|
|
|
|
|
|
|
if prevdye and not (inv:contains_item("main", prevdye) and creative_mode) and minetest.registered_items[prevdye] then
|
2017-01-28 14:05:44 +01:00
|
|
|
if inv:room_for_item("main", prevdye) then
|
|
|
|
inv:add_item("main", prevdye)
|
|
|
|
else
|
|
|
|
minetest.add_item(pos, prevdye)
|
|
|
|
end
|
2017-01-25 18:31:40 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-02-05 01:40:15 +01:00
|
|
|
function unifieddyes.on_use(itemstack, player, pointed_thing)
|
|
|
|
|
|
|
|
if not pointed_thing or pointed_thing.type == "nothing" then return end -- if "using" the dye on air
|
|
|
|
|
|
|
|
local pos = minetest.get_pointed_thing_position(pointed_thing)
|
|
|
|
local node = minetest.get_node(pos)
|
|
|
|
local nodedef = minetest.registered_nodes[node.name]
|
2017-02-06 02:21:04 +01:00
|
|
|
local playername = player:get_player_name()
|
2017-02-05 01:40:15 +01:00
|
|
|
|
2017-02-06 15:22:10 +01:00
|
|
|
-- if the node has an on_punch defined, bail out and call that instead, unless "sneak" is pressed.
|
|
|
|
if not player:get_player_control().sneak then
|
|
|
|
local onpunch = nodedef.on_punch(pos, node, player, pointed_thing)
|
|
|
|
if onpunch then
|
|
|
|
return onpunch
|
|
|
|
end
|
2017-02-05 01:40:15 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
-- if the target is unknown, has no groups defined, or isn't UD-colorable, just bail out
|
2017-02-06 02:21:04 +01:00
|
|
|
if not (nodedef and nodedef.groups and nodedef.groups.ud_param2_colorable) then
|
|
|
|
minetest.chat_send_player(playername, "That node can't be colored.")
|
|
|
|
return
|
|
|
|
end
|
2017-02-05 01:40:15 +01:00
|
|
|
|
|
|
|
local newnode = nodedef.ud_replacement_node
|
|
|
|
local is_color_fdir
|
|
|
|
|
|
|
|
if nodedef.paramtype2 == "color" then
|
|
|
|
is_color_fdir = false
|
|
|
|
elseif nodedef.paramtype2 == "colorfacedir"
|
|
|
|
then is_color_fdir = true
|
|
|
|
elseif nodedef.paramtype2 == "colorwallmounted"
|
|
|
|
then is_color_fdir = "wallmounted"
|
2017-01-25 18:31:40 +01:00
|
|
|
end
|
|
|
|
|
2017-02-05 01:40:15 +01:00
|
|
|
if minetest.is_protected(pos, playername) and not minetest.check_player_privs(playername, {protection_bypass=true}) then
|
|
|
|
minetest.record_protection_violation(pos, playername)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
local stackname = itemstack:get_name()
|
|
|
|
local pos2 = unifieddyes.select_node(pointed_thing)
|
|
|
|
local paletteidx, hue = unifieddyes.getpaletteidx(stackname, is_color_fdir)
|
2017-01-30 11:50:02 +01:00
|
|
|
|
2017-01-25 18:31:40 +01:00
|
|
|
if paletteidx then
|
|
|
|
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
local prevdye = meta:get_string("dye")
|
2017-01-28 15:36:42 +01:00
|
|
|
local inv = player:get_inventory()
|
|
|
|
|
|
|
|
if not (inv:contains_item("main", prevdye) and creative_mode) and minetest.registered_items[prevdye] then
|
2017-01-28 14:05:44 +01:00
|
|
|
if inv:room_for_item("main", prevdye) then
|
|
|
|
inv:add_item("main", prevdye)
|
2017-01-25 18:31:40 +01:00
|
|
|
else
|
2017-01-28 14:05:44 +01:00
|
|
|
minetest.add_item(pos, prevdye)
|
2017-01-25 18:31:40 +01:00
|
|
|
end
|
|
|
|
end
|
2017-01-28 14:05:44 +01:00
|
|
|
|
2017-02-05 01:40:15 +01:00
|
|
|
meta:set_string("dye", stackname)
|
|
|
|
|
|
|
|
if prevdye == stackname then
|
|
|
|
local a,b = string.find(stackname, ":")
|
|
|
|
minetest.chat_send_player(playername, "That node is already "..string.sub(stackname, a + 1).."." )
|
|
|
|
return
|
|
|
|
elseif not creative_mode then
|
|
|
|
itemstack:take_item()
|
2017-01-28 14:05:44 +01:00
|
|
|
end
|
2017-02-05 01:40:15 +01:00
|
|
|
|
2017-01-25 18:31:40 +01:00
|
|
|
node.param2 = paletteidx
|
2017-01-26 12:18:37 +01:00
|
|
|
|
2017-01-29 00:18:27 +01:00
|
|
|
local oldpaletteidx, oldhuenum = unifieddyes.getpaletteidx(prevdye, is_color_fdir)
|
2017-01-26 17:06:06 +01:00
|
|
|
local oldnode = minetest.get_node(pos)
|
|
|
|
|
|
|
|
local oldhue = nil
|
|
|
|
for _, i in ipairs(HUES) do
|
|
|
|
if string.find(oldnode.name, "_"..i) and not
|
|
|
|
( string.find(oldnode.name, "_redviolet") and i == "red" ) then
|
|
|
|
oldhue = i
|
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
2017-01-26 12:18:37 +01:00
|
|
|
|
2017-01-26 17:23:18 +01:00
|
|
|
if newnode then -- this path is used when the calling mod want to supply a replacement node
|
add API option for "colorwallmounted" paramtype2
(pass "wallmounted" to the "is_color_fdir" field where needed)
Comes with an abridged, 32-color version of the master palette,
containing Red, Orange, Yellow, Green, Cyan, Blue, Violet, and Magenta,
in three shades each, plus the usual black/three greys/white, plus pink
and brown in two of the extrs spaces.
2017-01-29 03:51:46 +01:00
|
|
|
if is_color_fdir == "wallmounted" then
|
|
|
|
node.param2 = paletteidx + (minetest.get_node(pos).param2 % 8)
|
|
|
|
elseif is_color_fdir then -- we probably need to change the hue of the node too
|
2017-01-26 12:18:37 +01:00
|
|
|
if oldhue ~=0 then -- it's colored, not grey
|
2017-01-26 13:10:48 +01:00
|
|
|
if oldhue ~= nil then -- it's been painted before
|
|
|
|
if hue ~= 0 then -- the player's wielding a colored dye
|
2017-01-26 17:06:06 +01:00
|
|
|
newnode = string.gsub(newnode, "_"..oldhue, "_"..HUES[hue])
|
2017-01-26 13:10:48 +01:00
|
|
|
else -- it's a greyscale dye
|
2017-01-26 17:06:06 +01:00
|
|
|
newnode = string.gsub(newnode, "_"..oldhue, "_grey")
|
2017-01-26 13:10:48 +01:00
|
|
|
end
|
|
|
|
else -- it's never had a color at all
|
|
|
|
if hue ~= 0 then -- and if the wield is greyscale, don't change the node name
|
2017-01-26 17:06:06 +01:00
|
|
|
newnode = string.gsub(newnode, "_grey", "_"..HUES[hue])
|
2017-01-26 13:10:48 +01:00
|
|
|
end
|
|
|
|
end
|
2017-01-26 12:18:37 +01:00
|
|
|
else
|
2017-01-26 13:10:48 +01:00
|
|
|
if hue ~= 0 then -- greyscale dye on greyscale node = no hue change
|
2017-01-26 17:06:06 +01:00
|
|
|
newnode = string.gsub(newnode, "_grey", "_"..HUES[hue])
|
2017-01-26 13:10:48 +01:00
|
|
|
end
|
2017-01-26 12:18:37 +01:00
|
|
|
end
|
2017-01-29 00:19:07 +01:00
|
|
|
node.param2 = paletteidx + (minetest.get_node(pos).param2 % 32)
|
|
|
|
else
|
|
|
|
node.param2 = paletteidx
|
2017-01-26 12:18:37 +01:00
|
|
|
end
|
2017-01-26 17:06:06 +01:00
|
|
|
node.name = newnode
|
2017-01-25 18:31:40 +01:00
|
|
|
minetest.swap_node(pos, node)
|
2017-02-05 01:40:15 +01:00
|
|
|
if not creative_mode then
|
|
|
|
return itemstack
|
|
|
|
end
|
2017-01-26 17:23:18 +01:00
|
|
|
else -- this path is used when you're just painting an existing node, rather than replacing one.
|
2017-01-26 17:06:06 +01:00
|
|
|
newnode = oldnode -- note that here, newnode/oldnode are a full node, not just the name.
|
add API option for "colorwallmounted" paramtype2
(pass "wallmounted" to the "is_color_fdir" field where needed)
Comes with an abridged, 32-color version of the master palette,
containing Red, Orange, Yellow, Green, Cyan, Blue, Violet, and Magenta,
in three shades each, plus the usual black/three greys/white, plus pink
and brown in two of the extrs spaces.
2017-01-29 03:51:46 +01:00
|
|
|
if is_color_fdir == "wallmounted" then
|
|
|
|
newnode.param2 = paletteidx + (minetest.get_node(pos).param2 % 8)
|
|
|
|
elseif is_color_fdir then
|
2017-01-26 17:06:06 +01:00
|
|
|
if oldhue then
|
2017-01-26 17:23:18 +01:00
|
|
|
if hue ~= 0 then
|
|
|
|
newnode.name = string.gsub(newnode.name, "_"..oldhue, "_"..HUES[hue])
|
|
|
|
else
|
|
|
|
newnode.name = string.gsub(newnode.name, "_"..oldhue, "_grey")
|
|
|
|
end
|
|
|
|
elseif string.find(minetest.get_node(pos).name, "_grey") and hue ~= 0 then
|
|
|
|
newnode.name = string.gsub(newnode.name, "_grey", "_"..HUES[hue])
|
2017-01-26 17:06:06 +01:00
|
|
|
end
|
2017-01-29 00:19:07 +01:00
|
|
|
newnode.param2 = paletteidx + (minetest.get_node(pos).param2 % 32)
|
|
|
|
else
|
|
|
|
newnode.param2 = paletteidx
|
2017-01-26 12:18:37 +01:00
|
|
|
end
|
2017-01-28 15:36:42 +01:00
|
|
|
minetest.swap_node(pos, newnode)
|
2017-01-28 14:05:44 +01:00
|
|
|
if not creative_mode then
|
2017-02-05 01:40:15 +01:00
|
|
|
return itemstack
|
2017-01-28 14:05:44 +01:00
|
|
|
end
|
2017-02-05 01:40:15 +01:00
|
|
|
end
|
|
|
|
else
|
|
|
|
local a,b = string.find(stackname, ":")
|
|
|
|
if a then
|
|
|
|
minetest.chat_send_player(playername, "That node can't be colored "..string.sub(stackname, a + 1).."." )
|
2017-01-25 18:31:40 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-02-05 01:40:15 +01:00
|
|
|
-- re-define default dyes slightly, to add on_use
|
|
|
|
|
|
|
|
for _, color in ipairs(default_dyes) do
|
|
|
|
minetest.override_item("dye:"..color, {
|
|
|
|
on_use = unifieddyes.on_use
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Items/recipes needed to generate the few base colors that are not
|
|
|
|
-- provided by the standard dyes mod.
|
2012-07-12 23:49:46 +02:00
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Lime
|
2012-07-12 23:49:46 +02:00
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
minetest.register_craftitem(":dye:lime", {
|
2017-02-05 01:40:15 +01:00
|
|
|
description = S("Lime Dye"),
|
|
|
|
inventory_image = "unifieddyes_lime.png",
|
|
|
|
groups = { dye=1, excolor_lime=1, unicolor_lime=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
output = "dye:lime 2",
|
2012-07-12 23:49:46 +02:00
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:yellow",
|
|
|
|
"dye:green",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Aqua
|
2012-07-12 23:49:46 +02:00
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
minetest.register_craftitem(":dye:aqua", {
|
2017-02-05 01:40:15 +01:00
|
|
|
description = S("Aqua Dye"),
|
|
|
|
inventory_image = "unifieddyes_aqua.png",
|
|
|
|
groups = { dye=1, excolor_aqua=1, unicolor_aqua=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
output = "dye:aqua 2",
|
2012-07-12 23:49:46 +02:00
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:cyan",
|
|
|
|
"dye:green",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Sky blue
|
2012-07-24 23:56:03 +02:00
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
minetest.register_craftitem(":dye:skyblue", {
|
2017-02-05 01:40:15 +01:00
|
|
|
description = S("Sky-blue Dye"),
|
|
|
|
inventory_image = "unifieddyes_skyblue.png",
|
|
|
|
groups = { dye=1, excolor_sky_blue=1, unicolor_sky_blue=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
2012-07-26 02:55:45 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
output = "dye:skyblue 2",
|
2012-07-24 23:56:03 +02:00
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:cyan",
|
|
|
|
"dye:blue",
|
2012-07-24 23:56:03 +02:00
|
|
|
},
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Red-violet
|
2012-07-24 23:56:03 +02:00
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
minetest.register_craftitem(":dye:redviolet", {
|
2017-02-05 01:40:15 +01:00
|
|
|
description = S("Red-violet Dye"),
|
|
|
|
inventory_image = "unifieddyes_redviolet.png",
|
|
|
|
groups = { dye=1, excolor_red_violet=1, unicolor_red_violet=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
2012-07-26 02:55:45 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
output = "dye:redviolet 2",
|
2012-07-24 23:56:03 +02:00
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:red",
|
|
|
|
"dye:magenta",
|
2012-07-24 23:56:03 +02:00
|
|
|
},
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Light grey
|
2012-07-24 23:56:03 +02:00
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
minetest.register_craftitem(":dye:light_grey", {
|
2017-02-05 01:40:15 +01:00
|
|
|
description = S("Light Grey Dye"),
|
|
|
|
inventory_image = "unifieddyes_lightgrey.png",
|
|
|
|
groups = { dye=1, excolor_lightgrey=1, unicolor_light_grey=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
2012-07-26 02:55:45 +02:00
|
|
|
})
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
output = "dye:light_grey 2",
|
2012-07-24 23:56:03 +02:00
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:grey",
|
|
|
|
"dye:white",
|
2012-07-24 23:56:03 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Extra craft for black dye
|
2012-07-26 02:55:45 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
output = "dye:black 4",
|
2012-07-24 23:56:03 +02:00
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"default:coal_lump",
|
2012-07-24 23:56:03 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Extra craft for dark grey dye
|
2012-08-02 01:14:49 +02:00
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
output = "dye:dark_grey 3",
|
2012-08-02 01:14:49 +02:00
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:black",
|
|
|
|
"dye:black",
|
|
|
|
"dye:white",
|
2012-08-02 01:14:49 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Extra craft for light grey dye
|
2012-07-26 02:55:45 +02:00
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
output = "dye:light_grey 3",
|
2012-07-24 23:56:03 +02:00
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:black",
|
|
|
|
"dye:white",
|
|
|
|
"dye:white",
|
2012-07-24 23:56:03 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Extra craft for green dye
|
|
|
|
|
2012-07-24 23:56:03 +02:00
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
output = "dye:green 4",
|
2012-07-24 23:56:03 +02:00
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"default:cactus",
|
2012-07-24 23:56:03 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2012-07-12 23:49:46 +02:00
|
|
|
-- =================================================================
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
-- Generate all of additional variants of hue, saturation, and
|
2012-07-24 23:56:03 +02:00
|
|
|
-- brightness.
|
2012-07-12 23:49:46 +02:00
|
|
|
|
|
|
|
-- "s50" in a file/item name means "saturation: 50%".
|
2012-07-16 16:53:56 +02:00
|
|
|
-- Brightness levels in the textures are 33% ("dark"), 66% ("medium"),
|
2013-05-01 04:20:38 +02:00
|
|
|
-- 100% ("full", but not so-named), and 150% ("light").
|
2012-07-12 23:49:46 +02:00
|
|
|
|
2012-07-26 02:55:45 +02:00
|
|
|
|
2012-07-12 23:49:46 +02:00
|
|
|
for i = 1, 12 do
|
|
|
|
|
2013-12-15 19:03:38 +01:00
|
|
|
local hue = HUES[i]
|
|
|
|
local hue2 = HUES2[i]
|
2012-07-12 23:49:46 +02:00
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:dark_" .. hue .. "_s50 2",
|
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:" .. hue,
|
|
|
|
"dye:dark_grey",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:dark_" .. hue .. "_s50 4",
|
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:" .. hue,
|
|
|
|
"dye:black",
|
|
|
|
"dye:black",
|
|
|
|
"dye:white"
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
if hue == "green" then
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "dye:dark_green 3",
|
|
|
|
recipe = {
|
|
|
|
"dye:" .. hue,
|
|
|
|
"dye:black",
|
|
|
|
"dye:black",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
else
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:dark_" .. hue .. " 3",
|
|
|
|
recipe = {
|
|
|
|
"dye:" .. hue,
|
|
|
|
"dye:black",
|
|
|
|
"dye:black",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|
2012-07-12 23:49:46 +02:00
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:medium_" .. hue .. "_s50 2",
|
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:" .. hue,
|
|
|
|
"dye:grey",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:medium_" .. hue .. "_s50 3",
|
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:" .. hue,
|
|
|
|
"dye:black",
|
|
|
|
"dye:white",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:medium_" .. hue .. " 2",
|
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:" .. hue,
|
|
|
|
"dye:black",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:" .. hue .. "_s50 2",
|
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:" .. hue,
|
|
|
|
"dye:grey",
|
|
|
|
"dye:white",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:" .. hue .. "_s50 4",
|
|
|
|
recipe = {
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
"dye:" .. hue,
|
|
|
|
"dye:white",
|
|
|
|
"dye:white",
|
|
|
|
"dye:black",
|
2012-07-12 23:49:46 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
if hue ~= "red" then
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "unifieddyes:light_" .. hue .. " 2",
|
|
|
|
recipe = {
|
|
|
|
"dye:" .. hue,
|
|
|
|
"dye:white",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|
2012-07-16 16:53:56 +02:00
|
|
|
|
2012-07-12 23:49:46 +02:00
|
|
|
minetest.register_craftitem("unifieddyes:dark_" .. hue .. "_s50", {
|
2014-03-20 02:11:30 +01:00
|
|
|
description = S("Dark " .. hue2 .. " Dye (low saturation)"),
|
2012-07-14 05:23:39 +02:00
|
|
|
inventory_image = "unifieddyes_dark_" .. hue .. "_s50.png",
|
2017-02-05 01:40:15 +01:00
|
|
|
groups = { dye=1, ["unicolor_dark_"..hue.."_s50"]=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
if hue ~= "green" then
|
|
|
|
minetest.register_craftitem("unifieddyes:dark_" .. hue, {
|
2014-03-20 02:11:30 +01:00
|
|
|
description = S("Dark " .. hue2 .. " Dye"),
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
inventory_image = "unifieddyes_dark_" .. hue .. ".png",
|
2017-02-05 01:40:15 +01:00
|
|
|
groups = { dye=1, ["unicolor_dark_"..hue]=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
})
|
|
|
|
end
|
2012-07-12 23:49:46 +02:00
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:medium_" .. hue .. "_s50", {
|
2014-03-20 02:11:30 +01:00
|
|
|
description = S("Medium " .. hue2 .. " Dye (low saturation)"),
|
2012-07-12 23:49:46 +02:00
|
|
|
inventory_image = "unifieddyes_medium_" .. hue .. "_s50.png",
|
2017-02-05 01:40:15 +01:00
|
|
|
groups = { dye=1, ["unicolor_medium_"..hue.."_s50"]=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:medium_" .. hue, {
|
2014-03-20 02:11:30 +01:00
|
|
|
description = S("Medium " .. hue2 .. " Dye"),
|
2012-07-14 05:23:39 +02:00
|
|
|
inventory_image = "unifieddyes_medium_" .. hue .. ".png",
|
2017-02-05 01:40:15 +01:00
|
|
|
groups = { dye=1, ["unicolor_medium_"..hue]=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("unifieddyes:" .. hue .. "_s50", {
|
2014-03-20 02:11:30 +01:00
|
|
|
description = S(hue2 .. " Dye (low saturation)"),
|
2012-07-14 05:23:39 +02:00
|
|
|
inventory_image = "unifieddyes_" .. hue .. "_s50.png",
|
2017-02-05 01:40:15 +01:00
|
|
|
groups = { dye=1, ["unicolor_"..hue.."_s50"]=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
2012-07-12 23:49:46 +02:00
|
|
|
})
|
|
|
|
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
if hue ~= "red" then
|
|
|
|
minetest.register_craftitem("unifieddyes:light_" .. hue, {
|
2014-03-20 02:11:30 +01:00
|
|
|
description = S("Light " .. hue2 .. " Dye"),
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
inventory_image = "unifieddyes_light_" .. hue .. ".png",
|
2017-02-05 01:40:15 +01:00
|
|
|
groups = { dye=1, ["unicolor_light_"..hue]=1, not_in_creative_inventory=1 },
|
|
|
|
on_use = unifieddyes.on_use
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
})
|
|
|
|
end
|
|
|
|
minetest.register_alias("unifieddyes:"..hue, "dye:"..hue)
|
|
|
|
minetest.register_alias("unifieddyes:pigment_"..hue, "dye:"..hue)
|
2012-07-12 23:49:46 +02:00
|
|
|
end
|
|
|
|
|
2017-01-25 19:19:20 +01:00
|
|
|
minetest.register_alias("unifieddyes:light_red", "dye:pink")
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
minetest.register_alias("unifieddyes:dark_green", "dye:dark_green")
|
2017-01-25 19:19:20 +01:00
|
|
|
minetest.register_alias("unifieddyes:black", "dye:black")
|
|
|
|
minetest.register_alias("unifieddyes:darkgrey", "dye:dark_grey")
|
2017-01-28 15:36:42 +01:00
|
|
|
minetest.register_alias("unifieddyes:dark_grey", "dye:dark_grey")
|
2017-01-25 19:19:20 +01:00
|
|
|
minetest.register_alias("unifieddyes:grey", "dye:grey")
|
|
|
|
minetest.register_alias("unifieddyes:lightgrey", "dye:light_grey")
|
2017-01-28 15:36:42 +01:00
|
|
|
minetest.register_alias("unifieddyes:light_grey", "dye:light_grey")
|
2017-01-25 19:19:20 +01:00
|
|
|
minetest.register_alias("unifieddyes:white", "dye:white")
|
Refactored the code to use default "common" dyes
rather than directly from flowers.
This mod now depends on "default" and "dye" from the Minetest common
sub-game. Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.
Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.
All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.
The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with. Now it's just
dry dye powders, as with the default dye mod.
Also, got rid of the whole paint scheme, in favor of dry powders.
All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 12:02:22 +02:00
|
|
|
|
|
|
|
minetest.register_alias("unifieddyes:white_paint", "dye:white")
|
|
|
|
minetest.register_alias("unifieddyes:titanium_dioxide", "dye:white")
|
|
|
|
minetest.register_alias("unifieddyes:lightgrey_paint", "dye:light_grey")
|
|
|
|
minetest.register_alias("unifieddyes:grey_paint", "dye:grey")
|
|
|
|
minetest.register_alias("unifieddyes:darkgrey_paint", "dye:dark_grey")
|
|
|
|
minetest.register_alias("unifieddyes:carbon_black", "dye:black")
|
|
|
|
|
2014-03-20 02:11:30 +01:00
|
|
|
print(S("[UnifiedDyes] Loaded!"))
|
2012-07-12 23:49:46 +02:00
|
|
|
|