update castles modpack, blox, bobblocks, coloredwood, technic,

gloopblocks, homedecor, ilights, led marquee, plasticbox, solidcolor,
stained_glass, unified bricks, and unified dyes

In most of these, the update is to shift over to the new "old" coloring
paradigm in Unified Dyes.  See its forum thread for details.
This commit is contained in:
Vanessa Dannenberg 2018-08-22 22:28:28 -04:00
parent 3c47f229fc
commit 9c9457e1f5
97 changed files with 1405 additions and 2398 deletions

View File

@ -5,18 +5,14 @@
-- * the hammer gets dammaged a bit at each repair step
---------------------------------------------------------------------------------------
anvil = {
setting = {
item_displacement = 7/16,
}
}
minetest.register_alias("castle:anvil", "anvil:anvil")
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local item_displacement = 7/16
-- the hammer for the anvil
minetest.register_tool("anvil:hammer", {
description = S("Steel blacksmithing hammer"),
@ -73,7 +69,7 @@ minetest.register_entity("anvil:item",{
})
local remove_item = function(pos, node)
local objs = minetest.get_objects_inside_radius({x = pos.x, y = pos.y + anvil.setting.item_displacement, z = pos.z}, .5)
local objs = minetest.env:get_objects_inside_radius({x = pos.x, y = pos.y + item_displacement, z = pos.z}, .5)
if objs then
for _, obj in ipairs(objs) do
if obj and obj:get_luaentity() and obj:get_luaentity().name == "anvil:item" then
@ -84,13 +80,13 @@ local remove_item = function(pos, node)
end
local update_item = function(pos, node)
local meta = minetest.get_meta(pos)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
if not inv:is_empty("input") then
pos.y = pos.y + anvil.setting.item_displacement
pos.y = pos.y + item_displacement
tmp.nodename = node.name
tmp.texture = inv:get_stack("input", 1):get_name()
local e = minetest.add_entity(pos,"anvil:item")
local e = minetest.env:add_entity(pos,"anvil:item")
local yaw = math.pi*2 - node.param2 * math.pi/2
e:setyaw(yaw)
end
@ -161,7 +157,6 @@ minetest.register_node("anvil:anvil", {
end
if (listname=='input'
and(stack:get_wear() == 0
or minetest.get_item_group(stack:get_name(), "not_repaired_by_anvil") ~= 0
or stack:get_name() == "technic:water_can"
or stack:get_name() == "technic:lava_can" )) then
@ -184,13 +179,12 @@ minetest.register_node("anvil:anvil", {
on_rightclick = function(pos, node, clicker, itemstack)
if itemstack:get_count() == 0 then
local meta = minetest.get_meta(pos)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
if not inv:is_empty("input") then
local return_stack = inv:get_stack("input", 1)
inv:set_stack("input", 1, nil)
local wield_index = clicker:get_wield_index()
clicker:get_inventory():set_stack("main", wield_index, return_stack)
clicker:get_inventory():add_item("main", return_stack)
remove_item(pos, node)
return return_stack
end
@ -198,7 +192,7 @@ minetest.register_node("anvil:anvil", {
local this_def = minetest.registered_nodes[node.name]
if this_def.allow_metadata_inventory_put(pos, "input", 1, itemstack:peek_item(), clicker) > 0 then
local s = itemstack:take_item()
local meta = minetest.get_meta(pos)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
inv:add_item("input", s)
update_item(pos,node)
@ -219,8 +213,7 @@ minetest.register_node("anvil:anvil", {
if not inv:is_empty("input") then
local return_stack = inv:get_stack("input", 1)
inv:set_stack("input", 1, nil)
local wield_index = puncher:get_wield_index()
puncher:get_inventory():set_stack("main", wield_index, return_stack)
puncher:get_inventory():add_item("main", return_stack)
remove_item(pos, node)
end
end
@ -287,7 +280,7 @@ minetest.register_node("anvil:anvil", {
minetest.chat_send_player( puncher:get_player_name(), S('Your @1 has been repaired successfully.', tool_desc))
return
else
pos.y = pos.y + anvil.setting.item_displacement
pos.y = pos.y + item_displacement
minetest.sound_play({name="anvil_clang"}, {pos=pos})
minetest.add_particlespawner({
amount = 10,
@ -325,7 +318,7 @@ minetest.register_lbm({
nodenames = { "anvil:anvil" },
run_at_every_load = true,
action = function(pos, node, active_object_count, active_object_count_wider)
local test_pos = {x=pos.x, y=pos.y + anvil.setting.item_displacement, z=pos.z}
local test_pos = {x=pos.x, y=pos.y + item_displacement, z=pos.z}
if #minetest.get_objects_inside_radius(test_pos, 0.5) > 0 then return end
update_item(pos, node)
end
@ -368,6 +361,6 @@ minetest.register_craft({
recipe = {
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
{"group:stick", '', ''} },
{'', "group:stick", '' } }
})

View File

@ -1,65 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-07 22:17-0700\n"
"PO-Revision-Date: 2017-04-20 19:05 -0500\n"
"Last-Translator: Carlos Barraza <carlosbarrazaes@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: Español\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: init.lua:19
msgid "Steel blacksmithing hammer"
msgstr "Martillo de acero para la herrería"
#: init.lua:20
msgid "A tool for repairing other tools at a blacksmith's anvil."
msgstr "Es una herramienta para reparar otras herramientas en el yunque del herrero"
#: init.lua:21
msgid ""
"Use this hammer to strike blows upon an anvil bearing a damaged tool and you "
"can repair it. It can also be used for smashing stone, but it is not well "
"suited to this task."
msgstr ""
"Use este martillo para dar golpes sobre el yunque donde puso la herramienta dañada"
"Tambien puede ser usado para romper piedra pero no es muy adecuado para esa tarea."
#: init.lua:98
msgid "Anvil"
msgstr "Yunque"
#: init.lua:99
msgid ""
"A tool for repairing other tools in conjunction with a blacksmith's hammer."
msgstr "Es una herramienta para reparar de herramientas dañadas en conjunto con el martillo del herrero."
#: init.lua:100
msgid ""
"Right-click on this anvil with a damaged tool to place the damaged tool upon "
"it. You can then repair the damaged tool by striking it with a blacksmith's "
"hammer. Repeated blows may be necessary to fully repair a badly worn tool. "
"To retrieve the tool either punch or right-click the anvil with an empty "
"hand."
msgstr ""
"Haga clic derecho sobre este yunque con una herramienta dañada"
"Puede reparar la herramienta dañada golpeándola con el martillo del herrero"
"Para reparar completamente una herramienta puede dar varios golpes"
"Para sacar la herramienta, golpeela con la mano vacia o tambien con un clic derecho"
#: init.lua:155
msgid "This anvil is for damaged tools only."
msgstr "Este yunque es sólo para herramientas dañadas"
#: init.lua:267
msgid "Your @1 has been repaired successfully."
msgstr "Su @1 ha sido reparado correctamente."

View File

@ -1,70 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-26 12:18+0200\n"
"PO-Revision-Date: 2017-06-26 12:22+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.2\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: init.lua:19
msgid "Steel blacksmithing hammer"
msgstr "Marteau de forgeron en acier"
#: init.lua:20
msgid "A tool for repairing other tools at a blacksmith's anvil."
msgstr "Un outil pour réparer les autres outils avec une enclume de forgeron."
#: init.lua:21
msgid ""
"Use this hammer to strike blows upon an anvil bearing a damaged tool and you "
"can repair it. It can also be used for smashing stone, but it is not well "
"suited to this task."
msgstr ""
"Utilisez ce marteau pour frapper une enclume contenant un outil endommagé, "
"ainsi vous pourrez le réparer. Il peut être aussi utilisé pour casser de la "
"pierre, mais il n'est pas adapté à cette tâche."
#: init.lua:98
msgid "Anvil"
msgstr "Enclume"
#: init.lua:99
msgid ""
"A tool for repairing other tools in conjunction with a blacksmith's hammer."
msgstr ""
"Un outil pour réparer les autres outils à utiliser avec un marteau de "
"forgeron."
#: init.lua:100
msgid ""
"Right-click on this anvil with a damaged tool to place the damaged tool upon "
"it. You can then repair the damaged tool by striking it with a blacksmith's "
"hammer. Repeated blows may be necessary to fully repair a badly worn tool. "
"To retrieve the tool either punch or right-click the anvil with an empty "
"hand."
msgstr ""
"Cliquez-droit sur cette enclume avec un outil endommagé pour le placer "
"dessus. Vous pourrez alors réparer l'outil endommagé en le frappant avec un "
"marteau de forgeron. Des coups successifs seront nécessaires pour réparer "
"l'outil entièrement. Pour récupérer l'outil, frappez dessus ou faites un "
"click-droit en ayant la main vide."
#: init.lua:155
msgid "This anvil is for damaged tools only."
msgstr "L'enclume s'utilise sur les outils endommagés."
#: init.lua:267
msgid "Your @1 has been repaired successfully."
msgstr "Votre @1 a été réparé avec succès."

View File

@ -1,68 +0,0 @@
# ITALIAN LOCALE FILE FOR THE ANVIL MODULE
# Copyright (C) 2017 Sokomine
# This file is distributed under the same license as the ANVIL package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Italian locale file for the Anvil module\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-07 22:17-0700\n"
"PO-Revision-Date: 2017-08-18 16:14+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.10\n"
#: init.lua:19
msgid "Steel blacksmithing hammer"
msgstr "Martello da fabbro di acciaio"
#: init.lua:20
msgid "A tool for repairing other tools at a blacksmith's anvil."
msgstr "Un attrezzo per riparare altri attrezzi su di una incudine da fabbro."
#: init.lua:21
msgid ""
"Use this hammer to strike blows upon an anvil bearing a damaged tool and you "
"can repair it. It can also be used for smashing stone, but it is not well "
"suited to this task."
msgstr ""
"Usate questo martello per colpire una incudine su cui è posto un attrezzo "
"danneggiato e potrete ripararlo. Può anche essere usato per colpire la "
"pietra, ma non è molto adatto a questo compito."
#: init.lua:98
msgid "Anvil"
msgstr "Incudine"
#: init.lua:99
msgid ""
"A tool for repairing other tools in conjunction with a blacksmith's hammer."
msgstr "Un attrezzo per riparare altri attrezzi usando un martello da fabbro."
#: init.lua:100
msgid ""
"Right-click on this anvil with a damaged tool to place the damaged tool upon "
"it. You can then repair the damaged tool by striking it with a blacksmith's "
"hammer. Repeated blows may be necessary to fully repair a badly worn tool. "
"To retrieve the tool either punch or right-click the anvil with an empty "
"hand."
msgstr ""
"Fate click destro su questa incudine con un attrezzo danneggiato per "
"metterlo sull'incudine. Poi potrete ripararlo colpendolo con un martello da "
"fabbro. Potrebbero essere necessari più colpi per riparare un attrezzo "
"gravemente danneggiato. Per riprendere l'attrezzo colpite o fate click "
"destro sull'incudine a mani vuote."
#: init.lua:155
msgid "This anvil is for damaged tools only."
msgstr "Questa incudine è solo per attrezzi danneggiati."
#: init.lua:267
msgid "Your @1 has been repaired successfully."
msgstr "La/il vostr* @1 è stat* riparat* con successo."

View File

@ -110,15 +110,12 @@ for _, nodeclass in ipairs(NodeClass) do
"blox_stone_"..nodeclass..".png"
},
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("blox:cobble_"..nodeclass, {
@ -130,15 +127,12 @@ for _, nodeclass in ipairs(NodeClass) do
"blox_cobble_"..nodeclass..".png"
},
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("blox:wood_"..nodeclass, {
@ -150,15 +144,12 @@ for _, nodeclass in ipairs(NodeClass) do
"blox_wood_"..nodeclass..".png"
},
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
table.insert(blox.old_89_color_nodes, "blox:stone_"..nodeclass)
@ -172,62 +163,53 @@ minetest.register_node("blox:wood_tinted", {
description = "Blox tinted wood",
tiles = { "blox_wood_tinted.png" },
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("blox:stone_square", {
description = "Blox stone square",
tiles = { "blox_stone_square.png" },
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("blox:cobble_tinted", {
description = "Blox tinted cobble",
tiles = { "blox_cobble_tinted.png" },
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:cobble"
})
minetest.register_node("blox:stone_tinted", {
description = "Blox tinted stone",
tiles = { "blox_stone_tinted.png" },
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:cobble"
drop = {
items = {
{items = {"blox:cobble_tinted"}, inherit_color = true },
}
}
})
table.insert(blox.old_89_color_nodes, "blox:wood_tinted")
@ -237,106 +219,228 @@ table.insert(blox.old_89_color_nodes, "blox:stone_tinted")
-- Override default stone and default cobble
minetest.override_item("default:stone_block", {
palette = "unifieddyes_palette_extended.png",
ud_replacement_node = "blox:stone_square",
groups = {cracky = 3, stone = 1, ud_param2_colorable = 1},
})
minetest.override_item("default:stone", {
palette = "unifieddyes_palette_extended.png",
ud_replacement_node = "blox:stone_tinted",
after_place_node = unifieddyes.recolor_on_place,
groups = {cracky = 3, stone = 1, ud_param2_colorable = 1},
})
minetest.override_item("default:cobble", {
palette = "unifieddyes_palette_extended.png",
ud_replacement_node = "blox:cobble_tinted",
after_place_node = unifieddyes.recolor_on_place,
groups = {cracky = 3, stone = 2, ud_param2_colorable = 1},
})
local dye_color = "unifieddyes:white"
-- override the Moreblocks nodes we use
if moreblocks then
minetest.override_item("moreblocks:stone_tile", {
palette = "unifieddyes_palette_extended.png",
ud_replacement_node = "blox:stone_square",
after_place_node = unifieddyes.recolor_on_place,
groups = {cracky = 3, ud_param2_colorable = 1},
})
minetest.override_item("blox:stone_square", {
drop = "moreblocks:stone_tile",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
})
minetest.override_item("moreblocks:circle_stone_bricks", {
palette = "unifieddyes_palette_extended.png",
ud_replacement_node = "blox:stone_loop",
after_place_node = unifieddyes.recolor_on_place,
groups = {cracky = 3, ud_param2_colorable = 1},
})
minetest.override_item("blox:stone_loop", {
drop = "moreblocks:circle_stone_bricks",
groups = {cracky = 3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
unifieddyes.register_color_craft({
output = "blox:stone_loop",
type = "shapeless",
palette = "extended",
neutral_node = "moreblocks:circle_stone_bricks",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.override_item("moreblocks:iron_checker", {
palette = "unifieddyes_palette_extended.png",
ud_replacement_node = "blox:stone_checker",
after_place_node = unifieddyes.recolor_on_place,
groups = {cracky = 3, ud_param2_colorable = 1},
})
minetest.override_item("blox:stone_checker", {
drop = "moreblocks:iron_checker",
groups = {cracky = 3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
unifieddyes.register_color_craft({
output = "blox:stone_checker",
type = "shapeless",
palette = "extended",
neutral_node = "moreblocks:iron_checker",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.override_item("moreblocks:wood_tile", {
palette = "unifieddyes_palette_extended.png",
ud_replacement_node = "blox:wood_quarter",
after_place_node = unifieddyes.recolor_on_place,
groups = {wood = 1, snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, ud_param2_colorable = 1},
})
minetest.override_item("blox:wood_quarter", {
drop = "moreblocks:wood_tile",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
unifieddyes.register_color_craft({
output = "blox:wood_quarter",
type = "shapeless",
palette = "extended",
neutral_node = "moreblocks:wood_tile",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.override_item("moreblocks:wood_tile_flipped", {
palette = "unifieddyes_palette_extended.png",
ud_replacement_node = "blox:wood_quarter",
after_place_node = unifieddyes.recolor_on_place,
groups = {wood = 1, snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, ud_param2_colorable = 1},
})
else
minetest.register_craft({
output = "blox:stone_square 6",
unifieddyes.register_color_craft({
output = "blox:wood_quarter",
type = "shapeless",
palette = "extended",
neutral_node = "moreblocks:wood_tile_flipped",
recipe = {
{ dye_color, "default:stone", "default:stone" },
{ "default:stone", dye_color, "default:stone" },
{ "default:stone", "default:stone", dye_color },
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
end
local dye_color = "dye:white"
if minetest.get_modpath("coloredwood") then
minetest.register_craft({
output = "blox:wood_tinted 6",
output = unifieddyes.make_colored_itemstack("blox:wood_tinted 4", "extended", dye_color),
recipe = {
{ "", "default:wood", "" },
{ "default:wood", dye_color, "default:wood" },
{ "", "default:wood", "" },
{ dye_color, "default:wood", dye_color },
{ "default:wood", "", "default:wood" },
{ dye_color, "default:wood", dye_color },
}
})
unifieddyes.register_color_craft({
output = "blox:wood_tinted",
type = "shapeless",
palette = "extended",
neutral_node = "blox:wood_tinted",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
else
minetest.override_item("default:wood", {
ud_replacement_node = "blox:wood_tinted",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, ud_param2_colorable = 1},
})
minetest.override_item("blox:wood_tinted", {
drop = "default:wood",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
})
unifieddyes.register_color_craft({
output = "blox:wood_tinted",
type = "shapeless",
palette = "extended",
neutral_node = "default:wood",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
end
-- Crafting
-- Other crafts
for _, nodeclass in ipairs(NodeClass) do
for _, material in ipairs(NodeMaterial) do
local item = "blox:"..material.."_"..nodeclass
unifieddyes.register_color_craft({
output = item,
type = "shapeless",
palette = "extended",
neutral_node = item,
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
end
end
unifieddyes.register_color_craft({
output = "blox:stone_square",
type = "shapeless",
palette = "extended",
neutral_node = "default:stone_block",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "blox:stone_square",
type = "shapeless",
palette = "extended",
neutral_node = "blox:stone_square",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "blox:cobble_tinted",
type = "shapeless",
palette = "extended",
neutral_node = "default:cobble",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "blox:cobble_tinted",
type = "shapeless",
palette = "extended",
neutral_node = "blox:cobble_tinted",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "blox:stone_tinted",
type = "shapeless",
palette = "extended",
neutral_node = "default:stone",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "blox:stone_tinted",
type = "shapeless",
palette = "extended",
neutral_node = "blox:stone_tinted",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
output = 'blox:glowstone 2',
@ -351,71 +455,86 @@ for _, material in ipairs(NodeMaterial) do
local def_mat = "default:"..material
minetest.register_craft({
unifieddyes.register_color_craft({
output = "blox:"..material.."_diamond 4",
palette = "extended",
neutral_node = def_mat,
recipe = {
{ def_mat, dye_color, def_mat },
{ dye_color, "", dye_color },
{ def_mat, dye_color, def_mat },
{ "NEUTRAL_NODE", "MAIN_DYE", "NEUTRAL_NODE" },
{ "MAIN_DYE", "", "MAIN_DYE" },
{ "NEUTRAL_NODE", "MAIN_DYE", "NEUTRAL_NODE" }
}
})
if not (moreblocks and material == "wood") then
minetest.register_craft({
unifieddyes.register_color_craft({
output = "blox:"..material.."_quarter 4",
palette = "extended",
neutral_node = def_mat,
recipe = {
{ dye_color, def_mat },
{ def_mat, dye_color },
{ "MAIN_DYE", "NEUTRAL_NODE" },
{ "NEUTRAL_NODE", "MAIN_DYE" },
}
})
end
minetest.register_craft({
unifieddyes.register_color_craft({
output = "blox:"..material.."_cross 4",
palette = "extended",
neutral_node = def_mat,
recipe = {
{ def_mat, "", def_mat },
{ "", dye_color, "" },
{ def_mat, "", def_mat },
{ "NEUTRAL_NODE", "", "NEUTRAL_NODE" },
{ "", "MAIN_DYE", "" },
{ "NEUTRAL_NODE", "", "NEUTRAL_NODE" }
}
})
minetest.register_craft({
unifieddyes.register_color_craft({
output = "blox:"..material.."_corner 4",
palette = "extended",
neutral_node = def_mat,
recipe = {
{ dye_color, "", dye_color },
{ "", def_mat, "" },
{ dye_color, "", dye_color },
{ "MAIN_DYE", "", "MAIN_DYE" },
{ "", "NEUTRAL_NODE", "" },
{ "MAIN_DYE", "", "MAIN_DYE" }
}
})
if not (moreblocks and material == "stone") then
minetest.register_craft({
unifieddyes.register_color_craft({
output = "blox:"..material.."_checker 6",
palette = "extended",
neutral_node = def_mat,
recipe = {
{ def_mat, dye_color, def_mat },
{ dye_color, def_mat, dye_color },
{ def_mat, dye_color, def_mat },
{ "NEUTRAL_NODE", "MAIN_DYE", "NEUTRAL_NODE" },
{ "MAIN_DYE", "NEUTRAL_NODE", "MAIN_DYE" },
{ "NEUTRAL_NODE", "MAIN_DYE", "NEUTRAL_NODE" }
}
})
minetest.register_craft({
unifieddyes.register_color_craft({
output = "blox:"..material.."_checker 8",
palette = "extended",
neutral_node = def_mat,
recipe = {
{ dye_color, def_mat, dye_color },
{ def_mat, dye_color, def_mat },
{ dye_color, def_mat, dye_color },
{ "MAIN_DYE", "NEUTRAL_NODE", "MAIN_DYE" },
{ "NEUTRAL_NODE", "MAIN_DYE", "NEUTRAL_NODE" },
{ "MAIN_DYE", "NEUTRAL_NODE", "MAIN_DYE" }
}
})
minetest.register_craft({
unifieddyes.register_color_craft({
output = "blox:"..material.."_loop 6",
palette = "extended",
neutral_node = def_mat,
recipe = {
{ def_mat, def_mat, def_mat },
{ def_mat, dye_color, def_mat },
{ def_mat, def_mat, def_mat },
{ "NEUTRAL_NODE", "NEUTRAL_NODE", "NEUTRAL_NODE" },
{ "NEUTRAL_NODE", "MAIN_DYE", "NEUTRAL_NODE" },
{ "NEUTRAL_NODE", "NEUTRAL_NODE", "NEUTRAL_NODE" },
}
})
end
end

View File

@ -40,7 +40,6 @@ minetest.register_node("bobblocks:block", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
sunlight_propagates = true,
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
@ -53,8 +52,6 @@ minetest.register_node("bobblocks:block", {
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("bobblocks:block_off", {
@ -63,7 +60,6 @@ minetest.register_node("bobblocks:block_off", {
tiles = {"bobblocks_block.png^[opacity:"..bobblocks.opacity},
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = false,
use_texture_alpha = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1, ud_param2_colorable = 1},
@ -75,8 +71,6 @@ minetest.register_node("bobblocks:block_off", {
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
-- Block Poles
@ -88,7 +82,6 @@ minetest.register_node("bobblocks:pole", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
sunlight_propagates = true,
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
@ -101,8 +94,6 @@ minetest.register_node("bobblocks:pole", {
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("bobblocks:pole_off", {
@ -112,7 +103,6 @@ minetest.register_node("bobblocks:pole_off", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
sunlight_propagates = true,
is_ground_content = false,
use_texture_alpha = true,
@ -127,8 +117,6 @@ minetest.register_node("bobblocks:pole_off", {
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
-- old nodes grandfathered-in because they have a different texture or usage than the colored ones.
@ -150,7 +138,6 @@ minetest.register_node("bobblocks:wavyblock", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
sunlight_propagates = true,
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
@ -164,8 +151,6 @@ minetest.register_node("bobblocks:wavyblock", {
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("bobblocks:wavyblock_off", {
@ -174,7 +159,6 @@ minetest.register_node("bobblocks:wavyblock_off", {
tiles = {"bobblocks_wavyblock.png^[opacity:"..bobblocks.opacity},
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = false,
use_texture_alpha = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1, ud_param2_colorable = 1},
@ -187,8 +171,6 @@ minetest.register_node("bobblocks:wavyblock_off", {
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("bobblocks:wavypole", {
@ -199,14 +181,11 @@ minetest.register_node("bobblocks:wavypole", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
sunlight_propagates = true,
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1},
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
--light_source = LIGHT_MAX-0,
})
@ -231,6 +210,17 @@ minetest.register_craft({
},
})
unifieddyes.register_color_craft({
output = "bobblocks:block",
palette = "extended",
type = "shapeless",
neutral_node = "bobblocks:block",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
output = "bobblocks:pole",
recipe = {
@ -238,15 +228,50 @@ minetest.register_craft({
}
})
unifieddyes.register_color_craft({
output = "bobblocks:pole",
palette = "extended",
type = "shapeless",
neutral_node = "bobblocks:pole",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
output = "bobblocks:wavyblock 2",
type = "shapeless",
recipe = {
"bobblocks:block",
"bobblocks:block"
"default:cobble"
},
})
unifieddyes.register_color_craft({
output = "bobblocks:wavyblock 2",
palette = "extended",
type = "shapeless",
neutral_node = "bobblocks:block",
recipe = {
"MAIN_DYE",
"NEUTRAL_NODE",
"default:cobble"
}
})
unifieddyes.register_color_craft({
output = "bobblocks:wavyblock",
palette = "extended",
type = "shapeless",
neutral_node = "bobblocks:wavyblock",
recipe = {
"MAIN_DYE",
"NEUTRAL_NODE"
}
})
minetest.register_craft({
output = "bobblocks:wavypole",
recipe = {
@ -254,6 +279,17 @@ minetest.register_craft({
}
})
unifieddyes.register_color_craft({
output = "bobblocks:wavypole",
palette = "extended",
type = "shapeless",
neutral_node = "bobblocks:wavypole",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
-- Convert old static nodes to the param2 scheme
for _, i in ipairs(bobblocks.colorlist) do

View File

@ -1,9 +1,14 @@
## Castle farm products
=-=-=-=-=-=-=-=-=-=
B: Philipbenr, DanDuncombe, FaceDeer
Castles Mod
by: Philipbenr And DanDuncombe
=-=-=-=-=-=-=-=-=-=
Licence: MIT
see: LICENSE
=-=-=-=-=-=-=-=-=-=
Contains farm products useful for decorating a castle:
@ -11,3 +16,5 @@ Contains farm products useful for decorating a castle:
* Hide wall and floor coverings
* Bound straw bale
* Straw training dummy
=-=-=-=-=-=-=-=-=-=

View File

@ -1,30 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-27 00:59-0700\n"
"PO-Revision-Date: 2017-04-21 19:47-0500\n"
"Last-Translator: Carlos Barraza <carlosbarrazaes@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: Español\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: hides.lua:9
msgid "Hides"
msgstr "Escondite"
#: straw.lua:13
msgid "Bound Straw"
msgstr "Paja amarrada"
#: straw.lua:22
msgid "Training Dummy"
msgstr "Maniqui de Entrenamiento"

View File

@ -1,30 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2017
# This file is distributed under the same license as the castle_farming package.
# Caio Roberto <caiorrs@gmail.com>, 2017.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-27 00:59-0700\n"
"PO-Revision-Date: 2017-06-29 13:00-0330\n"
"Last-Translator: Caio Roberto <caiorrs@gmail.com>\n"
"Language-Team: Paulo Slomp FACED UFRGS <00009228@ufrgs.br>\n"
"Language: Brazilian Portuguese\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: hides.lua:9
msgid "Hides"
msgstr "Esconde-se"
#: straw.lua:13
msgid "Bound Straw"
msgstr "Palha Amarrada"
#: straw.lua:22
msgid "Training Dummy"
msgstr "Vaca Parada de Madeira (para Laço)"

View File

@ -1,9 +1,9 @@
minetest.register_alias_force("cottages:straw", "farming:straw")
minetest.register_alias_force("castle:straw", "farming:straw")
minetest.register_alias_force("darkage:straw", "farming:straw")
minetest.register_alias_force("cottages:straw_bale", "castle_farming:bound_straw")
minetest.register_alias_force("darkage:straw_bale", "castle_farming:bound_straw")
minetest.register_alias_force("castle:bound_straw", "castle_farming:bound_straw")
minetest.register_alias("cottages:straw", "farming:straw")
minetest.register_alias("castle:straw", "farming:straw")
minetest.register_alias("darkage:straw", "farming:straw")
minetest.register_alias("cottages:straw_bale", "castle_farming:bound_straw")
minetest.register_alias("darkage:straw_bale", "castle_farming:bound_straw")
minetest.register_alias("castle:bound_straw", "castle_farming:bound_straw")
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
@ -72,4 +72,4 @@ minetest.register_craft({
type = "fuel",
recipe = "castle_farming:straw_dummy",
burntime = 10*2 + 4*stick_burn_time
})
})

View File

@ -16,21 +16,6 @@ if minetest.get_modpath("doors") then
{"default:tree", "default:tree"},
}
})
local door_recipe
if minetest.get_modpath("xpanes") then
door_recipe = {
{"xpanes:jailbars_flat", "xpanes:jailbars_flat"},
{"xpanes:jailbars_flat", "xpanes:jailbars_flat"},
{"xpanes:jailbars_flat", "xpanes:jailbars_flat"},
}
else
door_recipe = {
{"default:steel_ingot", ""},
{"", "default:steel_ingot"},
{"default:steel_ingot", ""},
}
end
doors.register("castle_gates:jail_door", {
tiles = {{ name = "castle_door_jail.png", backface_culling = true }},
@ -40,7 +25,11 @@ if minetest.get_modpath("doors") then
groups = { cracky = 2, door = 1, flow_through = 1},
sound_open = "doors_steel_door_open",
sound_close = "doors_steel_door_close",
recipe = door_recipe,
recipe = {
{"castle_gates:jailbars", "castle_gates:jailbars"},
{"castle_gates:jailbars", "castle_gates:jailbars"},
{"castle_gates:jailbars", "castle_gates:jailbars"},
}
})
minetest.register_alias("castle:oak_door_a", "castle_gates:oak_door_a")

View File

@ -153,9 +153,9 @@ local get_door_layout = function(pos, facedir, player)
local test_node_def = minetest.registered_nodes[test_node.name]
can_slide_to:set_pos(test_pos, test_node_def.buildable_to == true)
if test_node_def.paramtype2 == "facedir" then -- prospective door nodes need to be of type facedir
if test_node_def.paramtype2 == "facedir" then
local test_node_dirs = get_dirs(test_node.param2)
local coplanar = vector.equals(test_node_dirs.back, door.directions.back) -- the "back" vector needs to point in the same direction as the rest of the door
local coplanar = vector.equals(test_node_dirs.back, door.directions.back)
if castle_gate_group_value == nil and test_node_def.groups.castle_gate ~= nil then
castle_gate_group_value = test_node_def.groups.castle_gate -- read the group value from the first gate node encountered
@ -163,18 +163,17 @@ local get_door_layout = function(pos, facedir, player)
if coplanar and test_node_def.groups.castle_gate == castle_gate_group_value then
local entry = {["pos"] = test_pos, ["node"] = test_node}
table.insert(door.all, entry) -- it's definitely a gate node of some sort.
if test_node_def._gate_hinge ~= nil then -- it's a hinge type of node, need to do extra work
table.insert(door.all, entry)
if test_node_def._gate_hinge ~= nil then
local axis, placement = interpret_hinge(test_node_def._gate_hinge, test_pos, test_node_dirs)
if door.hinge == nil then -- this is the first hinge we've encountered.
if door.hinge == nil then
door.hinge = {axis=axis, placement=placement}
door.directions = test_node_dirs -- force the door as a whole to use the same reference frame as the first hinge
elseif door.hinge.axis ~= axis then -- there was a previous hinge. Do they rotate on the same axis?
elseif door.hinge.axis ~= axis then
return nil -- Misaligned hinge axes, door cannot rotate.
else
local axis_dir = {x=0, y=0, z=0}
axis_dir[axis] = 1
local displacement = vector.normalize(vector.subtract(placement, door.hinge.placement)) -- check if this new hinge is displaced relative to the first hinge on any axis other than the rotation axis
local displacement = vector.normalize(vector.subtract(placement, door.hinge.placement))
if not (vector.equals(displacement, axis_dir) or vector.equals(displacement, vector.multiply(axis_dir, -1))) then
return nil -- Misaligned hinge offset, door cannot rotate.
end

View File

@ -91,33 +91,34 @@ castle_gates.register_gate_slot = function(material)
minetest.register_craft({
output = mod_name..":"..material.name.."_gate_slot 2",
output = mod_name..":"..material.name.."_portcullis_slot 3",
recipe = {
{material.craft_material,"",material.craft_material},
{material.craft_material,"",material.craft_material},
{material.craft_material,"",material.craft_material},
},
})
minetest.register_craft({
output = mod_name..":"..material.name.."_gate_slot",
output = mod_name..":"..material.name.."_portcullis_slot",
type = "shapeless",
recipe = {mod_name..":"..material.name.."_gate_slot_reverse"},
recipe = {mod_name..":"..material.name.."_portcullis_slot_reverse"},
})
minetest.register_craft({
output = mod_name..":"..material.name.."_gate_slot_reverse",
output = mod_name..":"..material.name.."_portcullis_slot_reverse",
type = "shapeless",
recipe = {mod_name..":"..material.name.."_gate_slot"},
recipe = {mod_name..":"..material.name.."_portcullis_slot"},
})
if burn_time > 0 then
minetest.register_craft({
type = "fuel",
recipe = mod_name..":"..material.name.."_gate_slot",
recipe = mod_name..":"..material.name.."_portcullis_slot",
burntime = burn_time * 2,
})
minetest.register_craft({
type = "fuel",
recipe = mod_name..":"..material.name.."_gate_slot_reverse",
recipe = mod_name..":"..material.name.."_portcullis_slot_reverse",
burntime = burn_time * 2,
})
end

View File

@ -1,261 +0,0 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-01 23:41-0700\n"
"PO-Revision-Date: 2017-04-28 11:56-0400\n"
"Last-Translator: Carlos Barraza\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: Español\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: doc.lua:11
msgid "Heavy wooden bars designed to prevent entry even to siege equipment."
msgstr ""
"Barras de madera pesadas diseñadas para evitar la entrada incluso a equipo de "
"asedio"
#: doc.lua:12
msgid ""
"Place these bars in a structure together and they will slide as a unified "
"gate when clicked on."
msgstr ""
"Coloque estas barras en una estructura juntas y se deslizarán como si "
"estuvieran unidas cuando se le hace clic"
#: doc.lua:14
msgid ""
"The bottom edge of a portcullis gate, with knobs to lock securely into the "
"floor."
msgstr ""
"Es el borde inferior de una puerta rastrillo, con perillas para bloquearla con "
"seguridad en el piso"
#: doc.lua:15
msgid ""
"This block can be used to define the edge of a portcullius that meets up "
"with another gate, should you have an arrangement like that. Otherwise it's "
"just decorative."
msgstr ""
"Este bloque puede ser usado para definir el borde de una puerta rastrillo "
"que esta cerca de otra puerta, si tiene varias puertas independientes, "
"de lo contrario es simplemente decorativo"
#: doc.lua:17
msgid "A basic gate panel."
msgstr "Un panel básico de puerta"
#: doc.lua:18
msgid ""
"This gate segment will move in unison with adjoining gate segments when "
"right-clicked."
msgstr ""
"Este segmento de puerta se moverá junto con los demas segmentos de puerta "
"adyacente cuando se haga clic con el botón derecho del ratón"
#: doc.lua:20
msgid "A gate panel with a defined edge."
msgstr "Un panel de puerta con un borde."
#: doc.lua:21
msgid ""
"The darkened edge of this panel marks the edge of the gate it's a part of. "
"You can use these when building double doors to ensure the two parts swing "
"separately, for example. Note that edges aren't strictly necessary for gates "
"that stand alone."
msgstr ""
"El borde oscurecido de este panel marca el limite de la puerta."
"Usted puede utilizar estos bloques para construir puertas dobles para asegurar "
"que las dos puertas funcionen por separado, por ejemplo. Tenga en cuenta que "
"los bordes no son estrictamente necesarios para las puertas individuales"
#: doc.lua:23
msgid "A gate edge with a handle."
msgstr "Un panel de puerta con pestillo"
#: doc.lua:24
msgid ""
"The handle is basically decorative, a door this size can be swung by "
"clicking anywhere on it. But the darkened edge of this panel is useful for "
"defining the edge of a gate when it abuts a partner to the side."
msgstr ""
"El pestillo es básicamente decorativo, una puerta de este tamaño se puede "
"abrir haciendo clic en cualquier parte de ella. Pero el borde oscuro de este "
"panel es útil para definir el borde de la puerta cuando hay otra puerta al "
"lado."
#: doc.lua:26
msgid "A hinged gate segment that allows a gate to swing."
msgstr "Un segmento de puerta con bisagra permite que la puerta se abra."
#: doc.lua:27
msgid ""
"If you have more than one hinge in your gate, make sure the hinges line up "
"correctly otherwise the gate will not be able to swing. The hinge is the "
"protruding block along the edge of the gate panel."
msgstr ""
"Si tiene más de una bisagra en su puerta, asegúrese de que las bisagras se "
"alineen correctamente, de lo contrario la puerta no será capaz de abrirse. "
"la bisagra es el bloque sobresaliente a lo largo del borde del panel de la "
"puerta."
#: doc.lua:29
msgid "A block with a slot to allow an adjacent sliding gate through."
msgstr ""
"Un bloque con una ranura en el medio para que una puerta deslizante pueda "
"pasar a través de ella."
#: doc.lua:30
msgid ""
"This block is designed to extend into a neighboring node that a sliding gate "
"passes through, to provide a tight seal for the gate to move through without "
"allowing anything else to squeeze in."
msgstr ""
"Este bloque está diseñado para un nodo pueda deslizarse a travéz de este, para "
"proporcionar un cierre hermético que solo deja pasar la puerta sin permitir "
"entrar nada mas."
#: doc.lua:32
msgid ""
"A block that extends into an adjacent node to provide a tight seal for a "
"large gate."
msgstr ""
"Un bloque con una ranura en el lado para que una puerta deslizante pueda "
"pasar a través de ella."
#: doc.lua:33
msgid ""
"Two nodes cannot occupy the same space, but this block extends into a "
"neighboring node's space to allow for gates to form a tight seal. It can be "
"used with sliding gates or swinging gates."
msgstr ""
"Dos nodos no pueden utilizar el mismo espacio, pero este nodo se extiende al "
"espacio de un nodo vecino para permitir que las puertas formen un cierre "
"hermético. Puede utilizarse con puertas deslizantes y con las puertas que se "
"abren rotando."
#: doc.lua:37
msgid "Gates"
msgstr "Puertas"
#: doc.lua:38
msgid ""
"Gates are large multi-node constructions that swing on hinges or slide out "
"of the way when triggered."
msgstr ""
"Las puertas grandes son construcciones multi nodo que se abren usando bisagras "
"o se deslizan hacia arriba cuando se activan"
#: doc.lua:43
msgid "Gate construction"
msgstr "Construcción de Puertas"
#: doc.lua:45
msgid ""
"Gates are multi-node constructions, usually (though not always) consisting "
"of multiple node types that fit together into a unified whole. The "
"orientation of gate nodes is significant, so a screwdriver will be a helpful "
"tool when constructing gates.\n"
"\n"
"A gate's extent is determined by a \"flood fill\" operation. When you "
"trigger a gate block, all compatible neighboring blocks will be considered "
"part of the same structure and will move in unison. Only gate blocks that "
"are aligned with each other will be considered part of the same gate. If you "
"wish to build adjoining gates (for example, a large pair of double doors "
"that meet in the center) you'll need to make use of gate edge blocks to "
"prevent it all from being considered one big door. Note that if your gate "
"does not abut any other gates you don't actually need to define its edges "
"this way - you don't have to use edge blocks in this case.\n"
"\n"
"If a gate has no hinge nodes it will be considered a sliding gate. When "
"triggered, the gate code will search for a direction that the gate can slide "
"in and will move it in that direction at a rate of one block-length per "
"second. Once it reaches an obstruction it will stop, and when triggered "
"again it will try sliding in the opposite direction.\n"
"\n"
"If a gate has hinge nodes then triggering it will cause the gate to try "
"swinging around the hinge. If the gate has multiple hinges and they don't "
"line up properly the gate will be unable to move. Note that the gate can "
"only exist in 90-degree increments of orientation, but the gate still looks "
"for obstructions in the region it is swinging through and will not swing if "
"there's something in the way."
msgstr ""
"Las puertas son generalmente construcciones multi nodo (aunque no siempre), "
"que consisten de múltiples tipos de nodos que se acomodan en un todo "
"unificado. La orientación de los nodos de la puerta es importante, por lo que "
"un destornillador será útil para construir las puertas.\n"
"\n"
"La extención de una puerta se determina mediante una operación de \"Llenado de "
"Inundación\". Al activar un bloque de la puerta, todos los bloques vecinos "
"compatibles se considerán parte de la misma estructura y se moveran al unísono. "
"Sólo los bloques de compuerta que estén alineados entre sí se considerarán "
"parte de la misma puerta. Si desea construir puertas adyacentes (por ejemplo, "
"un gran par de puertas dobles que se abran en el centro) tendrá que hacer uso "
"de bloques de borde de puerta para evitar que todo sea considerado solo una "
"gran puerta. Tenga en cuenta que si su puerta no se apoya en ninguna otra "
"puerta, no necesita usar los bordes de puerta en este caso.\n"
"\n"
"Si una puerta no tiene nodos de bisagra se considerará una puerta deslizante. "
"Cuando se ejecuta el codigo de la puerta buscará una dirección en la que la "
"puerta pueda deslizarse y se moverá en esa dirección a una velocidad de un "
"bloque por segundo. Una vez que llega a una obstrucción se detendrá, y cuando "
"se ejecute de nuevo tratará de deslizarse en la dirección opuesta.\n"
"\n"
"Si una puerta tiene nodos de bisagra, entonces al activar la puerta tratara de "
"girar al rededor de la bisagra. Si la puerta tiene bisagras múltiples y no "
"estan bien alineadas, la puerta no podrá moverse. Tenga en cuenta que la "
"puerta sólo puede existir en incrementos de 90 grados de orientación, pero la "
"puerta todavía busca obstrucciones en la región que está moviéndose y no "
"girara si hay algo en el camino."
#: doors.lua:8
msgid "Oak Door"
msgstr "Puerta de Roble"
#: doors.lua:22
msgid "Jail Door"
msgstr "Puerta de Cárcel"
#: doors.lua:43
msgid "Jail Bars"
msgstr ""
#: gate_slots.lua:36
msgid "Stonebrick"
msgstr "Ladrillo de Piedra"
#: gate_slots.lua:45
msgid "@1 Gate Slot"
msgstr "Espacio para Puerta de @1"
#: gate_slots.lua:70
msgid "@1 Gate Slot Reverse"
msgstr "Espacio para Puerta Invertido de @1"
#: gates.lua:7
msgid "Portcullis Bars"
msgstr "Barras de la Puerta Rastrillo"
#: gates.lua:37
msgid "Portcullis Bottom"
msgstr "Terminación de la Puerta Rastrillo"
#: gates.lua:104
msgid "Gate Door"
msgstr "Porción de la Puerta"
#: gates.lua:136
msgid "Gate Door Edge"
msgstr "Borde de la Puerta"
#: gates.lua:175
msgid "Gate Door With Handle"
msgstr "Pestillo de la Puerta"
#: gates.lua:218
msgid "Gate Door With Hinge"
msgstr "Bisagra de la Puerta"

View File

@ -1,274 +0,0 @@
# ITALIAN LOCALE FILE FOR THE CASTLE GATES MODULE
# Copyright (C) 2017 Philipbenr And DanDuncombe
# This file is distributed under the same license as the CASTLE GATES package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Castle Gates\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-01 23:41-0700\n"
"PO-Revision-Date: 2017-09-26 23:51+0100\n"
"Last-Translator: Hamlet <h4mlet@riseup.net>\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.10\n"
#: doc.lua:11
msgid "Heavy wooden bars designed to prevent entry even to siege equipment."
msgstr ""
"Pesanti sbarre di legno progettate per impedire l'accesso perfino "
"all'equipaggiamento da assedio."
#: doc.lua:12
msgid ""
"Place these bars in a structure together and they will slide as a unified "
"gate when clicked on."
msgstr ""
"Componete una struttura mettendo insieme queste sbarre ed esse scorreranno "
"come un'unica saracinesca quando ci si cliccherà sopra."
#: doc.lua:14
msgid ""
"The bottom edge of a portcullis gate, with knobs to lock securely into the "
"floor."
msgstr ""
"La parte inferiore di una saracinesca, con puntali per bloccarsi saldamente "
"nel pavimento."
#: doc.lua:15
msgid ""
"This block can be used to define the edge of a portcullius that meets up "
"with another gate, should you have an arrangement like that. Otherwise it's "
"just decorative."
msgstr ""
"Questo blocco può essere usato per definire l'estremità di una saracinesca "
"che si incontra con un'altra, se doveste avere una tale disposizione. "
"Altrimenti è solo decorativo."
#: doc.lua:17
msgid "A basic gate panel."
msgstr "Un pannello di base per cancelli, porte e portoni."
#: doc.lua:18
msgid ""
"This gate segment will move in unison with adjoining gate segments when "
"right-clicked."
msgstr ""
"Questo segmento si muoverà all'unisono con altri segmenti adiacenti quando "
"cliccato col tasto destro."
#: doc.lua:20
msgid "A gate panel with a defined edge."
msgstr ""
"Un pannello per cancelli, porte e portoni avente un'estremità definita."
#: doc.lua:21
msgid ""
"The darkened edge of this panel marks the edge of the gate it's a part of. "
"You can use these when building double doors to ensure the two parts swing "
"separately, for example. Note that edges aren't strictly necessary for gates "
"that stand alone."
msgstr ""
"L'estremità annerita di questo pannello contrassegna il bordo del cancello, "
"porta o portone di cui fa parte. Per esempio potete usarla quando costruite "
"doppi battenti per assicurarvi che le due parti ruotino separatamente. Si "
"noti che queste estremità non sono strettamente necessarie per cancelli, "
"porte e portoni a battente singolo."
#: doc.lua:23
msgid "A gate edge with a handle."
msgstr "Una estremità di cancello, porta o portone con una maniglia."
#: doc.lua:24
msgid ""
"The handle is basically decorative, a door this size can be swung by "
"clicking anywhere on it. But the darkened edge of this panel is useful for "
"defining the edge of a gate when it abuts a partner to the side."
msgstr ""
"Fondamentalmente la maniglia è decorativa, un cancello o porta di queste "
"dimensioni possono essere aperti cliccando un punto qualunque su di essi. Ma "
"il bordo annerito di questo pannello è utile per stabilire la fine di un "
"battente quando confina con un altro."
#: doc.lua:26
msgid "A hinged gate segment that allows a gate to swing."
msgstr ""
"Un segmento di cancello, porta o portone provvisto di un cardine che ne "
"consente la rotazione."
#: doc.lua:27
msgid ""
"If you have more than one hinge in your gate, make sure the hinges line up "
"correctly otherwise the gate will not be able to swing. The hinge is the "
"protruding block along the edge of the gate panel."
msgstr ""
"Se avete più di un cardine nel vostro cancello, porta o portone, accertatevi "
"che siano allineati correttamente altrimenti non potrà ruotare. Il cardine è "
"la protuberanza lungo il bordo del pannello."
#: doc.lua:29
msgid "A block with a slot to allow an adjacent sliding gate through."
msgstr ""
"Un blocco provvisto di una fessura per consentire a una porta scorrevole di "
"scivolarci attraverso."
#: doc.lua:30
msgid ""
"This block is designed to extend into a neighboring node that a sliding gate "
"passes through, to provide a tight seal for the gate to move through without "
"allowing anything else to squeeze in."
msgstr ""
"Questo blocco è progettato per estendersi in un nodo vicino attraverso cui "
"scivoli una porta scorrevole, per fornire una chiusura ermetica alla porta o "
"saracinesca che gli passa attraverso senza permettere a niente altro di "
"intrufolarvisi."
#: doc.lua:32
msgid ""
"A block that extends into an adjacent node to provide a tight seal for a "
"large gate."
msgstr ""
"Un blocco che si estende in un nodo adiacente per fornire una chiusura "
"ermetica per un portone."
#: doc.lua:33
msgid ""
"Two nodes cannot occupy the same space, but this block extends into a "
"neighboring node's space to allow for gates to form a tight seal. It can be "
"used with sliding gates or swinging gates."
msgstr ""
"Due nodi non possono occupare lo stesso spazio, ma questo blocco si estende "
"nello spazio di un nodo vicino per consentire a cancelli, porte, portoni e "
"saracinesche di formare una chiusura ermetica. Può essere usato con porte "
"scorrevoli o a rotazione."
#: doc.lua:37
msgid "Gates"
msgstr "Cancelli, porte, portoni e saracinesche"
#: doc.lua:38
msgid ""
"Gates are large multi-node constructions that swing on hinges or slide out "
"of the way when triggered."
msgstr ""
"Cancelli, porte, portoni e saracinesche sono costruzioni multi-nodo che "
"quando vengono attivate ruotano su dei cardini o scivolano via."
#: doc.lua:43
msgid "Gate construction"
msgstr "Costruzione di cancelli, porte, portoni e saracinesche"
#: doc.lua:45
msgid ""
"Gates are multi-node constructions, usually (though not always) consisting "
"of multiple node types that fit together into a unified whole. The "
"orientation of gate nodes is significant, so a screwdriver will be a helpful "
"tool when constructing gates.\n"
"\n"
"A gate's extent is determined by a \"flood fill\" operation. When you "
"trigger a gate block, all compatible neighboring blocks will be considered "
"part of the same structure and will move in unison. Only gate blocks that "
"are aligned with each other will be considered part of the same gate. If you "
"wish to build adjoining gates (for example, a large pair of double doors "
"that meet in the center) you'll need to make use of gate edge blocks to "
"prevent it all from being considered one big door. Note that if your gate "
"does not abut any other gates you don't actually need to define its edges "
"this way - you don't have to use edge blocks in this case.\n"
"\n"
"If a gate has no hinge nodes it will be considered a sliding gate. When "
"triggered, the gate code will search for a direction that the gate can slide "
"in and will move it in that direction at a rate of one block-length per "
"second. Once it reaches an obstruction it will stop, and when triggered "
"again it will try sliding in the opposite direction.\n"
"\n"
"If a gate has hinge nodes then triggering it will cause the gate to try "
"swinging around the hinge. If the gate has multiple hinges and they don't "
"line up properly the gate will be unable to move. Note that the gate can "
"only exist in 90-degree increments of orientation, but the gate still looks "
"for obstructions in the region it is swinging through and will not swing if "
"there's something in the way."
msgstr ""
"Cancelli, porte, portoni e saracinesche sono costruzioni multi-nodo, di "
"solito (anche se non sempre) costituite da molteplici tipi di nodi che si "
"uniscono in un tutt'uno. L'orientamento è importante, perciò un cacciavite "
"sarà uno strumento utile quando si costruiscono cancelli, porte, ecc.\n"
"\n"
"L'estensione di cancelli e simili è stabilita da un'operazione \"flood fill"
"\" (allagamento riempitivo). Quando attivate un blocco di cancello, tutte le "
"parti limitrofe compatibili verranno considerate parte della stessa "
"struttura e si muoveranno all'unisono. Solamente i blocchi che sono "
"allineati l'un l'altro saranno considerati come parte dello stesso cancello. "
"Se desiderate costruire cancelli confinanti (per esempio, un paio di grossi "
"battenti che si incontrano nel mezzo) dovrete fare uso dei blocchi-estremità "
"per impedire che il tutto sia considerato come un'unica grossa porta. Si "
"noti che se il vostro cancello non confina con nessun altro non avete la "
"necessità di definirne le estremità in questo modo - in questo caso non è "
"necessario che usiate blocchi-estremità.\n"
"\n"
"Se un cancello, ecc. non ha nodi coi cardini sarà considerato come "
"scorrevole. Quando attivato, il programma del cancello cercherà una "
"direzione in cui possa scivolare e lo muoverà in quella direzione al passo "
"della distanza di un nodo al secondo. Quando raggiungerà un ostacolo si "
"fermerà, e quando attivato ancora tenterà di scorrere nella direzione "
"opposta.\n"
"\n"
"Se un cancello, ecc. ha dei nodi coi cardini, attivandolo lo si farà ruotare "
"attorno al cardine. Se il cancello ha più cardini e questi non sono "
"allineati correttamente non riuscirà a muoversi. Si noti che il cancello può "
"svilupparsi solo in incrementi di 90° di orientamento, e controllerà la "
"presenza di ostacoli nella zona in cui ruota e non ruoterà se c'è qualcosa "
"di mezzo."
#: doors.lua:8
msgid "Oak Door"
msgstr "Porta di quercia"
#: doors.lua:22
msgid "Jail Door"
msgstr "Porta della prigione"
#: doors.lua:43
msgid "Jail Bars"
msgstr "Sbarre della prigione"
#: gate_slots.lua:36
msgid "Stonebrick"
msgstr "Mattoni di pietra"
#: gate_slots.lua:45
msgid "@1 Gate Slot"
msgstr "Alloggio di @1 per cancelli, porte, portoni e saracinesche"
#: gate_slots.lua:70
msgid "@1 Gate Slot Reverse"
msgstr ""
"Rovescio dell'alloggio di @1 per cancelli, porte, portoni e saracinesche."
#: gates.lua:7
msgid "Portcullis Bars"
msgstr "Sbarre della saracinesca"
#: gates.lua:37
msgid "Portcullis Bottom"
msgstr "Estremità inferiore della saracinesca"
#: gates.lua:104
msgid "Gate Door"
msgstr "Segmento di cancello, porta o portone"
#: gates.lua:136
msgid "Gate Door Edge"
msgstr "Estremità di cancello, porta o portone"
#: gates.lua:175
msgid "Gate Door With Handle"
msgstr "Cancello, porta o portone con maniglia"
#: gates.lua:218
msgid "Gate Door With Hinge"
msgstr "Cancello, porta o portone con cardine"

View File

@ -1,9 +1,14 @@
## Castle Lighting
=-=-=-=-=-=-=-=-=-=
By: Philipbenr, DanDuncombe, FaceDeer
Castles Mod
by: Philipbenr And DanDuncombe
=-=-=-=-=-=-=-=-=-=
Licence: MIT
see: LICENSE
=-=-=-=-=-=-=-=-=-=
This mod contains medieval lighting sources suitable for a castle. It includes:

View File

@ -1,54 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-01 23:52-0700\n"
"PO-Revision-Date: 2017-04-28 12:40-0400\n"
"Last-Translator: Carlos Barraza\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: Español\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: brasier.lua:7
msgid "A brasier for producing copious amounts of light and heat."
msgstr "Un brasero para producir grandes cantidades de luz y calor."
#: brasier.lua:8
msgid ""
"To ignite the brasier place a flammable fuel in its inventory slot. A lump "
"of coal will burn for about half an hour."
msgstr ""
"Para encender el brasero coloque un combustible inflamable en su ranura de "
"inventario. Un trozo de carbón arderá durante media hora."
#: brasier.lua:107
msgid "Floor Brasier"
msgstr "Brasero con Patas"
#: brasier.lua:156
msgid "Stonebrick"
msgstr "Ladrillo de piedra"
#: brasier.lua:228
msgid "@1 Brasier"
msgstr "Brasero de @1"
#: init.lua:17
msgid "Light Block"
msgstr "Bloque de luz"
#: init.lua:37
msgid "Chandelier"
msgstr "Candelero"
#: init.lua:76
msgid "Chandelier Chain"
msgstr "Colgante de Candelero"

View File

@ -1,55 +0,0 @@
# ITALIAN LOCALE FILE FOR THE CASTLE LIGHTING MODULE
# Copyright (C) 2017 Philipbenr And DanDuncombe
# This file is distributed under the same license as the CASTLE LIGHTING package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Castle Lighting\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-01 23:52-0700\n"
"PO-Revision-Date: 2017-09-10 22:00+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.10\n"
#: brasier.lua:7
msgid "A brasier for producing copious amounts of light and heat."
msgstr "Un braciere per produrre grandi quantità di luce e calore."
#: brasier.lua:8
msgid ""
"To ignite the brasier place a flammable fuel in its inventory slot. A lump "
"of coal will burn for about half an hour."
msgstr ""
"Per accendere il braciere mettete del combustibile nella sua casella di "
"inventario. Un grumo di carbone brucerà per circa mezz'ora."
#: brasier.lua:107
msgid "Floor Brasier"
msgstr "Braciere da pavimento"
#: brasier.lua:156
msgid "Stonebrick"
msgstr "Mattoni di pietra"
#: brasier.lua:228
msgid "@1 Brasier"
msgstr "Braciere di @1"
#: init.lua:17
msgid "Light Block"
msgstr "Lampada"
#: init.lua:37
msgid "Chandelier"
msgstr "Candeliere"
#: init.lua:76
msgid "Chandelier Chain"
msgstr "Catena per candeliere"

View File

@ -1,34 +0,0 @@
## Castle Masonry
by: Philipbenr, DanDuncombe, FaceDeer
Licence: MIT
This is a mod all about creating castles and castle dungeons. Many of the nodes are used for the outer-walls or dungeons.
Contains:
* Walls, Corner-walls,
* Castlestone Stairs, Slabs, and Pillars
* Arrowslits and embrasures
* Rubble (to fill the interior of thick castle walls)
* Murder holes and machicolations
* Pillars and crossbraces
* Roof slate
* Paving stone
* Dungeon stone
Mod settings can allow for the basic castle masonry forms to be made for the following material types (all optional):
* Cobble
* Desert stone
* Desert stone brick
* Sandstone
* Sandstone brick
* Stone
* Stone brick
* Castle wall
* Wood
* Snow
* Ice
* Obsidian Brick

43
castle_masonry/README.txt Normal file
View File

@ -0,0 +1,43 @@
=-=-=-=-=-=-=-=-=-=
Castles Mod
by: Philipbenr And DanDuncombe
=-=-=-=-=-=-=-=-=-=
Licence: MIT
see: LICENSE
=-=-=-=-=-=-=-=-=-=
This is a mod all about creating castles and castle dungeons. Many of the nodes are used for the outer-walls or dungeons.
=-=-=-=-=-=-=-=-=-=
Contains:
--Walls, Corner-walls,
--Castlestone Stairs, Slabs, and Pillars
--Arrowslits and embrasures
--Rubble (to fill the interior of thick castle walls)
--Murder holes and machicolations
--Pillars and crossbraces
--Roof slate
--Paving stone
--Dungeon stone
Mod settings can allow for the basic castle masonry forms to be made for the following material types (all optional):
Cobble
Desert stone
Desert stone brick
Sandstone
Sandstone brick
Stone
Stone brick
Castle wall
Wood
Snow
Ice
Obsidian Brick

View File

@ -163,4 +163,4 @@ castle_masonry.register_arrowslit_alias_force = function(old_mod_name, old_mater
minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name.."_cross", new_mod_name..":arrowslit_"..new_material_name.."_cross")
minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name.."_hole", new_mod_name..":arrowslit_"..new_material_name.."_hole")
minetest.register_alias_force(old_mod_name..":arrowslit_"..old_material_name.."_embrasure", new_mod_name..":arrowslit_"..new_material_name.."_embrasure")
end
end

View File

@ -3,5 +3,4 @@ moreblocks?
stairs?
building_blocks?
asphalt?
streets?
intllib?
streets?

View File

@ -10,7 +10,7 @@ dofile(MP.."/paving.lua")
local S, NS = dofile(MP.."/intllib.lua")
local read_setting = function(name, default)
local setting = minetest.settings:get_bool(name)
local setting = minetest.setting_getbool(name)
if setting == nil then return default end
return setting
end
@ -26,7 +26,7 @@ end
castle_masonry.materials = {}
if read_setting("castle_masonry_stonewall", true) then
table.insert(castle_masonry.materials, {name="stonewall", desc=S("Stonewall"), tile="castle_stonewall.png", craft_material="castle_masonry:stonewall"})
table.insert(castle_masonry.materials, {name="stonewall", desc=S("Stonewall"), tile="castle_stonewall.png", craft_material="castle:stonewall"})
end
if read_setting("castle_masonry_cobble", true) then
table.insert(castle_masonry.materials, {name="cobble", desc=S("Cobble"), tile="default_cobble.png", craft_material="default:cobble"})
@ -72,7 +72,7 @@ castle_masonry.get_material_properties = function(material)
composition_def = minetest.registered_nodes[material.craft_material]
burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.craft_materia)}}).time
end
local tiles = material.tile
if tiles == nil then
tiles = composition_def.tile
@ -84,7 +84,7 @@ castle_masonry.get_material_properties = function(material)
if desc == nil then
desc = composition_def.description
end
return composition_def, burn_time, tiles, desc
end
@ -117,7 +117,7 @@ minetest.register_alias("castle:arrowslit_cross", "castle_masonry:arrowslit_ston
for _, material in pairs(castle_masonry.materials) do
castle_masonry.register_murderhole_alias("castle", material.name, "castle_masonry", material.name)
castle_masonry.register_pillar_alias("castle", material.name, "castle_masonry", material.name)
-- Arrowslit upgrade has special handling because the castle mod arrow slit is reversed relative to current build-from-inside standard
local lbm_def = {
name = "castle_masonry:arrowslit_flip_front_to_back"..material.name,
@ -134,4 +134,4 @@ for _, material in pairs(castle_masonry.materials) do
end
}
minetest.register_lbm(lbm_def)
end
end

View File

@ -1,189 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-21 23:41-0700\n"
"PO-Revision-Date: 2017-04-28 15:23-0400\n"
"Last-Translator: Carlos Barraza\n"
"Language-Team: Español\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: arrow_slits.lua:12
msgid "@1 Arrowslit"
msgstr "Aspillera de @1"
#: arrow_slits.lua:33
msgid "@1 Arrowslit with Cross"
msgstr "Aspillera con Crus de @1"
#: arrow_slits.lua:58
msgid "@1 Arrowslit with Hole"
msgstr "Aspillera con Agujero de @1"
#: arrow_slits.lua:81
msgid "@1 Embrasure"
msgstr "Aféizar de @1 "
#: init.lua:29
msgid "Stonewall"
msgstr "Pared de piedra"
#: init.lua:32
msgid "Cobble"
msgstr "Adoquín"
#: init.lua:35
msgid "Stonebrick"
msgstr "Ladrillo de Piedra"
#: init.lua:38
msgid "Sandstone Brick"
msgstr "Ladrillo de Arenisca"
#: init.lua:41
msgid "Desert Stone Brick"
msgstr "Ladrillo de Piedra del Desierto"
#: init.lua:44
msgid "Stone"
msgstr "Piedra"
#: init.lua:47
msgid "Sandstone"
msgstr "Arenisca"
#: init.lua:50
msgid "Desert Stone"
msgstr "Piedra del Desierto"
#: init.lua:53
msgid "Wood"
msgstr "Madera"
#: init.lua:56
msgid "Ice"
msgstr "Hielo"
#: init.lua:59
msgid "Snow"
msgstr "Nieve"
#: init.lua:62
msgid "Obsidian Brick"
msgstr "Ladrillo de Obsidiana"
#: murder_holes.lua:14
msgid "@1 Murder Hole"
msgstr "Agujero de @1"
#: murder_holes.lua:33
msgid "@1 Machicolation"
msgstr "Matacán de @1"
#: paving.lua:11
msgid "Paving Stone"
msgstr "Piedra Pavimentada"
#: paving.lua:30
msgid "Pavement Brick"
msgstr "Ladrillo Pavimentado"
#: paving.lua:40
msgid "Castle Pavement Stair"
msgstr "Escalera de Castillo Pavimentada"
#: paving.lua:41
msgid "Castle Pavement Slab"
msgstr "Pavimento de Castillo"
#: paving.lua:49
msgid "Roof Slates"
msgstr "Pizarras de Techo"
#: pillars.lua:18
msgid "@1 Pillar Base"
msgstr "Base de Pilar de @1"
#: pillars.lua:36
msgid "@1 Half Pillar Base"
msgstr "Base de Medio Pilar de @1"
#: pillars.lua:54
msgid "@1 Pillar Top"
msgstr "Parte Superior de Pilar de @1"
#: pillars.lua:72
msgid "@1 Half Pillar Top"
msgstr "Parte Superior de Medio Pilar @1"
#: pillars.lua:90
msgid "@1 Pillar Middle"
msgstr "Medio Pilar de @1"
#: pillars.lua:106
msgid "@1 Half Pillar Middle"
msgstr "Medio del Medio Pilar de @1"
#: pillars.lua:123
msgid "@1 Crossbrace"
msgstr "Viga de @1"
#: pillars.lua:147
msgid "@1 Extended Crossbrace"
msgstr "Viga Extendida de @1"
#: stone_wall.lua:11
msgid "Castle Wall"
msgstr "Pared de Castillo"
#: stone_wall.lua:22
msgid "Castle Rubble"
msgstr "Escombros de Castillo"
#: stone_wall.lua:57
msgid "Castle Corner"
msgstr "Esquina de Castillo"
#: stone_wall.lua:78
msgid "Stone Wall"
msgstr "Pared de Piedra"
#: stone_wall.lua:86
msgid "Rubble"
msgstr "Escombros"
#: stone_wall.lua:100
msgid "Castle Stonewall Stair"
msgstr "Escalera de Pared de Castillo"
#: stone_wall.lua:101
msgid "Castle Stonewall Slab"
msgstr "Losa de Pared de Castillo"
#: stone_wall.lua:108
msgid "Castle Rubble Stair"
msgstr "Escalera de Escombro de Castillo"
#: stone_wall.lua:109
msgid "Castle Rubble Slab"
msgstr "Losa de Escombro de Castillo"
#: stone_wall.lua:117 stone_wall.lua:143
msgid "Dungeon Stone"
msgstr "Piedra de Mazmorra"
#: stone_wall.lua:156
msgid "Dungeon Stone Stair"
msgstr "Escalera de Piedra de Mazmorra"
#: stone_wall.lua:157
msgid "Dungeon Stone Slab"
msgstr "Losa de Piedra de Mazmorra"

View File

@ -1,189 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-21 23:41-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: arrow_slits.lua:12
msgid "@1 Arrowslit"
msgstr "Meurtrière en @1"
#: arrow_slits.lua:33
msgid "@1 Arrowslit with Cross"
msgstr "Meurtrière en croix en @1"
#: arrow_slits.lua:58
msgid "@1 Arrowslit with Hole"
msgstr "Meurtrière avec trou en @1"
#: arrow_slits.lua:81
msgid "@1 Embrasure"
msgstr "Embrasure en @1"
#: init.lua:29
msgid "Stonewall"
msgstr "Pierre brune"
#: init.lua:32
msgid "Cobble"
msgstr "Pavé"
#: init.lua:35
msgid "Stonebrick"
msgstr "Brique de pierre"
#: init.lua:38
msgid "Sandstone Brick"
msgstr "Brique de grès"
#: init.lua:41
msgid "Desert Stone Brick"
msgstr "Brique de pierre du désert"
#: init.lua:44
msgid "Stone"
msgstr "Pierre"
#: init.lua:47
msgid "Sandstone"
msgstr "Grès"
#: init.lua:50
msgid "Desert Stone"
msgstr "Pierre du désert"
#: init.lua:53
msgid "Wood"
msgstr "Bois"
#: init.lua:56
msgid "Ice"
msgstr "Glace"
#: init.lua:59
msgid "Snow"
msgstr "Neige"
#: init.lua:62
msgid "Obsidian Brick"
msgstr "Brique d'obsidienne"
#: murder_holes.lua:14
msgid "@1 Murder Hole"
msgstr "Trou en @1"
#: murder_holes.lua:33
msgid "@1 Machicolation"
msgstr "Machicoulis en @1"
#: paving.lua:11
msgid "Paving Stone"
msgstr "Pierre de pavage"
#: paving.lua:30
msgid "Pavement Brick"
msgstr "Brique de pavage"
#: paving.lua:40
msgid "Castle Pavement Stair"
msgstr "Escaliers de chateau pavé"
#: paving.lua:41
msgid "Castle Pavement Slab"
msgstr "Dalle de chateau pavé"
#: paving.lua:49
msgid "Roof Slates"
msgstr "Toiture en ardoise"
#: pillars.lua:18
msgid "@1 Pillar Base"
msgstr "Base de pilier en @1"
#: pillars.lua:36
msgid "@1 Half Pillar Base"
msgstr "Base de demi pilier en @1"
#: pillars.lua:54
msgid "@1 Pillar Top"
msgstr "Haut de pilier en @1"
#: pillars.lua:72
msgid "@1 Half Pillar Top"
msgstr "Haut de demi pilier en @1"
#: pillars.lua:90
msgid "@1 Pillar Middle"
msgstr "Milieu de pilier en @1"
#: pillars.lua:106
msgid "@1 Half Pillar Middle"
msgstr "Milieu de demi pilier en @1"
#: pillars.lua:123
msgid "@1 Crossbrace"
msgstr "Travers en @1"
#: pillars.lua:147
msgid "@1 Extended Crossbrace"
msgstr "Travers entendu en @1"
#: stone_wall.lua:11
msgid "Castle Wall"
msgstr "Pierre brune"
#: stone_wall.lua:22
msgid "Castle Rubble"
msgstr "Gravats de chateau"
#: stone_wall.lua:57
msgid "Castle Corner"
msgstr "Angle de chateau"
#: stone_wall.lua:78
msgid "Stone Wall"
msgstr "Mur de pierre"
#: stone_wall.lua:86
msgid "Rubble"
msgstr "Décombre"
#: stone_wall.lua:100
msgid "Castle Stonewall Stair"
msgstr "Escalier en pierre brune"
#: stone_wall.lua:101
msgid "Castle Stonewall Slab"
msgstr "Dalle en pierre brune"
#: stone_wall.lua:108
msgid "Castle Rubble Stair"
msgstr "Escalier en gravats de chateau"
#: stone_wall.lua:109
msgid "Castle Rubble Slab"
msgstr "Dalle en gravats de chateau"
#: stone_wall.lua:117 stone_wall.lua:143
msgid "Dungeon Stone"
msgstr "Pierre de dongeon"
#: stone_wall.lua:156
msgid "Dungeon Stone Stair"
msgstr "Escalier en pierre de dongeon"
#: stone_wall.lua:157
msgid "Dungeon Stone Slab"
msgstr "Dalle en pierre de dongeon"

View File

@ -1,191 +0,0 @@
# ITALIAN LOCALE FILE FOR THE CASTLE MASONRY MODULE
# Copyright (C) 2017 Philipbenr And DanDuncombe
# This file is distributed under the same license as the CASTLE MASONRY package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Castle Masonry\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-21 23:41-0700\n"
"PO-Revision-Date: 2017-09-10 22:36+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: it\n"
"X-Generator: Poedit 1.6.10\n"
#: arrow_slits.lua:12
msgid "@1 Arrowslit"
msgstr "Feritoia per frecce di @1"
#: arrow_slits.lua:33
msgid "@1 Arrowslit with Cross"
msgstr "Feritoia a croce per frecce di @1"
#: arrow_slits.lua:58
msgid "@1 Arrowslit with Hole"
msgstr "Feritoia a foro per frecce di @1"
#: arrow_slits.lua:81
msgid "@1 Embrasure"
msgstr "Feritoia di @1"
#: init.lua:29
msgid "Stonewall"
msgstr "muro di pietra"
#: init.lua:32
msgid "Cobble"
msgstr "ciottoli"
#: init.lua:35
msgid "Stonebrick"
msgstr "mattoni di pietra"
#: init.lua:38
msgid "Sandstone Brick"
msgstr "mattoni di arenaria del deserto"
#: init.lua:41
msgid "Desert Stone Brick"
msgstr "mattoni di pietra del deserto"
#: init.lua:44
msgid "Stone"
msgstr "pietra"
#: init.lua:47
msgid "Sandstone"
msgstr "arenaria"
#: init.lua:50
msgid "Desert Stone"
msgstr "pietra del deserto"
#: init.lua:53
msgid "Wood"
msgstr "legno"
#: init.lua:56
msgid "Ice"
msgstr "ghiaccio"
#: init.lua:59
msgid "Snow"
msgstr "neve"
#: init.lua:62
msgid "Obsidian Brick"
msgstr "mattoni di ossidiana"
#: murder_holes.lua:14
msgid "@1 Murder Hole"
msgstr "Buca assassina di @1"
#: murder_holes.lua:33
msgid "@1 Machicolation"
msgstr "Caditoia di @1"
#: paving.lua:11
msgid "Paving Stone"
msgstr "Pietra pavimentale"
#: paving.lua:30
msgid "Pavement Brick"
msgstr "Mattoni pavimentali"
#: paving.lua:40
msgid "Castle Pavement Stair"
msgstr "Scala pavimentale del castello"
#: paving.lua:41
msgid "Castle Pavement Slab"
msgstr "Lastra pavimentale del castello"
#: paving.lua:49
msgid "Roof Slates"
msgstr "Tegole di ardesia"
#: pillars.lua:18
msgid "@1 Pillar Base"
msgstr "Base della colonna di @1"
#: pillars.lua:36
msgid "@1 Half Pillar Base"
msgstr "Mezza base della colonna di @1"
#: pillars.lua:54
msgid "@1 Pillar Top"
msgstr "Capitello di @1"
#: pillars.lua:72
msgid "@1 Half Pillar Top"
msgstr "Mezzo capitello di @1"
#: pillars.lua:90
msgid "@1 Pillar Middle"
msgstr "Fusto della colonna di @1"
#: pillars.lua:106
msgid "@1 Half Pillar Middle"
msgstr "Mezzo fusto della colonna di @1"
#: pillars.lua:123
msgid "@1 Crossbrace"
msgstr "Costolone di @1"
#: pillars.lua:147
msgid "@1 Extended Crossbrace"
msgstr "Costolone esteso di @1"
#: stone_wall.lua:11
msgid "Castle Wall"
msgstr "Muro del castello"
#: stone_wall.lua:22
msgid "Castle Rubble"
msgstr "Detriti del castello"
#: stone_wall.lua:57
msgid "Castle Corner"
msgstr "Angolo del castello"
#: stone_wall.lua:78
msgid "Stone Wall"
msgstr "Muro di pietra"
#: stone_wall.lua:86
msgid "Rubble"
msgstr "Detriti"
#: stone_wall.lua:100
msgid "Castle Stonewall Stair"
msgstr "Scala del castello in muro di pietra"
#: stone_wall.lua:101
msgid "Castle Stonewall Slab"
msgstr "Lastra del castello in muro di pietra"
#: stone_wall.lua:108
msgid "Castle Rubble Stair"
msgstr "Scala del castello in detriti"
#: stone_wall.lua:109
msgid "Castle Rubble Slab"
msgstr "Lastra del castello in detriti"
#: stone_wall.lua:117 stone_wall.lua:143
msgid "Dungeon Stone"
msgstr "Pietra del sotterraneo"
#: stone_wall.lua:156
msgid "Dungeon Stone Stair"
msgstr "Scala di pietra del sotterraneo"
#: stone_wall.lua:157
msgid "Dungeon Stone Slab"
msgstr "Lastra di pietra del sotterraneo"

View File

@ -173,11 +173,11 @@ castle_masonry.register_pillar = function(material)
})
minetest.register_craft({
output = mod_name..":pillar_"..material.name.."_middle 2",
output = mod_name..":pillar_"..material.name.."_middle 4",
recipe = {
{material.craft_material},
{material.craft_material},
{material.craft_material} },
{material.craft_material,material.craft_material},
{material.craft_material,material.craft_material},
{material.craft_material,material.craft_material} },
})
minetest.register_craft({

View File

@ -1,23 +0,0 @@
## Castle Shields
by: Philipbenr, DanDuncombe and FaceDeer
Licence: MIT
=-=-=-=-=-=-=-=-=-=
This mod adds decorative wall-mounted shields. It comes with three default shields, but it's very easy to mix and match the colours and patterns to generate additional shields for your server; see default_shields.lua for a good place to insert your own, or make use of the castle_shields.register_shield method in your own mods.
The three default shields were defined thusly:
* castle_shields.register_shield("shield_1", "Mounted Shield", "red", "blue", "slash")
* castle_shields.register_shield("shield_2", "Mounted Shield", "cyan", "yellow", "chevron")
* castle_shields.register_shield("shield_3", "Mounted Shield", "grey", "green", "cross")
The following colors are permitted:
"black", "blue", "brown", "cyan", "dark_green", "dark_grey", "green", "grey", "magenta", "orange", "pink", "red", "violet", "white", "yellow"
The following patterns are permitted:
"slash", "chevron", "cross"

25
castle_shields/README.txt Normal file
View File

@ -0,0 +1,25 @@
=-=-=-=-=-=-=-=-=-=
Castles Mod
by: Philipbenr And DanDuncombe
=-=-=-=-=-=-=-=-=-=
Licence: MIT
see: LICENSE
=-=-=-=-=-=-=-=-=-=
This mod adds decorative wall-mounted shields. It comes with three default shields, but it's very easy to mix and match the colours and patterns to generate additional shields for your server; see default_shields.lua for a good place to insert your own, or make use of the castle_shields.register_shield method in your own mods.
The three default shields were defined thusly:
castle_shields.register_shield("shield_1", "Mounted Shield", "red", "blue", "slash")
castle_shields.register_shield("shield_2", "Mounted Shield", "cyan", "yellow", "chevron")
castle_shields.register_shield("shield_3", "Mounted Shield", "grey", "green", "cross")
The following colors are permitted:
"black", "blue", "brown", "cyan", "dark_green", "dark_grey", "green", "grey", "magenta", "orange", "pink", "red", "violet", "white", "yellow"
The following patterns are permitted:
"slash", "chevron", "cross"

View File

@ -1,23 +0,0 @@
# ITALIAN LOCALE FILE FOR THE CASTLE SHIELDS MODULE
# Copyright (C) 2017 Philipbenr And DanDuncombe
# This file is distributed under the same license as the CASTLE SHIELDS package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Castle Shields\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-25 14:47-0700\n"
"PO-Revision-Date: 2017-09-10 22:38+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: it\n"
"X-Generator: Poedit 1.6.10\n"
#: init.lua:6 init.lua:41 init.lua:75
msgid "Mounted Shield"
msgstr "Scudo appeso"

View File

@ -1,56 +0,0 @@
# ITALIAN LOCALE FILE FOR THE CASTLE STORAGE MODULE
# Copyright (C) 2017 Philipbenr And DanDuncombe
# This file is distributed under the same license as the CASTLE STORAGE package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Castle Storage\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-25 19:18-0700\n"
"PO-Revision-Date: 2017-09-10 22:46+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: it\n"
"X-Generator: Poedit 1.6.10\n"
#: crate.lua:9 crate.lua:24
msgid "Crate"
msgstr "Cassa"
#: crate.lua:34
msgid "@1 moves stuff in crate at @2"
msgstr "@1 mette delle cose nella cassa alle coordinate @2"
#: crate.lua:37
msgid "@1 moves stuff to crate at @2"
msgstr "@1 prende delle cose dalla cassa alle coordinate @2"
#: crate.lua:40 ironbound_chest.lua:113
msgid "@1 takes stuff from locked chest at @2"
msgstr "@1 prende delle cose dal baule chiuso a chiave alle coordinate @2"
#: ironbound_chest.lua:35 ironbound_chest.lua:69
msgid "Ironbound Chest"
msgstr "Baule rinforzato col ferro"
#: ironbound_chest.lua:65
msgid "Ironbound Chest (owned by @1)"
msgstr "Baule rinforzato col ferro (di @1)"
#: ironbound_chest.lua:82 ironbound_chest.lua:91 ironbound_chest.lua:100
msgid "@1 tried to access a locked chest belonging to @2 at @3"
msgstr ""
"@1 ha tentato di aprire un baule chiuso a chiave di @2 alle coordinate @3"
#: ironbound_chest.lua:107
msgid "@1 moves stuff in locked chest at @2"
msgstr "@1 sposta delle cose nel baule chiuso a chiave alle coordinate @2"
#: ironbound_chest.lua:110
msgid "@1 moves stuff to locked chest at @2"
msgstr "@1 mette delle cose nel baule chiuso a chiave alle coordinate @2"

View File

@ -1 +0,0 @@
name = castle_storage

View File

@ -69,27 +69,14 @@ minetest.register_node("castle_tapestries:tapestry", {
paramtype = "light",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
walkable = false,
selection_box = {
type = "wallmounted",
wall_side = {-0.5,-0.5,0.4375,0.5,1.5,0.5},
},
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node,
after_place_node = unifieddyes.fix_rotation_nsew,
on_rotate = unifieddyes.fix_after_screwdriver_nsew
})
-- Crafting from wool and a stick
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry',
recipe = {'wool:white', 'default:stick'},
})
-- Long tapestry
minetest.register_node("castle_tapestries:tapestry_long", {
@ -103,27 +90,14 @@ minetest.register_node("castle_tapestries:tapestry_long", {
paramtype = "light",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
walkable = false,
selection_box = {
type = "wallmounted",
wall_side = {-0.5,-0.5,0.4375,0.5,2.5,0.5},
},
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node,
after_place_node = unifieddyes.fix_rotation_nsew,
on_rotate = unifieddyes.fix_after_screwdriver_nsew
})
-- Crafting from normal tapestry and wool
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry_long',
recipe = {'wool:white', 'castle_tapestries:tapestry'},
})
-- Very long tapestry
minetest.register_node("castle_tapestries:tapestry_very_long", {
@ -137,20 +111,39 @@ minetest.register_node("castle_tapestries:tapestry_very_long", {
paramtype = "light",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
walkable = false,
selection_box = {
type = "wallmounted",
wall_side = {-0.5,-0.5,0.4375,0.5,3.5,0.5},
},
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node,
after_place_node = unifieddyes.fix_rotation_nsew,
on_rotate = unifieddyes.fix_after_screwdriver_nsew
})
-- Crafting from long tapestry and wool
-- Crafting
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry',
recipe = {'wool:white', 'default:stick'},
})
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry',
recipe = {'cottages:wool', 'default:stick'},
})
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry_long',
recipe = {'wool:white', 'castle_tapestries:tapestry'},
})
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry_long',
recipe = {'cottages:wool', 'castle_tapestries:tapestry'},
})
minetest.register_craft({
type = "shapeless",
@ -158,6 +151,46 @@ minetest.register_craft({
recipe = {'wool:white', 'castle_tapestries:tapestry_long'},
})
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry_very_long',
recipe = {'cottages:wool', 'castle_tapestries:tapestry_long'},
})
unifieddyes.register_color_craft({
output = "castle_tapestries:tapestry",
palette = "wallmounted",
type = "shapeless",
neutral_node = "castle_tapestries:tapestry",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE",
}
})
unifieddyes.register_color_craft({
output = "castle_tapestries:tapestry_long",
palette = "wallmounted",
type = "shapeless",
neutral_node = "castle_tapestries:tapestry_long",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE",
}
})
unifieddyes.register_color_craft({
output = "castle_tapestries:tapestry_very_long",
palette = "wallmounted",
type = "shapeless",
neutral_node = "castle_tapestries:tapestry_very_long",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE",
}
})
-- Convert static tapestries to param2 color
local old_static_tapestries = {}

View File

@ -79,22 +79,12 @@ function crossbow:spawn_particles(pos, texture)
texture = CROSSBOW_EXPLOSION_TEXTURE
end
local spread = {x=0.1, y=0.1, z=0.1}
minetest.add_particlespawner({
amount = 15,
time = 0.3,
minpos = vector.subtract(pos, spread),
maxpos = vector.add(pos, spread),
minvel = {x=-1, y=1, z=-1},
maxvel = {x=1, y=2, z=1},
minacc = {x=-2, y=-2, z=-2},
maxacc = {x=2, y=-2, z=2},
minexptime = 0.1,
maxexptime = 0.75,
minsize = 1,
maxsize = 2,
collisiondetection = false,
texture = texture,
})
minetest.add_particlespawner(15, 0.3,
vector.subtract(pos, spread), vector.add(pos, spread),
{x=-1, y=1, z=-1}, {x=1, y=2, z=1},
{x=-2, y=-2, z=-2}, {x=2, y=-2, z=2},
0.1, 0.75, 1, 2, false, texture
)
end
end
@ -371,7 +361,7 @@ minetest.register_entity("castle_weapons:crossbow_bolt_entity", {
groups = {not_in_creative_inventory=1},
on_use = function(itemstack, user, pointed_thing)
minetest.sound_play("castle_crossbow_click", {object=user})
if not minetest.settings:get_bool("creative_mode") then
if not minetest.setting_getbool("creative_mode") then
itemstack:add_wear(65535/CROSSBOW_USES)
end
itemstack = "castle_weapons:crossbow 1 "..itemstack:get_wear()
@ -431,7 +421,7 @@ minetest.register_tool("castle_weapons:crossbow", {
local inv = user:get_inventory()
if inv:contains_item("main", "castle_weapons:crossbow_bolt") then
minetest.sound_play("castle_crossbow_reload", {object=user})
if not minetest.settings:get_bool("creative_mode") then
if not minetest.setting_getbool("creative_mode") then
inv:remove_item("main", "castle_weapons:crossbow_bolt 1")
end
return "castle_weapons:crossbow_loaded 1 "..itemstack:get_wear()

View File

@ -1,31 +0,0 @@
# ITALIAN LOCALE FILE FOR THE CASTLE WEAPONS MODULE
# Copyright (C) 2017 Philipbenr And DanDuncombe
# This file is distributed under the same license as the CASTLE WEAPONS package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Castle Weapons\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-25 19:35-0700\n"
"PO-Revision-Date: 2017-09-10 22:49+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: it\n"
"X-Generator: Poedit 1.6.10\n"
#: battleaxe.lua:8
msgid "Battleaxe"
msgstr "Ascia da guerra"
#: crossbow.lua:244
msgid "Bolt"
msgstr "Quadrello"
#: crossbow.lua:357 crossbow.lua:416
msgid "Crossbow"
msgstr "Balestra"

View File

@ -117,8 +117,9 @@ table.insert(coloredwood.hues_plus_greys, "grey")
local function is_stairsplus(name, colorized)
-- the format of a coloredwood stairsplus node is:
-- moreblocks:class_wood_color_shape
-- where class is "slab", "stair", etc. and shape is "three quarter", "alt", etc.
-- "coloredwood:$CLASS_wood_$COLOR_$SHAPE"
-- where $CLASS is "slab", "stair", etc., $SHAPE is "three quarter", "alt", etc.,
-- and $COLOR is one of the 13 color sets (counting "grey")
local a = string.find(name, ":")
local b = string.find(name, "_")
@ -126,6 +127,7 @@ local function is_stairsplus(name, colorized)
local class = string.sub(name, a+1, b-1) -- from colon to underscore is the class
local shape = ""
local rest
local colorshape
if class == "stair"
or class == "slab"
@ -153,14 +155,10 @@ minetest.register_node("coloredwood:wood_block", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
walkable = true,
sunlight_propagates = false,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:wood"
})
for _, color in ipairs(coloredwood.hues_plus_greys) do
@ -182,74 +180,60 @@ for _, color in ipairs(coloredwood.hues_plus_greys) do
paramtype2 = "colorfacedir",
palette = "unifieddyes_palette_"..color.."s.png",
after_place_node = function(pos, placer, itemstack, pointed_thing)
print("after_place_node on "..minetest.get_node(pos).name)
minetest.rotate_node(itemstack, placer, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1, ud_param2_colorable = 1},
after_dig_node = unifieddyes.after_dig_node
}
)
end
end
-- force replacement node type for stairsplus default wood stair/slab/etc nodes
local coloredwood_cuts = {}
if coloredwood.enable_stairsplus then
-- force settings for stairsplus default wood stair/slab/etc nodes
-- and fix other stuff for colored versions of stairsplus nodes
if coloredwood.enable_stairsplus then
for _, i in pairs(minetest.registered_nodes) do
if string.find(i.name, "moreblocks:stair_wood")
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") then
local a,b = string.find(i.name, "wood_tile")
if not a then
local s1, s2 = is_stairsplus(i.name, false)
minetest.override_item(i.name, {
ud_replacement_node = "coloredwood:"..s1.."_wood_grey"..s2,
paramtype2 = "colorfacedir",
after_place_node = function(pos, placer, itemstack, pointed_thing)
print("overridden after_place_node on "..i.name)
minetest.rotate_node(itemstack, placer, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
on_place = minetest.item_place,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, not_in_creative_inventory=1, ud_param2_colorable = 1},
})
end
end
end
or string.find(i.name, "moreblocks:slope_wood"))
and not string.find(i.name, "wood_tile") then
-- fix drops and other stuff for colored versions of stairsplus nodes
table.insert(coloredwood_cuts, i.name)
for _, i in pairs(minetest.registered_nodes) do
if string.find(i.name, "coloredwood:stair_")
or string.find(i.name, "coloredwood:slab_")
or string.find(i.name, "coloredwood:panel_")
or string.find(i.name, "coloredwood:micro_")
or string.find(i.name, "coloredwood:slope_")
then
mname = string.gsub(i.name, "coloredwood:", "moreblocks:")
local s1, s2 = is_stairsplus(mname, true)
minetest.override_item(i.name, {
after_place_node = function(pos, placer, itemstack, pointed_thing)
print("overridden after_place_node on "..i.name)
minetest.rotate_node(itemstack, placer, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
on_place = minetest.item_place,
drop = "moreblocks:"..s1.."_wood"..s2
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, not_in_creative_inventory=1, ud_param2_colorable = 1},
})
end
end
end
-- "coloredwood:slope_wood_outer_half_raised"
for _, mname in ipairs(coloredwood_cuts) do
local class, shape = is_stairsplus(mname, nil)
unifieddyes.register_color_craft({
output_prefix = "coloredwood:"..class.."_wood_",
output_suffix = shape,
palette = true,
type = "shapeless",
neutral_node = mname,
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
end
minetest.override_item("default:wood", {
palette = "unifieddyes_palette_extended.png",
ud_replacement_node = "coloredwood:wood_block",
after_place_node = unifieddyes.recolor_on_place,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, ud_param2_colorable = 1},
})
@ -260,19 +244,38 @@ default.register_fence("coloredwood:fence", {
palette = "unifieddyes_palette_extended.png",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:fence_wood",
material = "default:wood"
})
minetest.override_item("default:fence_wood", {
palette = "unifieddyes_palette_extended.png",
ud_replacement_node = "coloredwood:fence",
after_place_node = unifieddyes.recolor_on_place,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, ud_param2_colorable = 1}
})
-- Crafts
unifieddyes.register_color_craft({
output = "coloredwood:wood_block",
palette = "extended",
type = "shapeless",
neutral_node = "default:wood",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "coloredwood:fence",
palette = "extended",
type = "shapeless",
neutral_node = "default:fence_wood",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
-- ============================
-- convert the old static nodes

View File

@ -11,7 +11,7 @@ if minetest.get_modpath("hopper") and hopper ~= nil and hopper.add_container ~=
end
local crafting_rate = minetest.settings:get("crafting_bench_crafting_rate")
local crafting_rate = minetest.setting_get("crafting_bench_crafting_rate")
if crafting_rate == nil then crafting_rate = 5 end

View File

@ -151,18 +151,13 @@ if minetest.get_modpath("unifieddyes") then
iclip_def.palette = "unifieddyes_palette_colorwallmounted.png"
iclip_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end
iclip_def.after_dig_node = unifieddyes.after_dig_node
iclip_def.groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
iclipfence_def.paramtype2 = "color"
iclipfence_def.palette = "unifieddyes_palette_extended.png"
iclipfence_def.on_construct = unifieddyes.on_construct
iclipfence_def.after_place_node = unifieddyes.recolor_on_place
iclipfence_def.after_dig_node = unifieddyes.after_dig_node
iclipfence_def.groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}
iclipfence_def.place_param2 = 171 -- medium amber, low saturation, closest color to default:wood
end
minetest.register_node(":technic:insulator_clip", iclip_def)
@ -185,3 +180,29 @@ minetest.register_craft({
{ "technic:raw_latex", "default:fence_wood", "technic:raw_latex"},
}
})
if minetest.get_modpath("unifieddyes") then
unifieddyes.register_color_craft({
output = "technic:insulator_clip_fencepost",
palette = "extended",
type = "shapeless",
neutral_node = "technic:insulator_clip_fencepost",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "technic:insulator_clip",
palette = "wallmounted",
type = "shapeless",
neutral_node = "technic:insulator_clip",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
end

View File

@ -175,14 +175,25 @@ if not minetest.get_modpath("usesdirt") then
description = "Dirt Brick",
groups = {snappy=2,choppy=1,oddly_breakable_by_hand=2},
})
minetest.register_craft({
output = '"usesdirt:dirt_brick" 6',
recipe = {
{'default:dirt', 'default:dirt', 'default:dirt'},
{'default:dirt', 'default:dirt', 'default:dirt'},
{'default:dirt', 'default:dirt', 'default:dirt'},
}
})
if minetest.get_modpath("moreblocks") then
minetest.register_craft({
output = 'usesdirt:dirt_brick 24',
recipe = {
{'moreblocks:dirt_compressed', 'moreblocks:dirt_compressed', '' },
{'moreblocks:dirt_compressed', 'moreblocks:dirt_compressed', '' }
}
})
else
minetest.register_craft({
output = 'usesdirt:dirt_brick 6',
recipe = {
{'default:dirt', 'default:dirt', 'default:dirt'},
{'default:dirt', 'default:dirt', 'default:dirt'},
{'default:dirt', 'default:dirt', 'default:dirt'},
}
})
end
minetest.register_node(":usesdirt:dirt_ladder", {
description = "Ladder",

View File

@ -12,12 +12,9 @@ minetest.register_node("homedecor:bathroom_tiles_dark", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("homedecor:bathroom_tiles_medium", {
@ -31,12 +28,9 @@ minetest.register_node("homedecor:bathroom_tiles_medium", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("homedecor:bathroom_tiles_light", {
@ -50,12 +44,9 @@ minetest.register_node("homedecor:bathroom_tiles_light", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
})
local tr_cbox = {

View File

@ -52,13 +52,11 @@ homedecor.register("bed_regular", {
on_rotate = screwdriver.disallow,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
if not placer:get_player_control().sneak then
return homedecor.bed_expansion(pos, placer, itemstack, pointed_thing)
end
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger)
homedecor.unextend_bed(pos)
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
@ -91,9 +89,7 @@ homedecor.register("bed_extended", {
sounds = default.node_sound_wood_defaults(),
expand = { forward = "air" },
on_rotate = screwdriver.disallow,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger)
homedecor.unextend_bed(pos)
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
@ -124,10 +120,8 @@ homedecor.register("bed_kingsize", {
on_rotate = screwdriver.disallow,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger)
local inv = digger:get_inventory()
if digger:get_player_control().sneak and inv:room_for_item("main", "homedecor:bed_regular 2") then
inv:remove_item("main", "homedecor:bed_kingsize 1")
@ -137,7 +131,7 @@ homedecor.register("bed_kingsize", {
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
homedecor.beds_on_rightclick(pos, node, clicker)
return itemstack
end
end,
})
for _, w in pairs({ N_("mahogany"), N_("oak") }) do

View File

@ -546,6 +546,17 @@ minetest.register_craft( {
},
})
unifieddyes.register_color_craft({
output = "homedecor:shutter_colored",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:shutter",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:shutter_oak",
@ -867,6 +878,28 @@ minetest.register_craft( {
},
})
unifieddyes.register_color_craft({
output = "homedecor:curtain_closed",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:curtain_closed",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "homedecor:curtain_open",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:curtain_open",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
local mats = {
{ "brass", "homedecor:pole_brass" },
{ "wrought_iron", "homedecor:pole_wrought_iron" },
@ -1195,7 +1228,6 @@ minetest.register_craft( {
minetest.register_craft({
output = "homedecor:glowlight_half 6",
recipe = {
{ "dye:white", "dye:white", "dye:white" },
{ "default:glass", "homedecor:power_crystal", "default:glass", },
}
})
@ -1203,11 +1235,38 @@ minetest.register_craft({
minetest.register_craft({
output = "homedecor:glowlight_half 6",
recipe = {
{ "dye:white", "dye:white", "dye:white" },
{"moreblocks:super_glow_glass", "moreblocks:glow_glass", "moreblocks:super_glow_glass", },
}
})
minetest.register_craft({
output = "homedecor:glowlight_half",
recipe = {
{"homedecor:glowlight_small_cube","homedecor:glowlight_small_cube"},
{"homedecor:glowlight_small_cube","homedecor:glowlight_small_cube"}
}
})
minetest.register_craft({
output = "homedecor:glowlight_half",
type = "shapeless",
recipe = {
"homedecor:glowlight_quarter",
"homedecor:glowlight_quarter"
}
})
unifieddyes.register_color_craft({
output = "homedecor:glowlight_half",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:glowlight_half",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
output = "homedecor:glowlight_quarter 6",
recipe = {
@ -1215,6 +1274,17 @@ minetest.register_craft({
}
})
unifieddyes.register_color_craft({
output = "homedecor:glowlight_quarter",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:glowlight_quarter",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
output = "homedecor:glowlight_small_cube 8",
recipe = {
@ -1239,20 +1309,14 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "homedecor:glowlight_half",
recipe = {
{"homedecor:glowlight_small_cube","homedecor:glowlight_small_cube"},
{"homedecor:glowlight_small_cube","homedecor:glowlight_small_cube"}
}
})
minetest.register_craft({
output = "homedecor:glowlight_half",
type = "shapeless",
recipe = {
"homedecor:glowlight_quarter",
"homedecor:glowlight_quarter"
unifieddyes.register_color_craft({
output = "homedecor:glowlight_small_cube",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:glowlight_small_cube",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
@ -2227,6 +2291,17 @@ minetest.register_craft( {
},
})
unifieddyes.register_color_craft({
output = "homedecor:bathroom_tiles_light",
palette = "extended",
type = "shapeless",
neutral_node = "homedecor:bathroom_tiles_light",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft( {
output = "homedecor:bathroom_tiles_medium 4",
recipe = {
@ -2235,6 +2310,17 @@ minetest.register_craft( {
},
})
unifieddyes.register_color_craft({
output = "homedecor:bathroom_tiles_medium",
palette = "extended",
type = "shapeless",
neutral_node = "homedecor:bathroom_tiles_medium",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft( {
output = "homedecor:bathroom_tiles_dark 4",
recipe = {
@ -2243,6 +2329,17 @@ minetest.register_craft( {
},
})
unifieddyes.register_color_craft({
output = "homedecor:bathroom_tiles_dark",
palette = "extended",
type = "shapeless",
neutral_node = "homedecor:bathroom_tiles_dark",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
-- misc electrical
minetest.register_craft( {
@ -2476,6 +2573,17 @@ minetest.register_craft( {
},
})
unifieddyes.register_color_craft({
output = "homedecor:bed_regular",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:bed_regular",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft( {
output = "homedecor:bed_kingsize",
recipe = {
@ -2483,6 +2591,29 @@ minetest.register_craft( {
},
})
unifieddyes.register_color_craft({
output = "homedecor:bed_kingsize",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:bed_kingsize",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "homedecor:bed_kingsize",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:bed_regular",
recipe = {
"NEUTRAL_NODE",
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft( {
output = "homedecor:bottle_green",
recipe = {
@ -2843,6 +2974,17 @@ minetest.register_craft({
},
})
unifieddyes.register_color_craft({
output = "homedecor:desk_lamp",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:desk_lamp",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
output = "homedecor:hanging_lantern 2",
recipe = {

View File

@ -83,9 +83,7 @@ homedecor.register("kitchen_chair_padded", {
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node,
on_rotate = unifieddyes.fix_after_screwdriver_nsew,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
pos.y = pos.y+0 -- where do I put my ass ?
@ -110,9 +108,7 @@ homedecor.register("armchair", {
node_box = ac_cbox,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node,
on_rotate = unifieddyes.fix_after_screwdriver_nsew,
})

View File

@ -70,6 +70,17 @@ minetest.register_craft({
},
})
unifieddyes.register_color_craft({
output = "homedecor:armchair",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:armchair",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:kitchen_chair_padded",
@ -79,6 +90,17 @@ minetest.register_craft({
},
})
unifieddyes.register_color_craft({
output = "homedecor:kitchen_chair_padded",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:kitchen_chair_padded",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:kitchen_chair_wood",
@ -106,6 +128,17 @@ minetest.register_craft({
},
})
unifieddyes.register_color_craft({
output = "homedecor:standing_lamp_off",
palette = "extended",
type = "shapeless",
neutral_node = "homedecor:standing_lamp_off",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table_lamp_off",
@ -148,13 +181,15 @@ minetest.register_craft({
},
})
minetest.register_craft({
output = "homedecor:standing_lamp_off",
unifieddyes.register_color_craft({
output = "homedecor:table_lamp_off",
palette = "extended",
type = "shapeless",
neutral_node = "homedecor:table_lamp_off",
recipe = {
{ "homedecor:table_lamp_off"},
{ "group:stick"},
{ "group:stick"},
},
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({

View File

@ -211,22 +211,21 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, trybunks
local rightnode = minetest.get_node(rightpos)
local inv = placer:get_inventory()
local lastdye = unifieddyes.last_used_dye[placer_name]
if leftnode.name == "homedecor:bed_regular" then
local newname = string.gsub(thisnode.name, "_regular", "_kingsize")
local meta = minetest.get_meta(leftpos)
local meta = minetest.get_meta(pos)
local leftmeta = minetest.get_meta(leftpos)
minetest.set_node(pos, {name = "air"})
minetest.set_node(leftpos, { name = newname, param2 = param2})
meta:set_string("dye", lastdye)
inv:add_item("main", lastdye)
minetest.swap_node(leftpos, { name = newname, param2 = param2})
elseif rightnode.name == "homedecor:bed_regular" then
local newname = string.gsub(thisnode.name, "_regular", "_kingsize")
local meta = minetest.get_meta(rightpos)
local meta = minetest.get_meta(pos)
local rightmeta = minetest.get_meta(rightpos)
minetest.set_node(rightpos, {name = "air"})
minetest.set_node(pos, { name = newname, param2 = param2})
meta:set_string("dye", lastdye)
inv:add_item("main", lastdye)
minetest.swap_node(pos, { name = newname, param2 = param2})
end
local toppos = {x=pos.x, y=pos.y+1.0, z=pos.z}
@ -235,14 +234,7 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, trybunks
if trybunks and is_buildable_to(placer_name, toppos, topposfwd) then
local newname = string.gsub(thisnode.name, "_regular", "_extended")
local newparam2 = param2 % 8
if inv:contains_item("main", lastdye) then
minetest.set_node(toppos, { name = thisnode.name, param2 = param2})
if lastdye then inv:remove_item("main", lastdye.." 1") end
else
minetest.set_node(toppos, { name = thisnode.name, param2 = newparam2})
minetest.chat_send_player(placer_name, "Ran out of "..lastdye..", using neutral color.")
unifieddyes.last_used_dye[placer_name] = nil
end
minetest.swap_node(toppos, { name = thisnode.name, param2 = param2})
minetest.swap_node(pos, { name = newname, param2 = param2})
itemstack:take_item()
end

View File

@ -46,9 +46,7 @@ minetest.register_node("homedecor:glowlight_half", {
sounds = default.node_sound_glass_defaults(),
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("homedecor:glowlight_quarter", {
@ -86,9 +84,7 @@ minetest.register_node("homedecor:glowlight_quarter", {
sounds = default.node_sound_glass_defaults(),
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_node("homedecor:glowlight_small_cube", {
@ -126,9 +122,7 @@ minetest.register_node("homedecor:glowlight_small_cube", {
sounds = default.node_sound_glass_defaults(),
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node
})
homedecor.register("plasma_lamp", {
@ -449,7 +443,6 @@ local function reg_lamp(suffix, nxt, light, brightness)
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
walkable = false,
light_source = light,
selection_box = tlamp_cbox,
@ -457,14 +450,17 @@ local function reg_lamp(suffix, nxt, light, brightness)
groups = {cracky=2,oddly_breakable_by_hand=1, ud_param2_colorable = 1,
not_in_creative_inventory=((light ~= nil) and 1) or nil,
},
drop = "homedecor:table_lamp_off",
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
node.name = "homedecor:table_lamp_"..repl[suffix]
minetest.set_node(pos, node)
end,
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node
drop = {
items = {
{items = {"homedecor:table_lamp_off"}, inherit_color = true },
}
}
})
homedecor.register("standing_lamp_"..suffix, {
@ -480,7 +476,6 @@ local function reg_lamp(suffix, nxt, light, brightness)
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
walkable = false,
light_source = light,
groups = {cracky=2,oddly_breakable_by_hand=1, ud_param2_colorable = 1,
@ -494,9 +489,12 @@ local function reg_lamp(suffix, nxt, light, brightness)
minetest.set_node(pos, node)
end,
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
expand = { top="air" },
--expand = { top="air" },
drop = {
items = {
{items = {"homedecor:standing_lamp_off"}, inherit_color = true },
}
}
})
-- for old maps that had the original 3dforniture mod
@ -535,9 +533,7 @@ homedecor.register("desk_lamp", {
groups = {snappy=3, ud_param2_colorable = 1},
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node,
on_rotate = unifieddyes.fix_after_screwdriver_nsew
})

View File

@ -41,9 +41,7 @@ homedecor.register("shutter", {
node_box = shutter_cbox,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node
})
homedecor.register("shutter_colored", {
@ -60,10 +58,7 @@ homedecor.register("shutter_colored", {
node_box = shutter_cbox,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node,
drop = "homedecor:shutter"
})
minetest.register_alias("homedecor:shutter_purple", "homedecor:shutter_violet")

View File

@ -112,10 +112,8 @@ minetest.register_node("homedecor:curtain_closed", {
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
selection_box = { type = "wallmounted" },
after_dig_node = unifieddyes.after_dig_node,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
@ -141,10 +139,8 @@ minetest.register_node("homedecor:curtain_open", {
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
selection_box = { type = "wallmounted" },
after_dig_node = unifieddyes.after_dig_node,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})

View File

@ -56,9 +56,7 @@ minetest.register_node("ilights:light", {
node_box = lamp_cbox,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node
})
minetest.register_craft({
@ -70,6 +68,28 @@ minetest.register_craft({
},
})
unifieddyes.register_color_craft({
output = "ilights:light 3",
palette = "wallmounted",
neutral_node = "",
recipe = {
{ "", "default:steel_ingot", "" },
{ "", "default:glass", "MAIN_DYE" },
{ "default:steel_ingot", "default:torch", "default:steel_ingot" }
}
})
unifieddyes.register_color_craft({
output = "ilights:light",
palette = "wallmounted",
type = "shapeless",
neutral_node = "ilights:light",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE",
}
})
-- convert old static nodes to param2 coloring
ilights.colors = {

View File

@ -28,7 +28,6 @@ minetest.register_node("lavalamp:lavalamp", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
sunlight_propagates = true,
walkable = false,
light_source = 14,
@ -39,8 +38,6 @@ minetest.register_node("lavalamp:lavalamp", {
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1},
sounds = default.node_sound_glass_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
node.name = "lavalamp:lavalamp_off"
minetest.swap_node(pos, node)
@ -59,7 +56,6 @@ minetest.register_node("lavalamp:lavalamp_off", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
sunlight_propagates = true,
walkable = false,
selection_box = {
@ -70,13 +66,16 @@ minetest.register_node("lavalamp:lavalamp_off", {
sounds = default.node_sound_glass_defaults(),
drop = "lavalamp:lavalamp",
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
node.name = "lavalamp:lavalamp"
minetest.swap_node(pos, node)
return itemstack
end,
drop = {
items = {
{items = {"lavalamp:lavalamp"}, inherit_color = true },
}
}
})
minetest.register_craft({
@ -88,6 +87,17 @@ minetest.register_craft({
}
})
unifieddyes.register_color_craft({
output = "lavalamp:lavalamp",
palette = "extended",
type = "shapeless",
neutral_node = "lavalamp:lavalamp",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
-- convert to param2 coloring
local colors = {

View File

@ -24,7 +24,7 @@ If the program finds something other than a panel, it wraps to the next line. If
Lines of panels don't need to be all the same length, the program will wrap as needed, with the left margin always being aligned with the panel the LuaController is connected to.
Strings are trimmed to 1 kB.
Strings are trimmed to 6 kB.
Panels are not erased between prints.
@ -43,13 +43,13 @@ If a string is prefixed with character code 255, it is treated as UTF-8 and pass
The panels also respond to these control messages:
* "clear" turns all panels in a lineup or wall off - essentially a "clear screen" command.
* "allon" fills all panels in a lineup/wall with char(144), i.e. the reverse of "clear".
* "clear" turns all panels in a lineup or wall off, or up to 2048 of them, anyway - essentially a "clear screen" command.
* "allon" fills all panels in a lineup/wall, up to a max of 2048 of them, with char(144), i.e. the reverse of "clear".
* "start_scroll" starts the automatic scrolling function, repeatedly moving the last displayed message to the left one character space each time the scroll timer runs out (and automatically restarting it, natch). The scroll action will spread across the line, and down a multi-line wall (just set a new, different channel on the first row you want to exclude), and will continue until "stop_scroll" or any displayable message is received.
As it advances through the message, the scroll code will search through the message for a printable character, on each scroll step, basically stripping-out color code, and using just the last one before the new start position. This is done in order to keep a constant visible speed (the text will still be colored properly though).
* "stop_scroll" does just what it says - it stops the auto-scroll timer.
* "scroll_speed" followed by a decimal number (in the string, not a byte value) sets the time between scroll steps. Minimum 0.5s, maximum 5s.
* "scroll_speed" followed by a decimal number (in the string, not a byte value) sets the time between scroll steps. Minimum 0.2s, maximum 5s.
* "scroll_step" will immediately advance the last-displayed message by one character. Omit the above automatic scrolling keywords, and use ONLY this keyword instead if you want to let your LuaController control the scrolling speed. Optionally, you can follow this with a number and the scroll code will skip forward that many bytes into the message, starting from the current position, before starting the above-mentioned color-vs-character search. Essentially, this value will roughly translate to the number of printable characters to skip.
* "get" will read the one character (as a numerical character value) currently displayed by the master panel (by reading its node name)
* "getstr" will read the last-stored message for the entire lineup/wall (from the master panel's meta). Note that even if the message has been or is being scrolled, you'll get the original stored message.
@ -59,7 +59,7 @@ During a scroll event, the printed string is padded with spaces (one in auto mod
If you need vertical scrolling, you will have to handle that yourself (since the size of a screen/wall is not hard-coded).
A byte value of 0 to 27 in a string will change colors (i.e. string.char(0 to 27) ).
To change colors, put a "/" followed by a digit or a letter from "A" to "R" (or "a" to "r") into your printed string. Digits 0 to 9 trigger colors 0 to 9 (obviously :-) ), while A/a through R/r set colors 10 to 27. Any other sequence is invalid and will just be printed literally. Two slashes "//" will translated to a single char(30) internally, and displayed as a single slash (doing it that way makes the code easier).
Color values 0 to 11 are:
@ -71,9 +71,9 @@ Colors 24 - 27 are white, light grey, medium grey, and dim grey (or think of the
The last color that was used is stored in the left-most/upper-left "master" panel's metadata, and defaults to red. It should persist across reboots.
A byte value of 28 in a string will act as a line feed (I would have used 10, but that's a color code :-P )
char(10) will do its job as linefeed/newline.
A byte value of 29 in a string signals a cursor position command. The next two byte values select a column and row, respectively. The next character after the row byte will be printed there, and the rest of the string then continues printing from that spot onward with normal line wrapping, colors and so forth. Note that any string that does NOT contain cursor positioning commands will automatically start printing at the upper-left.
char(29) signals a cursor position command. The next two byte values select a column and row, respectively. The next character after the row byte will be printed there, and the rest of the string then continues printing from that spot onward with normal line wrapping, colors and so forth. Note that any string that does NOT contain cursor positioning commands will automatically start printing at the upper-left.
Any number of color, line feed, and cursor position commands may be present in a string, making it possible to "frame-buffer" a screen full of text into a string before printing it.

View File

@ -10,6 +10,89 @@ else
S = function(s) return s end
end
local color_to_char = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R"
}
local char_to_color = {
["0"] = 0,
["1"] = 1,
["2"] = 2,
["3"] = 3,
["4"] = 4,
["5"] = 5,
["6"] = 6,
["7"] = 7,
["8"] = 8,
["9"] = 9,
["A"] = 10,
["B"] = 11,
["C"] = 12,
["D"] = 13,
["E"] = 14,
["F"] = 15,
["G"] = 16,
["H"] = 17,
["I"] = 18,
["J"] = 19,
["K"] = 20,
["L"] = 21,
["M"] = 22,
["N"] = 23,
["O"] = 24,
["P"] = 25,
["Q"] = 26,
["R"] = 27,
["a"] = 10,
["b"] = 11,
["c"] = 12,
["d"] = 13,
["e"] = 14,
["f"] = 15,
["g"] = 16,
["h"] = 17,
["i"] = 18,
["j"] = 19,
["k"] = 20,
["l"] = 21,
["m"] = 22,
["n"] = 23,
["o"] = 24,
["p"] = 25,
["q"] = 26,
["r"] = 27
}
-- the following functions based on the so-named ones in Jeija's digilines mod
local reset_meta = function(pos)
@ -60,43 +143,51 @@ end
led_marquee.set_timer = function(pos, timeout)
local timer = minetest.get_node_timer(pos)
timer:stop()
if not timeout or timeout < 0.2 or timeout > 5 then return false end
if timeout > 0 then
local meta = minetest.get_meta(pos)
meta:set_int("timeout", timeout)
timer:start(timeout)
end
end
led_marquee.scroll_text = function(pos, elapsed, skip)
skip = skip or 1
local meta = minetest.get_meta(pos)
local msg = meta:get_string("last_msg")
local channel = meta:get_string("channel")
local index = meta:get_int("index")
if not index or index < 1 or not string.byte(msg, index) then index = 1 end
local color = meta:get_int("last_color")
local colorchar = color_to_char[color+1]
if not index or index < 1 then index = 1 end
local len = string.len(msg)
skip = skip or 1
index = index + skip
if index > len then index = 1 end
while index < len and string.byte(msg, index) < 28 do
index = index + 1
if index > len then index = 1 break end
-- search backward to find the most recent color code in the string
local r = index
while r > 0 and not string.match(string.sub(msg, r, r+1), "/[0-9A-Ra-r]") do
r = r - 1
end
if r == 0 then r = 1 end
if string.match(string.sub(msg, r, r+1), "/[0-9A-Ra-r]") then
colorchar = string.sub(msg, r+1, r+1)
end
if string.byte(msg, index - 1) < 28 then
led_marquee.display_msg(pos, channel, string.sub(msg, index - 1)..string.rep(" ", skip + 1))
else
local i = index - 1
local color = ""
while i > 0 and string.byte(msg, i) > 27 do
i = i - 1
if i == 0 then break end
-- search forward to find the next printable symbol after the current index
local f = index
while f < len do
if string.match(string.sub(msg, f-1, f), "/[0-9A-Ra-r]") then
f = f + 2
else
break
end
if i > 0 then color = string.sub(msg, i, i) end
led_marquee.display_msg(pos, channel, color..string.sub(msg, index)..string.rep(" ", skip + 1))
end
led_marquee.display_msg(pos, channel, "/"..colorchar..string.sub(msg, f)..string.rep(" ", skip + 1))
meta:set_int("index", index)
if not elapsed or elapsed < 0.5 then return false end
meta:set_int("index", f)
if not elapsed or elapsed < 0.2 then return false end
return true
end
@ -118,10 +209,14 @@ local cbox = {
wall_side = { -8/16, -8/16, -8/16, -7/16, 8/16, 8/16 }
}
led_marquee.decode_color = function(msg)
end
led_marquee.display_msg = function(pos, channel, msg)
msg = string.sub(msg, 1, 4096)
msg = string.sub(msg, 1, 6144).." "
if string.sub(msg,1,1) == string.char(255) then -- treat it as incoming UTF-8
msg = make_iso(string.sub(msg, 2, 4096))
msg = make_iso(string.sub(msg, 2, 6144))
end
local master_fdir = minetest.get_node(pos).param2 % 8
@ -154,7 +249,7 @@ led_marquee.display_msg = function(pos, channel, msg)
elseif string.match(node.name, "led_marquee:char_")
and fdir ~= master_fdir or (setchan ~= nil and setchan ~= "" and setchan ~= channel) then
break
elseif asc == 28 then
elseif asc == 10 then
pos2.x = pos.x
pos2.y = pos2.y-1
pos2.z = pos.z
@ -168,17 +263,34 @@ led_marquee.display_msg = function(pos, channel, msg)
pos2.z = pos.z + (fdir_to_right[fdir+1][2])*c
i = i + 3
wrapped = nil
elseif asc == 30 then -- translate to slash for printing
minetest.swap_node(pos2, { name = "led_marquee:char_47", param2 = master_fdir + (last_color*8)})
pos2.x = pos2.x + fdir_to_right[fdir+1][1]
pos2.z = pos2.z + fdir_to_right[fdir+1][2]
i = i + 1
elseif asc == 47 then -- slash
local ccode = string.sub(msg, i+1, i+1)
if ccode then
if char_to_color[ccode] then
last_color = char_to_color[ccode]
i = i + 2
else
minetest.swap_node(pos2, { name = "led_marquee:char_47", param2 = master_fdir + (last_color*8)})
pos2.x = pos2.x + fdir_to_right[fdir+1][1]
pos2.z = pos2.z + fdir_to_right[fdir+1][2]
i = i + 1
end
end
master_meta:set_int("last_color", last_color)
wrapped = nil
elseif asc > 30 and asc < 256 then
minetest.swap_node(pos2, { name = "led_marquee:char_"..asc, param2 = master_fdir + (last_color*8)})
pos2.x = pos2.x + fdir_to_right[fdir+1][1]
pos2.z = pos2.z + fdir_to_right[fdir+1][2]
i = i + 1
wrapped = nil
elseif asc < 28 then
last_color = asc
master_meta:set_int("last_color", asc)
else
i = i + 1
wrapped = nil
end
end
end
@ -210,15 +322,12 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
meta:set_int("index", 1)
elseif msg == "start_scroll" then
local timeout = meta:get_int("timeout")
if not timeout or timeout < 0.5 or timeout > 5 then timeout = 0 end
led_marquee.set_timer(pos, timeout)
elseif msg == "stop_scroll" then
led_marquee.set_timer(pos, 0)
return
elseif string.sub(msg, 1, 12) == "scroll_speed" then
local timeout = tonumber(string.sub(msg, 13))
if not timeout or timeout < 0.5 or timeout > 5 then timeout = 0 end
meta:set_int("timeout", timeout)
led_marquee.set_timer(pos, timeout)
elseif string.sub(msg, 1, 11) == "scroll_step" then
local skip = tonumber(string.sub(msg, 12))
@ -230,20 +339,21 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
elseif msg == "getindex" then -- get the scroll index
digilines.receptor_send(pos, digiline.rules.default, channel, meta:get_int("index"))
else
msg = string.gsub(msg, "//", string.char(30))
led_marquee.set_timer(pos, 0)
local last_msg = meta:get_string("last_msg")
meta:set_string("last_msg", msg)
led_marquee.display_msg(pos, channel, msg)
meta:set_int("index", 1)
if last_msg ~= msg then
meta:set_int("index", 1)
end
end
else
local asc = string.byte(msg)
if asc > 30 and asc < 256 then
if asc > 29 and asc < 256 then
minetest.swap_node(pos, { name = "led_marquee:char_"..asc, param2 = fdir + (last_color*8)})
meta:set_string("last_msg", tostring(msg))
meta:set_int("index", 1)
elseif asc < 28 then
last_color = asc
meta:set_int("last_color", asc)
end
end
elseif msg and type(msg) == "number" then
@ -258,7 +368,7 @@ end
for i = 31, 255 do
local groups = { cracky = 2, not_in_creative_inventory = 1}
local light = LIGHT_MAX-2
local description = S("Alphanumeric LED marquee panel ("..i..")")
local description = S("LED marquee panel ("..i..")")
local tiles = {
{ name="led_marquee_base.png", color="white"},
{ name="led_marquee_leds_off.png", color="white"},
@ -279,7 +389,8 @@ for i = 31, 255 do
if i == 32 then
groups = {cracky = 2}
light = nil
description = S("Alphanumeric LED marquee panel")
description = S("LED marquee panel")
wimage = "led_marquee_leds_off.png^(led_marquee_char_155.png^[multiply:red)"
end
minetest.register_node("led_marquee:char_"..i, {
@ -287,6 +398,8 @@ for i = 31, 255 do
drawtype = "mesh",
mesh = "led_marquee.obj",
tiles = tiles,
inventory_image = wimage,
wield_image = wimage,
palette="led_marquee_palette.png",
use_texture_alpha = true,
groups = groups,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 B

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 B

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 B

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 B

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 377 B

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 B

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

After

Width:  |  Height:  |  Size: 261 B

View File

@ -25,9 +25,7 @@ minetest.register_node("lrfurn:armchair", {
node_box = armchair_cbox,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node,
on_rotate = unifieddyes.fix_after_screwdriver_nsew,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not clicker:is_player() then
@ -58,6 +56,17 @@ minetest.register_craft({
}
})
unifieddyes.register_color_craft({
output = "lrfurn:armchair",
palette = "wallmounted",
type = "shapeless",
neutral_node = "lrfurn:armchair",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
-- convert old static nodes to param2 color
lrfurn.old_static_armchairs = {}

View File

@ -60,10 +60,11 @@ end
function lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing)
local node = minetest.get_node(pos)
local colorbits = node.param2 - (node.param2 % 8)
local yaw = placer:get_look_yaw()
local dir = minetest.yaw_to_dir(yaw-1.5)
local fdir = minetest.dir_to_wallmounted(dir)
minetest.swap_node(pos, { name = node.name, param2 = fdir })
minetest.swap_node(pos, { name = node.name, param2 = fdir+colorbits })
end
dofile(minetest.get_modpath("lrfurn").."/longsofas.lua")

View File

@ -26,7 +26,6 @@ minetest.register_node("lrfurn:longsofa", {
on_rotate = screwdriver.disallow,
after_place_node = function(pos, placer, itemstack, pointed_thing)
lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
local playername = placer:get_player_name()
if minetest.is_protected(pos, placer:get_player_name()) then return true end
@ -42,7 +41,6 @@ minetest.register_node("lrfurn:longsofa", {
end
return itemstack
end,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not clicker:is_player() then
return itemstack
@ -72,6 +70,17 @@ minetest.register_craft({
}
})
unifieddyes.register_color_craft({
output = "lrfurn:longsofa",
palette = "wallmounted",
type = "shapeless",
neutral_node = "lrfurn:longsofa",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
-- convert old static nodes to param2 colorization
lrfurn.old_static_longsofas = {}

View File

@ -26,7 +26,6 @@ minetest.register_node("lrfurn:sofa", {
on_rotate = screwdriver.disallow,
after_place_node = function(pos, placer, itemstack, pointed_thing)
lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
local playername = placer:get_player_name()
if minetest.is_protected(pos, placer:get_player_name()) then return true end
@ -42,7 +41,6 @@ minetest.register_node("lrfurn:sofa", {
end
return itemstack
end,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not clicker:is_player() then
return itemstack
@ -72,6 +70,17 @@ minetest.register_craft({
}
})
unifieddyes.register_color_craft({
output = "lrfurn:sofa",
palette = "wallmounted",
type = "shapeless",
neutral_node = "lrfurn:sofa",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
-- convert old static nodes to param2 color
lrfurn.old_static_sofas = {}

View File

@ -6,10 +6,7 @@ minetest.register_node("plasticbox:plasticbox", {
sounds = default.node_sound_stone_defaults(),
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
after_dig_node = unifieddyes.after_dig_node,
place_param2 = 240,
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
})
if minetest.global_exists("stairsplus") then
@ -30,6 +27,29 @@ minetest.register_craft( {
},
})
unifieddyes.register_color_craft({
output = "plasticbox:plasticbox 4",
palette = "extended",
neutral_node = "homedecor:plastic_sheeting",
recipe = {
{ "NEUTRAL_NODE", "NEUTRAL_NODE", "NEUTRAL_NODE" },
{ "NEUTRAL_NODE", "MAIN_DYE", "NEUTRAL_NODE" },
{ "NEUTRAL_NODE", "NEUTRAL_NODE", "NEUTRAL_NODE" },
}
})
unifieddyes.register_color_craft({
output = "plasticbox:plasticbox",
palette = "extended",
type = "shapeless",
neutral_node = "plasticbox:plasticbox",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_lbm({
name = "plasticbox:convert_colors",
label = "Convert plastic boxes to use param2 color",

View File

@ -1,19 +1,4 @@
## MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
License
=======
- Code WTFPL
- Texture CC

View File

@ -3,53 +3,16 @@ local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
if minetest.get_modpath("farming") then
-- this doesn't work reliably due to side effects of https://github.com/minetest/minetest/issues/5518
-- local old_def = minetest.registered_craftitems["farming:cotton"]
-- if old_def then
-- old_def.groups["thread"] = 1
-- minetest.override_item("farming:cotton", {
-- groups = old_def.groups
-- })
-- end
minetest.register_craft({
output = 'ropes:ropesegment',
output = 'ropes:ropesegment',
recipe = {
{'farming:cotton','farming:cotton'},
{'farming:cotton','farming:cotton'},
{'farming:cotton','farming:cotton'},
{'farming:cotton','farming:cotton'}
}
})
end
if minetest.get_modpath("hemp") then
minetest.register_craft({
output = 'ropes:ropesegment',
recipe = {
{'hemp:hemp_rope'},
{'hemp:hemp_rope'},
}
})
end
if minetest.get_modpath("cottages") then
minetest.register_craft({
output = 'ropes:ropesegment',
recipe = {
{'cottages:rope'},
{'cottages:rope'},
}
})
end
minetest.register_craft({
output = 'ropes:ropesegment',
recipe = {
{'group:thread','group:thread'},
{'group:thread','group:thread'},
{'group:thread','group:thread'},
}
})
minetest.register_craftitem("ropes:ropesegment", {
description = S("Rope Segment"),
_doc_items_longdesc = ropes.doc.ropesegment_longdesc,

View File

@ -3,6 +3,4 @@ farming?
vines?
doc?
intllib?
loot?
hemp?
cottages?
loot?

View File

@ -6,12 +6,12 @@ ropes = {
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
ropes.ropeLength = tonumber(minetest.settings:get("ropes_rope_length")) or 50
ropes.ropeLadderLength = tonumber(minetest.settings:get("ropes_rope_ladder_length")) or 50
ropes.woodRopeBoxMaxMultiple = tonumber(minetest.settings:get("ropes_wood_rope_box_max_multiple")) or 2
ropes.copperRopeBoxMaxMultiple = tonumber(minetest.settings:get("ropes_copper_rope_box_max_multiple")) or 5
ropes.steelRopeBoxMaxMultiple = tonumber(minetest.settings:get("ropes_steel_rope_box_max_multiple")) or 9
ropes.create_all_definitions = minetest.settings:get_bool("ropes_create_all_definitions")
ropes.ropeLength = tonumber(minetest.setting_get("ropes_rope_length")) or 50
ropes.ropeLadderLength = tonumber(minetest.setting_get("ropes_rope_ladder_length")) or 50
ropes.woodRopeBoxMaxMultiple = tonumber(minetest.setting_get("ropes_wood_rope_box_max_multiple")) or 2
ropes.copperRopeBoxMaxMultiple = tonumber(minetest.setting_get("ropes_copper_rope_box_max_multiple")) or 5
ropes.steelRopeBoxMaxMultiple = tonumber(minetest.setting_get("ropes_steel_rope_box_max_multiple")) or 9
ropes.create_all_definitions = minetest.setting_getbool("ropes_create_all_definitions")
dofile( minetest.get_modpath( ropes.name ) .. "/doc.lua" )
dofile( minetest.get_modpath( ropes.name ) .. "/functions.lua" )

View File

@ -46,17 +46,6 @@ local rope_ladder_top_def = {
},
groups = { choppy=2, oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
local target_node = minetest.get_node(pointed_thing.under)
local target_def = minetest.registered_nodes[target_node.name]
if target_def.walkable == false then
return itemstack
end
end
return minetest.item_place(itemstack, placer, pointed_thing)
end,
after_place_node = function(pos, placer)
local pos_below = {x=pos.x, y=pos.y-1, z=pos.z}

View File

@ -134,17 +134,6 @@ local function register_rope_block(multiple, max_multiple, name_prefix, node_pre
selection_box = {type="regular"},
collision_box = {type="regular"},
groups = {choppy=2, oddly_breakable_by_hand=1, rope_block = 1},
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
local target_node = minetest.get_node(pointed_thing.under)
local target_def = minetest.registered_nodes[target_node.name]
if target_def.walkable == false then
return itemstack
end
end
return minetest.item_place(itemstack, placer, pointed_thing)
end,
after_place_node = function(pos, placer)
local pos_below = {x=pos.x, y=pos.y-1, z=pos.z}
@ -236,8 +225,9 @@ local rope_def = {
drop = "",
tiles = { "ropes_3.png", "ropes_3.png", "ropes_3.png", "ropes_3.png", "ropes_5.png", "ropes_5.png" },
groups = {choppy=2, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
sounds = {
footstep = {name = "ropes_creak", gain = 0.8, max_hear_distance = 6},
footstep = "ropes_creak",
dig = "__group",
dug = "__group",
},
@ -272,7 +262,7 @@ local rope_bottom_def = {
drawtype = "nodebox",
groups = {choppy=2, flammable=2, not_in_creative_inventory=1},
sounds = {
footstep = {name = "ropes_creak", gain = 0.8, max_hear_distance = 6},
footstep = "ropes_creak",
dig = "__group",
dug = "__group",
},

View File

@ -6,10 +6,7 @@ minetest.register_node("solidcolor:block", {
sounds = (default and default.node_sound_stone_defaults()),
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
after_dig_node = unifieddyes.after_dig_node,
place_param2 = 240,
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
})
minetest.register_craft( {

View File

@ -17,6 +17,7 @@ Email: doyousketch2 @ yahoo.com
Unified Dyes was released under GNU-GPL 2.0, see LICENSE for info.
More Blocks was released under zlib/libpng for code and CC BY-SA 3.0 Unported for textures, see LICENSE.txt for info.
Additional changes by VanessaEzekowitz in July 2013 to take all items
out of creative inventory.
@ -33,6 +34,8 @@ January 2017 -- rewritten a bit more by Vanessa E. to use engine param2 coloriza
some dye to re-color it (you have to dig and re-place if you want to
darken it). Crafting is no longer used to create the colors.
August 2018 -- altered to use proper colored itemstacks with crafting
==============================================================================
]]--
@ -48,7 +51,6 @@ minetest.register_node("stained_glass:stained_glass", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
sunlight_propagates = true,
use_texture_alpha = true,
light_source = myglow,
@ -56,18 +58,12 @@ minetest.register_node("stained_glass:stained_glass", {
walkable = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_glass_defaults(),
drop = "moreblocks:super_glow_glass",
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
drop = "moreblocks:super_glow_glass"
})
minetest.override_item("moreblocks:super_glow_glass", {
palette = "unifieddyes_palette_extended.png",
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, ud_param2_colorable = 1},
ud_replacement_node = "stained_glass:stained_glass",
after_place_node = unifieddyes.recolor_on_place
})
-- trap glass
@ -79,7 +75,6 @@ minetest.register_node("stained_glass:stained_trap_glass", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
sunlight_propagates = true,
use_texture_alpha = true,
light_source = myglow,
@ -87,20 +82,40 @@ minetest.register_node("stained_glass:stained_trap_glass", {
walkable = false,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_glass_defaults(),
drop = "moreblocks:trap_super_glow_glass",
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
drop = "moreblocks:trap_super_glow_glass"
})
minetest.override_item("moreblocks:trap_super_glow_glass", {
palette = "unifieddyes_palette_extended.png",
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1},
ud_replacement_node = "stained_glass:stained_trap_glass",
after_place_node = unifieddyes.recolor_on_place
})
-- crafting
unifieddyes.register_color_craft({
output = "stained_glass:stained_glass",
palette = "extended",
type = "shapeless",
neutral_node = "moreblocks:super_glow_glass",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "stained_glass:stained_trap_glass",
palette = "extended",
type = "shapeless",
neutral_node = "moreblocks:trap_super_glow_glass",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
-- old static stuff
function stainedglass.makenode(arg)
local name=arg.blockname
local myglow=arg.glow

View File

@ -13,7 +13,8 @@ local defaults = {
enable_entity_radiation_damage = "true",
enable_longterm_radiation_damage = "true",
enable_nuclear_reactor_digiline_selfdestruct = "false",
enable_creative_mode = "false",
creative_mode = "false",
enable_producers = "true",
}
for k, v in pairs(defaults) do

View File

@ -8,9 +8,11 @@ dofile(path.."/cables.lua")
dofile(path.."/battery_box.lua")
-- Generators
dofile(path.."/solar_array.lua")
dofile(path.."/nuclear_reactor.lua")
dofile(path.."/generator.lua")
if technic.config:get_bool("enable_producers") then
dofile(path.."/solar_array.lua")
dofile(path.."/nuclear_reactor.lua")
dofile(path.."/generator.lua")
end
-- Machines
dofile(path.."/quarry.lua")

View File

@ -8,11 +8,13 @@ dofile(path.."/cables.lua")
dofile(path.."/battery_box.lua")
-- Generators
dofile(path.."/solar_panel.lua")
dofile(path.."/solar_array.lua")
dofile(path.."/geothermal.lua")
dofile(path.."/water_mill.lua")
dofile(path.."/generator.lua")
if technic.config:get_bool("enable_producers") then
dofile(path.."/solar_panel.lua")
dofile(path.."/solar_array.lua")
dofile(path.."/geothermal.lua")
dofile(path.."/water_mill.lua")
dofile(path.."/generator.lua")
end
-- Machines
dofile(path.."/alloy_furnace.lua")

View File

@ -8,11 +8,13 @@ dofile(path.."/cables.lua")
dofile(path.."/battery_box.lua")
-- Generators
if technic.config:get_bool("enable_wind_mill") then
dofile(path.."/wind_mill.lua")
if technic.config:get_bool("enable_producers") then
if technic.config:get_bool("enable_wind_mill") then
dofile(path.."/wind_mill.lua")
end
dofile(path.."/generator.lua")
dofile(path.."/solar_array.lua")
end
dofile(path.."/generator.lua")
dofile(path.."/solar_array.lua")
-- Machines
dofile(path.."/alloy_furnace.lua")

View File

@ -1,40 +1,41 @@
local S = technic.getter
minetest.register_abm({
nodenames = {"group:technic_lv","group:technic_mv","group:technic_hv"},
nodenames = {"group:technic_lv", "group:technic_mv", "group:technic_hv"},
label = "Run Machines",
interval = 1,
chance = 1,
action = function(pos,node)
local meta = minetest.get_meta(pos)
local pos1 = {x=pos.x,y=pos.y-1,z=pos.z}
local pos1 = {x=pos.x, y=pos.y-1, z=pos.z}
local tier = technic.get_cable_tier(minetest.get_node(pos1).name)
local meta = minetest.get_meta(pos)
if not tier then
meta:set_int("active",0)
meta:set_int("active", 0)
return
end
meta:set_int("active",1)
meta:set_int("LV_EU_input",meta:get_int("LV_EU_demand"))
meta:set_int("MV_EU_input",meta:get_int("MV_EU_demand"))
meta:set_int("HV_EU_input",meta:get_int("HV_EU_demand"))
meta:set_int("active", 1)
meta:set_int("LV_EU_input", meta:get_int("LV_EU_demand"))
meta:set_int("MV_EU_input", meta:get_int("MV_EU_demand"))
meta:set_int("HV_EU_input", meta:get_int("HV_EU_demand"))
local nodedef = minetest.registered_nodes[node.name]
if nodedef and nodedef.technic_run then
nodedef.technic_run(pos,node)
nodedef.technic_run(pos, node)
end
end,
})
minetest.register_lbm({
nodenames = {"technic:switching_station","technic:power_monitor"},
nodenames = {"technic:switching_station", "technic:power_monitor"},
name = "technic:update_infotext",
label = "Update switching station / power monitor infotext",
action = function(pos,node)
run_at_every_load = true,
action = function(pos, node)
local meta = minetest.get_meta(pos)
if node.name == "technic:switching_station" then
meta:set_string("infotext",S("Switching Station"))
meta:set_string("infotext", S("Switching Station"))
elseif node.name == "technic:power_monitor" then
meta:set_string("infotext",S("Power Monitor"))
meta:set_string("infotext", S("Power Monitor"))
end
end,
})

View File

@ -13,7 +13,7 @@ dofile(path.."/supply_converter.lua")
dofile(path.."/other/init.lua")
if technic.config:get_bool("enable_creative_mode") then
if technic.config:get_bool("creative_mode") then
--The switching station does not handle running machines
--in this mode, so alternative means are used to do so.
dofile(path.."/creative.lua")

View File

@ -35,7 +35,7 @@ minetest.register_node("technic:power_monitor",{
end,
})
if technic.config:get_bool("enable_creative_mode") then
if technic.config:get_bool("creative_mode") then
--Power distribution is not used in this mode,
--so the power monitor is inert and never needs to run.
return

View File

@ -88,7 +88,7 @@ minetest.register_node("technic:switching_station",{
},
})
if technic.config:get_bool("enable_creative_mode") then
if technic.config:get_bool("creative_mode") then
--Power distribution is not used in this mode,
--so the switching station is inert and none of the
--network processing is needed.

View File

@ -103,21 +103,15 @@ minetest.register_node("unifiedbricks:brickblock", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
groups = {cracky=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:brick"
})
minetest.override_item("default:brick", {
ud_replacement_node = "unifiedbricks:brickblock",
palette = "unifieddyes_palette_extended.png",
groups = {cracky = 3, ud_param2_colorable = 1},
after_place_node = unifieddyes.recolor_on_place
})
minetest.register_node("unifiedbricks:clayblock", {
@ -127,23 +121,17 @@ minetest.register_node("unifiedbricks:clayblock", {
},
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
groups = {crumbly=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_dirt_defaults({
footstep = "",
}),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:clay"
})
minetest.override_item("default:clay", {
ud_replacement_node = "unifiedbricks:clayblock",
palette = "unifieddyes_palette_extended.png",
groups = {crumbly = 3, ud_param2_colorable = 1},
after_place_node = unifieddyes.recolor_on_place,
})
minetest.register_node("unifiedbricks:brickblock_multicolor_dark", {
@ -157,13 +145,10 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_dark", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
})
minetest.register_node("unifiedbricks:brickblock_multicolor_medium", {
@ -177,13 +162,10 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_medium", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
})
minetest.register_node("unifiedbricks:brickblock_multicolor_light", {
@ -197,13 +179,10 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_light", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
})
minetest.register_craft( {
@ -239,6 +218,61 @@ minetest.register_craft( {
},
})
unifieddyes.register_color_craft({
output = "unifiedbricks:brickblock",
palette = "extended",
neutral_node = "default:brick",
type = "shapeless",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "unifiedbricks:clayblock",
palette = "extended",
neutral_node = "default:clay",
type = "shapeless",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "unifiedbricks:brickblock_multicolor_dark",
palette = "extended",
neutral_node = "unifiedbricks:brickblock_multicolor_dark",
type = "shapeless",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "unifiedbricks:brickblock_multicolor_medium",
palette = "extended",
neutral_node = "unifiedbricks:brickblock_multicolor_medium",
type = "shapeless",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "unifiedbricks:brickblock_multicolor_light",
palette = "extended",
neutral_node = "unifiedbricks:brickblock_multicolor_light",
type = "shapeless",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
-- static nodes
unifiedbricks.register_old_static_block = function(name, formalname, blocktype)

View File

@ -6,23 +6,20 @@ In your node definition, you must include a few things to interface with Unified
```lua
minetest.register_node("mymod:colored_node", {
description = "My custom colored node",
tiles = { "mymod_custom_colored_node.png" },
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
groups = {snappy = 1, cracky = 2, ud_param2_colorable = 1}
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
description = "My custom colored node",
tiles = { "mymod_custom_colored_node.png" },
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
groups = {snappy = 1, cracky = 2, ud_param2_colorable = 1}
on_construct = unifieddyes.on_construct,
})
```
`paramtype2` must be one of:
- "color" this is an 89-color or 256-color node
- "colorwallmounted" this is a 32-color node using "wallmounted" mode
- "colorfacedir" this node uses one of the "split" 89-color palettes.
- "color": this is an 89-color or 256-color node
- "colorwallmounted": this is a 32-color node using "wallmounted" mode
- "colorfacedir": this node uses one of the "split" 89-color palettes.
`palette` must be set to match the `paramtype2` setting, and must be one of:
- "unifieddyes_palette.png"
@ -30,18 +27,12 @@ minetest.register_node("mymod:colored_node", {
- "unifieddyes_palette_colorwallmounted.png"
- or one of the "split" hues palettes (see below).
`place_param2` generally is only needed for the 256-color palette, and should usually be set to 240 (which corresponds to white).
`groups` If your node can be colored by punching it with dye, its groups entry must contain the key ud_param2_colorable = 1, among whatever else you'd normally put there. If the node is software-controlled, as might be the case for some mesecons-digilines aware node, then this group key should be omitted.
`on_construct` see below.
`after_place_node` see below.
`after_dig_node` see below.
`groups`: If your node can be colored by punching it with dye, its groups entry must contain the key ud_param2_colorable = 1, among whatever else you'd normally put there. If the node is software-controlled, as might be the case for some mesecons-digilines aware node, then this group key should be omitted.
`on_construct`: see below.
#### Function calls
**`unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)`**
Call this within your node's `after_place_node` callback to allow Unified Dyes to automatically color the node using the dye you last used on that kind of node The feature will remain active until the dye runs out, or the user places a different kind of colorable node, or the user cancels the feature.
**`unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)`
`unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)`**
@ -63,15 +54,16 @@ Again, another obvious one, returns whether or not the pointed node is `buildabl
Accepts an item name, and returns the corresponding hue, saturation, and value (in that order), as strings.
If the item name is a color (not greyscale), then hue will be the basic hue for that color, saturation will be empty string for high saturation or `_s50` for low, and value will be `dark_`, `medium_`, `light_`, or an empty string if it's full color.
If the item name is a color (not greyscale), then `hue` will be the basic hue for that color, saturation will be empty string for high saturation or "_s50" for low, and value will be "dark_", "medium_", "light_", or an empty string if it's full color.
If the item name is greyscale, then hue will contain `white`, `light_grey`, `grey`, `dark_grey`, or `black`, saturation will (ironically) be an empty string, and value will be `light_`, `dark_`, or empty string if it's medium grey.
If the item name is greyscale, then `hue` will contain "white", "light_grey", "grey", "dark_grey", or "black", saturation will (ironically) be an empty string, and value will be "light_", "dark_", or empty string to correspond with the contents of `hue`.
For example:
"mymod:mynode_red" would return ("red", "", "")
"mymod:mynode_light_blue" would return ("blue", "", "light_")
"mymod:mynode_dark_yellow_s50" would return ("yellow", "_s50", "dark_")
"mymod:mynode_dark_grey" would return ("dark_grey", "", "dark_")
* "mymod:mynode_red" would return ("red", "", "")
* "mymod:mynode_light_blue" would return ("blue", "", "light_")
* "mymod:mynode_dark_yellow_s50" would return ("yellow", "_s50", "dark_")
* "mymod:mynode_dark_grey" would return ("dark_grey", "", "dark_")
**`unifieddyes.getpaletteidx(color, palette_type)`**
@ -83,15 +75,7 @@ When given a `color` string (in the form of "dye:foo" or "unifieddyes:foo") and
**`unifieddyes.on_construct(pos)`**
This function, called in your node definition's on_construct, just sets the `palette = "ext"` metadata key for the node after it's been placed. This can then be read in an LBM to determine if this node needs to be converted from the old 89-color palette to the extended 256-color palette. Although it is good practice to call this for any node that uses the 256-color palette, it isn't strictly necessary as long as the node has never used the 89-color palette and won't be subjected to an LBM that changes its color.
**`unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger)`**
This function handles returning dyes to the user when a node is dug. All colorized nodes need to call this in `after_dig_node`.
**`unifieddyes.on_use(itemstack, player, pointed_thing)`**
This function is used internally by Unfiied Dyes to actually make a dye able to colorize a node when you wield and punch with it. Unified Dyes redefines the minetest_game default dye items to call this function.
This function, called in your node definition's on_construct, just sets the `palette = "ext"` metadata key for the node after it's been placed. This can then be read in an LBM to determine if this node needs to be converted from the old 89-color palette to the extended 256-color palette. Although it is good practice to call this for any node that uses the 256-color palette, it isn't actually necessary as long as the node has never used the 89-color palette, and won't be subjected to an LBM that changes its color.
#### Tables
@ -103,6 +87,68 @@ In addition to the above API calls, Unified Dyes provides several useful tables
`unifieddyes.base_color_crafts` contains a condensed list of crafting recipes for all 24 basic hues, plus black and white, most of which have multiple alternative recipes. Each line contains the name of the color, up to five dye itemstrings (with `nil` in each unused space), and the yield for that craft.
`unifieddyes.shade_crafts` contains recipes for each of the 10 shades a hue can take on, used with one or two portions of the dye corresponding to that hue. Each line contains the shade name with trailing "_", the saturation name (either `_s50` or empty string), up to three dye itemstrings, and the yield for that craft.
`unifieddyes.shade_crafts` contains recipes for each of the 10 shades a hue can take on, used with one or two portions of the dye corresponding to that hue. Each line contains the shade name with trailing "_", the saturation name (either "_s50" or empty string), up to three dye item strings, and the yield for that craft.
`unifieddyes.greymixes` contains the recipes for the 14 shades of grey. Each line contains the grey shade number from 1-14, up to four dye item names, and the yield for that craft.
#### Converting an old mod
If your mod used the old paradigm where you craft a neutral-colored item, place it, and punch with dye to color it, and you wish to convert it to colored itemstacks, take the following actions for each node:
* Remove these keys:
```lua
after_dig_node = unifieddyes.after_dig_node,
place_param2 = 240,
after_place_node = unifieddyes.recolor_on_place,
```
* Add a call to the create-all-recipes helper. Here's an example:
```lua
unifieddyes.register_color_craft({
output = "mymod:colored_node 6",
palette = "extended",
neutral_node = "mymod:my_base_node_material",
recipe = {
{ "NEUTRAL_NODE", "MAIN_DYE", "NEUTRAL_NODE" },
{ "MAIN_DYE", "NEUTRAL_NODE", "MAIN_DYE" },
{ "NEUTRAL_NODE", "MAIN_DYE", "NEUTRAL_NODE" }
}
})
```
`output` is a standard item string as in the normal `minetest.register_craft()` call.
`palette` specifies the palette type to iterate through ("extended" and "wallmounted" are obvious, and if not specified, it'll use the 89 color palette).
`type` can be "shapeless" or unspecified/`nil`, and works the same as in the normal call.
`neutral_node` should specify the name of whatever item or node serves as the base, neutrally-colored material in your recipe. This really only applies if your node is just made from one item (or more than one of the same item), plus one or more dyes. If your node is just made from a collection of item and no one item is really the neutral material, or anyway if you don't need this substitution, you must set it to an empty string.
`recipe` is the same as in the normal call, except that Unified Dyes will replace all instances of the string "NEUTRAL_NODE" with the item specified in the preceding `neutral_node` field. Every instance of "MAIN_DYE" will be replaced with a portion of dye, as Unified Dyes' recipe helper works through its color lists (i.e. this field will become whatever dye is needed for each recipe).
If your mod never has never used Unified Dyes at all, in short, do the following:
* Remove all of your various colored node definitions, keeping only the one for the white version of your node, or delete them all, and keep whatever node you consider to be "neutral colored".
* Delete all of the colored texture files too, except keep the brightest, highest-contrast, most detailed one - whichever color that happens to be. Most likely, red or green will be the best one.
* Convert that last texture to grayscale, enhance its contrast as much as you can without distorting it, and rename it to something more neutral.
* Add the `on_construct` and `palette` keys to your neutral node definition, for example:
`palette = "unifieddyes_palette_extended.png",`
`on_construct = unifieddyes.on_construct,`
* Adjust your node's groups to specify that the node can be colored. Example (note the last item):
`groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},`
* Remove all crafting recipes for all colored versions of that node, keeping only the one that makes the "neutral" one.
* Add the above recipes helper call (which replaces those delted recipes)
If your colored node is based on someone else's neutral node, for example if you made a mod that creates multiple colors of minetest_game's default clay, you may find it best to create a single "stand-in" node that's identical to the neutral node, but named for your mod, hidden from the creative inventory, and has a properly-prepared grayscale texture image in addition to the above keys. Use the neutral node and the custom hidden node as in the above craft helper call. Then use minetest.override_item() to add the on_construct and palette keys and the ud_param2_colorable group to that "someone else's" node.
* You will need to write a run-only-once LBM to convert your old statically-colored nodes to use hardware coloring. See above for functions that will help reduce the work required for this part.

View File

@ -30,8 +30,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
--=====================================================================
unifieddyes = {}
unifieddyes.last_used_dye = {}
unifieddyes.last_dyed_node = {}
local creative_mode = minetest.settings:get_bool("creative_mode")
@ -89,6 +87,17 @@ unifieddyes.HUES_EXTENDED = {
{ "crimson", 0xff, 0x00, 0x40 }
}
unifieddyes.HUES_WALLMOUNTED = {
"red",
"orange",
"yellow",
"green",
"cyan",
"blue",
"violet",
"magenta"
}
unifieddyes.SATS = {
"",
"_s50"
@ -118,6 +127,14 @@ unifieddyes.GREYS = {
"black"
}
unifieddyes.GREYS_EXTENDED = table.copy(unifieddyes.GREYS)
for i = 1, 14 do
if i ~= 0 and i ~= 3 and i ~= 7 and i ~= 11 and i ~= 15 then
table.insert(unifieddyes.GREYS_EXTENDED, "grey_"..i)
end
end
local default_dyes = {
"black",
"blue",
@ -136,77 +153,123 @@ local default_dyes = {
"yellow"
}
-- automatically recolor a placed node to match the last-used dye
-- should be called in the node's `after_place_node` callback.
-- just stubs to keep old mods from crashing when expecting auto-coloring
-- or getting back the dye on dig.
function unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
local playername = placer:get_player_name()
local stackname = itemstack:get_name()
if unifieddyes.last_dyed_node[playername] ~= stackname then
if unifieddyes.last_used_dye[playername] then
minetest.chat_send_player(playername, "Switched to \""..stackname.."\" while auto-coloring, color reset to neutral.")
end
unifieddyes.last_used_dye[playername] = nil
unifieddyes.last_dyed_node[playername] = nil
end
unifieddyes.last_dyed_node[playername] = stackname
if unifieddyes.last_used_dye[playername] then
local lastdye = unifieddyes.last_used_dye[playername]
local inv = placer:get_inventory()
if (lastdye and lastdye ~= "" and inv:contains_item("main", lastdye.." 1")) or creative_mode then
local nodedef = minetest.registered_nodes[stackname]
local newname = nodedef.ud_replacement_node or stackname
local node = minetest.get_node(pos)
local palette_type = true -- default to 89-color split, because the others are easier to check for.
local oldfdir = node.param2 % 32
if nodedef.palette == "unifieddyes_palette.png" then
palette_type = false
oldfdir = 0
elseif nodedef.palette == "unifieddyes_palette_colorwallmounted.png" then
palette_type = "wallmounted"
oldfdir = node.param2 % 8
elseif nodedef.palette == "unifieddyes_palette_extended.png" then
palette_type = "extended"
oldfdir = 0
end
local paletteidx, hue = unifieddyes.getpaletteidx(lastdye, palette_type)
if palette_type == true and hue ~= 0 then newname = string.gsub(newname, "_grey", "_"..unifieddyes.HUES[hue]) end
minetest.set_node(pos, { name = newname, param2 = oldfdir + paletteidx })
local meta = minetest.get_meta(pos)
meta:set_string("dye", lastdye)
if not creative_mode then
inv:remove_item("main", lastdye.." 1")
end
else
minetest.chat_send_player(playername, "Ran out of "..unifieddyes.last_used_dye[playername]..", resetting to neutral.")
unifieddyes.last_used_dye[playername] = nil
end
end
function unifieddyes.recolor_on_place(foo)
end
minetest.register_on_leaveplayer(function(player)
local playername = player:get_player_name()
unifieddyes.last_used_dye[playername] = nil
unifieddyes.last_dyed_node[playername] = nil
end)
function unifieddyes.after_dig_node(foo)
end
-- This helper function creates a colored itemstack
function unifieddyes.make_colored_itemstack(item, palette, color)
local paletteidx = unifieddyes.getpaletteidx(color, palette)
local stack = ItemStack(item)
stack:get_meta():set_int("palette_index", paletteidx)
return stack:to_string()
end
-- if your node was once 89-color and uses an LBM to convert to the 256-color palette,
-- call this in that node def's on_construct:
function unifieddyes.on_construct(pos)
local meta = minetest.get_meta(pos)
meta:set_string("palette", "ext")
end
-- these helper functions register all of the recipes needed to create colored
-- nodes with any of the dyes supported by that node's palette.
local function register_c(craft, hue, sat, val)
local color = ""
if val then
if craft.palette ~= "extended" then
color = val..hue..sat
else
color = val..hue[1]..sat
end
else
color = hue -- if val is nil, then it's grey.
end
local dye = "dye:"..color
local recipe = minetest.serialize(craft.recipe)
recipe = string.gsub(recipe, "MAIN_DYE", dye)
recipe = string.gsub(recipe, "NEUTRAL_NODE", craft.neutral_node)
local newrecipe = minetest.deserialize(recipe)
local output = craft.output
if craft.output_prefix then
if craft.palette ~= true then
output = craft.output_prefix..color..craft.output_suffix
else
if hue == "white" or hue == "black" or string.find(hue, "grey") then
output = craft.output_prefix.."grey"..craft.output_suffix
elseif hue == "pink" then
dye = "dye:light_red"
output = craft.output_prefix.."red"..craft.output_suffix
else
output = craft.output_prefix..hue..craft.output_suffix
end
end
end
local colored_itemstack =
unifieddyes.make_colored_itemstack(output, craft.palette, dye)
minetest.register_craft({
output = colored_itemstack,
type = craft.type,
recipe = newrecipe
})
end
function unifieddyes.register_color_craft(craft)
local hues_table = unifieddyes.HUES
local sats_table = unifieddyes.SATS
local vals_table = unifieddyes.VALS
local greys_table = unifieddyes.GREYS
if craft.palette == "wallmounted" then
hues_table = unifieddyes.HUES_WALLMOUNTED
sats_table = {""}
vals_table = unifieddyes.VALS
elseif craft.palette == "extended" then
hues_table = unifieddyes.HUES_EXTENDED
vals_table = unifieddyes.VALS_EXTENDED
greys_table = unifieddyes.GREYS_EXTENDED
end
for _, hue in ipairs(hues_table) do
for _, val in ipairs(vals_table) do
for _, sat in ipairs(sats_table) do
if sat == "_s50" and val ~= "" and val ~= "medium_" and val ~= "dark_" then break end
register_c(craft, hue, sat, val)
end
end
end
for _, grey in ipairs(greys_table) do
register_c(craft, grey)
end
register_c(craft, "pink")
end
-- code borrowed from homedecor
-- 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 colorbits = node.param2 - (node.param2 % 8)
local yaw = placer:get_look_horizontal()
local dir = minetest.yaw_to_dir(yaw) -- -1.5)
local pitch = placer:get_look_vertical()
@ -218,7 +281,7 @@ function unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
elseif pitch > math.pi/8 then
fdir = 1
end
minetest.swap_node(pos, { name = node.name, param2 = fdir })
minetest.swap_node(pos, { name = node.name, param2 = fdir+colorbits })
end
-- use this when you have a "wallmounted" node that should never be oriented
@ -226,10 +289,12 @@ end
function unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
local node = minetest.get_node(pos)
local colorbits = node.param2 - (node.param2 % 8)
local yaw = placer:get_look_horizontal()
local dir = minetest.yaw_to_dir(yaw+1.5)
local fdir = minetest.dir_to_wallmounted(dir)
minetest.swap_node(pos, { name = node.name, param2 = fdir })
minetest.swap_node(pos, { name = node.name, param2 = fdir+colorbits })
end
-- ... and use this one to force that kind of node off of floor/ceiling
@ -532,34 +597,6 @@ function unifieddyes.getpaletteidx(color, palette_type)
end
end
-- if your node was once 89-color and uses an LBM to convert to the 256-color palette,
-- call this in that node def's on_construct:
function unifieddyes.on_construct(pos)
local meta = minetest.get_meta(pos)
meta:set_string("palette", "ext")
end
-- call this in your node's after_dig_node to get the last-used dye back.
function unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger)
local prevdye
if oldmetadata and oldmetadata.fields then
prevdye = oldmetadata.fields.dye
end
local inv = digger:get_inventory()
if prevdye and not (inv:contains_item("main", prevdye) and creative_mode) and minetest.registered_items[prevdye] then
if inv:room_for_item("main", prevdye) then
inv:add_item("main", prevdye)
else
minetest.add_item(pos, prevdye)
end
end
end
function unifieddyes.on_use(itemstack, player, pointed_thing)
local stackname = itemstack:get_name()
local playername = player:get_player_name()
@ -594,14 +631,6 @@ function unifieddyes.on_use(itemstack, player, pointed_thing)
end
end
if player:get_player_control().sneak then
if unifieddyes.last_used_dye[playername] then
minetest.chat_send_player(playername, "Shift-punched a node, switching back to neutral color." )
end
unifieddyes.last_used_dye[playername] = nil
return
end
-- if the target is unknown, has no groups defined, or isn't UD-colorable, just bail out
if not (nodedef and nodedef.groups and nodedef.groups.ud_param2_colorable) then
minetest.chat_send_player(playername, "That node can't be colored.")
@ -631,11 +660,6 @@ function unifieddyes.on_use(itemstack, player, pointed_thing)
if paletteidx then
if unifieddyes.last_used_dye[playername] ~= stackname then
minetest.chat_send_player(playername, "Color "..stackname.." selected, auto-coloring activated." )
unifieddyes.last_used_dye[playername] = stackname
end
local meta = minetest.get_meta(pos)
local prevdye = meta:get_string("dye")
local inv = player:get_inventory()