updated castles, coloredwood, digistuff, locks, mesecons,

pipeworks, steel, unified dyes, unified mesecons, and worldedit
This commit is contained in:
Vanessa Dannenberg 2018-09-08 12:12:15 -04:00
parent ba470a6975
commit aaed0a2ea8
66 changed files with 2537 additions and 585 deletions

View File

@ -5,14 +5,18 @@
-- * 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"),
@ -69,7 +73,7 @@ minetest.register_entity("anvil:item",{
})
local remove_item = function(pos, node)
local objs = minetest.env:get_objects_inside_radius({x = pos.x, y = pos.y + item_displacement, z = pos.z}, .5)
local objs = minetest.get_objects_inside_radius({x = pos.x, y = pos.y + anvil.setting.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
@ -80,13 +84,13 @@ local remove_item = function(pos, node)
end
local update_item = function(pos, node)
local meta = minetest.env:get_meta(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if not inv:is_empty("input") then
pos.y = pos.y + item_displacement
pos.y = pos.y + anvil.setting.item_displacement
tmp.nodename = node.name
tmp.texture = inv:get_stack("input", 1):get_name()
local e = minetest.env:add_entity(pos,"anvil:item")
local e = minetest.add_entity(pos,"anvil:item")
local yaw = math.pi*2 - node.param2 * math.pi/2
e:setyaw(yaw)
end
@ -157,6 +161,7 @@ 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
@ -179,12 +184,13 @@ minetest.register_node("anvil:anvil", {
on_rightclick = function(pos, node, clicker, itemstack)
if itemstack:get_count() == 0 then
local meta = minetest.env:get_meta(pos)
local meta = minetest.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)
clicker:get_inventory():add_item("main", return_stack)
local wield_index = clicker:get_wield_index()
clicker:get_inventory():set_stack("main", wield_index, return_stack)
remove_item(pos, node)
return return_stack
end
@ -192,7 +198,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.env:get_meta(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
inv:add_item("input", s)
update_item(pos,node)
@ -213,7 +219,8 @@ 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)
puncher:get_inventory():add_item("main", return_stack)
local wield_index = puncher:get_wield_index()
puncher:get_inventory():set_stack("main", wield_index, return_stack)
remove_item(pos, node)
end
end
@ -280,7 +287,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 + item_displacement
pos.y = pos.y + anvil.setting.item_displacement
minetest.sound_play({name="anvil_clang"}, {pos=pos})
minetest.add_particlespawner({
amount = 10,
@ -318,7 +325,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 + item_displacement, z=pos.z}
local test_pos = {x=pos.x, y=pos.y + anvil.setting.item_displacement, z=pos.z}
if #minetest.get_objects_inside_radius(test_pos, 0.5) > 0 then return end
update_item(pos, node)
end
@ -361,6 +368,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", '', ''} },
})

65
anvil/locale/es.po Normal file
View File

@ -0,0 +1,65 @@
# 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."

70
anvil/locale/fr.po Normal file
View File

@ -0,0 +1,70 @@
# 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."

68
anvil/locale/it.po Normal file
View File

@ -0,0 +1,68 @@
# 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

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

View File

@ -0,0 +1,30 @@
# 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

@ -0,0 +1,30 @@
# 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("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")
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")
-- 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,6 +16,21 @@ 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 }},
@ -25,11 +40,7 @@ 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 = {
{"castle_gates:jailbars", "castle_gates:jailbars"},
{"castle_gates:jailbars", "castle_gates:jailbars"},
{"castle_gates:jailbars", "castle_gates:jailbars"},
}
recipe = door_recipe,
})
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
if test_node_def.paramtype2 == "facedir" then -- prospective door nodes need to be of type facedir
local test_node_dirs = get_dirs(test_node.param2)
local coplanar = vector.equals(test_node_dirs.back, door.directions.back)
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
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,17 +163,18 @@ 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)
if test_node_def._gate_hinge ~= nil then
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
local axis, placement = interpret_hinge(test_node_def._gate_hinge, test_pos, test_node_dirs)
if door.hinge == nil then
if door.hinge == nil then -- this is the first hinge we've encountered.
door.hinge = {axis=axis, placement=placement}
elseif door.hinge.axis ~= axis then
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?
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))
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
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,34 +91,33 @@ castle_gates.register_gate_slot = function(material)
minetest.register_craft({
output = mod_name..":"..material.name.."_portcullis_slot 3",
output = mod_name..":"..material.name.."_gate_slot 2",
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.."_portcullis_slot",
output = mod_name..":"..material.name.."_gate_slot",
type = "shapeless",
recipe = {mod_name..":"..material.name.."_portcullis_slot_reverse"},
recipe = {mod_name..":"..material.name.."_gate_slot_reverse"},
})
minetest.register_craft({
output = mod_name..":"..material.name.."_portcullis_slot_reverse",
output = mod_name..":"..material.name.."_gate_slot_reverse",
type = "shapeless",
recipe = {mod_name..":"..material.name.."_portcullis_slot"},
recipe = {mod_name..":"..material.name.."_gate_slot"},
})
if burn_time > 0 then
minetest.register_craft({
type = "fuel",
recipe = mod_name..":"..material.name.."_portcullis_slot",
recipe = mod_name..":"..material.name.."_gate_slot",
burntime = burn_time * 2,
})
minetest.register_craft({
type = "fuel",
recipe = mod_name..":"..material.name.."_portcullis_slot_reverse",
recipe = mod_name..":"..material.name.."_gate_slot_reverse",
burntime = burn_time * 2,
})
end

261
castle_gates/locale/es.po Normal file
View File

@ -0,0 +1,261 @@
#, 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"

274
castle_gates/locale/it.po Normal file
View File

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

View File

@ -0,0 +1,54 @@
# 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

@ -0,0 +1,55 @@
# 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"

34
castle_masonry/README.md Normal file
View File

@ -0,0 +1,34 @@
## 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

View File

@ -1,43 +0,0 @@
=-=-=-=-=-=-=-=-=-=
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,4 +3,5 @@ moreblocks?
stairs?
building_blocks?
asphalt?
streets?
streets?
intllib?

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.setting_getbool(name)
local setting = minetest.settings:get_bool(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:stonewall"})
table.insert(castle_masonry.materials, {name="stonewall", desc=S("Stonewall"), tile="castle_stonewall.png", craft_material="castle_masonry: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

189
castle_masonry/locale/es.po Normal file
View File

@ -0,0 +1,189 @@
# 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"

189
castle_masonry/locale/fr.po Normal file
View File

@ -0,0 +1,189 @@
# 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"

191
castle_masonry/locale/it.po Normal file
View File

@ -0,0 +1,191 @@
# 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 4",
output = mod_name..":pillar_"..material.name.."_middle 2",
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({

23
castle_shields/README.md Normal file
View File

@ -0,0 +1,23 @@
## 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"

View File

@ -1,25 +0,0 @@
=-=-=-=-=-=-=-=-=-=
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

@ -0,0 +1,23 @@
# 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

@ -0,0 +1,56 @@
# 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"

1
castle_storage/mod.conf Normal file
View File

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

View File

@ -79,12 +79,22 @@ 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(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
)
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,
})
end
end
@ -361,7 +371,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.setting_getbool("creative_mode") then
if not minetest.settings:get_bool("creative_mode") then
itemstack:add_wear(65535/CROSSBOW_USES)
end
itemstack = "castle_weapons:crossbow 1 "..itemstack:get_wear()
@ -421,7 +431,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.setting_getbool("creative_mode") then
if not minetest.settings:get_bool("creative_mode") then
inv:remove_item("main", "castle_weapons:crossbow_bolt 1")
end
return "castle_weapons:crossbow_loaded 1 "..itemstack:get_wear()

View File

@ -0,0 +1,31 @@
# 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

@ -222,7 +222,7 @@ for _, mname in ipairs(coloredwood_cuts) do
unifieddyes.register_color_craft({
output_prefix = "coloredwood:"..class.."_wood_",
output_suffix = shape,
palette = true,
palette = "split",
type = "shapeless",
neutral_node = mname,
recipe = {
@ -326,111 +326,4 @@ if coloredwood.enable_stairsplus then
end
end
local old_shades = {
"",
"",
"",
"light_",
"medium_",
"medium_",
"dark_",
"dark_"
}
local old_greys = {
"white",
"white",
"light_grey",
"grey",
"dark_grey",
"black",
"white",
"white"
}
minetest.register_lbm({
name = "coloredwood:convert",
label = "Convert wood blocks, fences, stairsplus stuff, etc to use param2 color",
run_at_every_load = false,
nodenames = coloredwood.old_static_nodes,
action = function(pos, node)
local meta = minetest.get_meta(pos)
local name = node.name
local hue, sat, val = unifieddyes.get_hsv(name)
local color = val..hue..sat
local s1, s2 = is_stairsplus(name, true)
if meta and (meta:get_string("dye") ~= "") then return end -- node has already been converted before.
if s1 then
if not s2 then print("impossible conversion request! name = "..node.name.." --> ".."coloredwood:"..s1.."_wood_"..hue.."*nil*") return end
local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, true)
local cfdir = paletteidx + (node.param2 % 32)
local newname = "coloredwood:"..s1.."_wood_"..hue..s2
minetest.set_node(pos, { name = newname, param2 = cfdir })
local meta = minetest.get_meta(pos)
meta:set_string("dye", "unifieddyes:"..color)
elseif string.find(name, ":fence") then
local paletteidx, hue = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
minetest.set_node(pos, { name = "coloredwood:fence", param2 = paletteidx })
meta:set_string("dye", "unifieddyes:"..color)
meta:set_string("palette", "ext")
else
if hue == "aqua" then
hue = "spring"
elseif hue == "skyblue" then
hue = "azure"
elseif hue == "redviolet" then
hue = "rose"
end
color = val..hue..sat
local paletteidx, hue = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
minetest.set_node(pos, { name = "coloredwood:wood_block", param2 = paletteidx })
meta:set_string("dye", "unifieddyes:"..color)
meta:set_string("palette", "ext")
end
end
})
table.insert(coloredwood.old_13_color_nodes, "coloredwood:fence")
minetest.register_lbm({
name = "coloredwood:recolor_basics",
label = "Convert fences and base 13-color wood to use UD extended palette",
run_at_every_load = false,
nodenames = coloredwood.old_13_color_nodes,
action = function(pos, node)
local meta = minetest.get_meta(pos)
if meta:get_string("palette") ~= "ext" then
if node.name == "coloredwood:fence" then
minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] })
else
local hue = string.sub(node.name, 18)
local shadenum = math.floor(node.param2/32) + 1
local shade = old_shades[shadenum]
local sat = ""
if hue == "grey" then
hue = old_greys[shadenum]
shade = ""
sat = ""
elseif shadenum == 3 or shadenum == 6 or shadenum == 8 then
sat = "_s50"
end
local newcolor = unifieddyes.convert_classic_palette[unifieddyes.getpaletteidx("unifieddyes:"..shade..hue..sat)]
minetest.swap_node(pos, { name = "coloredwood:wood_block", param2 = newcolor })
end
meta:set_string("palette", "ext")
end
end
})
print("[Colored Wood] Loaded!")

View File

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

View File

@ -1,2 +1,3 @@
default?
digilines
mesecons?

View File

@ -360,7 +360,7 @@ minetest.register_node("digistuff:digimese", {
light_source = 3,
groups = {cracky = 3, level = 2},
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
sounds = default and default.node_sound_stone_defaults(),
digiline = { wire = { rules = {
{x = 1, y = 0, z = 0},
{x =-1, y = 0, z = 0},
@ -417,7 +417,7 @@ minetest.register_node("digistuff:button", {
minetest.chat_send_player(sender:get_player_name(),"Channel and message must both be set!")
end
end,
sounds = default.node_sound_stone_defaults(),
sounds = default and default.node_sound_stone_defaults(),
})
minetest.register_node("digistuff:button_off", {
@ -460,7 +460,7 @@ minetest.register_node("digistuff:button_off", {
if minetest.get_modpath("mesecons") then minetest.sound_play("mesecons_button_push", {pos=pos}) end
minetest.after(0.5, digistuff.button_turnoff, pos)
end,
sounds = default.node_sound_stone_defaults(),
sounds = default and default.node_sound_stone_defaults(),
})
minetest.register_node("digistuff:button_on", {
@ -477,7 +477,7 @@ minetest.register_node("digistuff:button_on", {
paramtype2 = "facedir",
legacy_wallmounted = true,
walkable = false,
light_source = default.LIGHT_MAX-7,
light_source = 7,
sunlight_propagates = true,
selection_box = {
type = "fixed",
@ -502,7 +502,7 @@ minetest.register_node("digistuff:button_on", {
if minetest.get_modpath("mesecons") then minetest.sound_play("mesecons_button_push", {pos=pos}) end
end,
description = "Digilines Button (on state - you hacker you!)",
sounds = default.node_sound_stone_defaults(),
sounds = default and default.node_sound_stone_defaults(),
})
minetest.register_craft({
@ -553,7 +553,7 @@ minetest.register_node("digistuff:detector", {
if fields.msg then meta:set_string("msg",fields.msg) end
if fields.radius then meta:set_string("radius",fields.radius) end
end,
sounds = default.node_sound_stone_defaults()
sounds = default and default.node_sound_stone_defaults()
})
minetest.register_abm({
@ -877,7 +877,7 @@ minetest.register_node("digistuff:camera", {
if fields.distance and tonumber(fields.distance) then meta:set_int("distance",math.max(math.min(20,fields.distance),0)) end
if fields.radius and tonumber(fields.radius) then meta:set_int("radius",math.max(math.min(10,fields.radius),1)) end
end,
sounds = default.node_sound_stone_defaults()
sounds = default and default.node_sound_stone_defaults()
})
minetest.register_abm({
@ -989,3 +989,115 @@ if minetest.get_modpath("mesecons_noteblock") then
},
})
end
for i=0,14,1 do
local mult = 255 - ((14-i)*16)
minetest.register_node("digistuff:light_"..i, {
drop = "digistuff:light_0",
description = "Digilines Dimmable Light"..(i > 0 and " (on state - you hacker you!)" or ""),
tiles = {"digistuff_light.png"},
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.25,0.4,-0.25,0.25,0.5,0.25},
}
},
groups = i > 0 and {cracky = 1, not_in_creative_inventory = 1} or {cracky = 1},
is_ground_content = false,
light_source = i,
color = {r = mult,g = mult,b = mult},
sounds = default and default.node_sound_glass_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec","field[channel;Channel;${channel}")
end,
on_receive_fields = function(pos, formname, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
minetest.record_protection_violation(pos,name)
return
end
local meta = minetest.get_meta(pos)
if fields.channel then meta:set_string("channel",fields.channel) end
end,
digiline = {
receptor = {},
wire = {
rules = {
{x = 1,y = 0,z = 0},
{x = -1,y = 0,z = 0},
{x = 0,y = 0,z = 1},
{x = 0,y = 0,z = -1},
{x = 0,y = 1,z = 0},
{x = 0,y = -1,z = 0},
{x = 0,y = 2,z = 0},
}
},
effector = {
action = function(pos,node,channel,msg)
local meta = minetest.get_meta(pos)
if meta:get_string("channel") ~= channel then return end
local value = tonumber(msg)
if (not value) or value > 14 or value < 0 then return end
node.name = "digistuff:light_"..math.floor(value)
minetest.swap_node(pos,node)
end
},
},
})
end
minetest.register_node("digistuff:junctionbox", {
description = "Digilines Junction Box",
tiles = {"digistuff_junctionbox.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3},
is_ground_content = false,
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.15,0.35,0.1,0.15,0.5},
}
},
sounds = default and default.node_sound_stone_defaults(),
digiline = {
receptor = {},
wire = {
rules = {
{x = 1,y = 0,z = 0},
{x = -1,y = 0,z = 0},
{x = 0,y = 0,z = 1},
{x = 0,y = 0,z = -1},
{x = 0,y = 1,z = 0},
{x = 0,y = -1,z = 0},
{x = 0,y = -2,z = 0},
{x = 0,y = 2,z = 0},
{x = -2,y = 0,z = 0},
{x = 2,y = 0,z = 0},
{x = 0,y = 0,z = -2},
{x = 0,y = 0,z = 2},
}
},
},
})
minetest.register_craft({
output = "digistuff:light_0",
recipe = {
{"digilines:wire_std_00000000","mesecons_lamp:lamp_off",},
}
})
minetest.register_craft({
output = "digistuff:junctionbox",
recipe = {
{"homedecor:plastic_sheeting","digilines:wire_std_00000000","homedecor:plastic_sheeting",},
{"digilines:wire_std_00000000","digilines:wire_std_00000000","digilines:wire_std_00000000",},
{"homedecor:plastic_sheeting","digilines:wire_std_00000000","homedecor:plastic_sheeting",},
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

View File

@ -18,10 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- Version 2.00
-- Version 2.10
-- Changelog:
-- 30.07.2018 * Merged PR from adrido from 25.02.2016: Added new Locks config Formspec.
-- 30.07.2018 * Removed deprecated minetest.env usage.
-- 30.07.2018 * Front side of chest does not get pipeworks image anymore.
-- Instead it always shows the locks texture as overlay.
-- 30.07.2018 * Fixed bug with pipeworks.
-- * Repaired password.
-- * Converted back to unix file format.
@ -42,6 +45,108 @@ minetest.register_privilege("openlocks", { description = "allows to open/use all
minetest.register_privilege("diglocks", { description = "allows to open/use and dig up all locked objects", give_to_singleplayer = false});
locks.config_button = [[
image_button[%d,%d;1,1;locks_lock16.png;locks_config;Config
Locks]
tooltip[locks_config;Configure the players or set the password to grant access to other players.]
]]
function locks.get_config_button(x,y)
return locks.config_button:format((x or 0), (y or 0))
end
locks.authorize_button = [[
image_button[%d,%d;1,1;locks_key16.png;locks_authorize;Autho-
rize]
tooltip[locks_authorize;Opens a password prompt to grant you access to this object.]
]]
function locks.get_authorize_button(x,y)
return locks.authorize_button:format((x or 1), (y or 0))
end
locks.password_prompt = [[
size[6,3;]
pwdfield[0.5,1;5.5,0;password;Enter password:]
tooltip[password;Opens a password prompt to grant you access to this object.]
box[0.1,1.5;5.5,0.05;#FFFFFF]
button[1.5,2;3,1;proceed;Proceed]
]]
function locks.prompt_password(playername, formname)
local fs = locks.password_prompt;
minetest.show_formspec(playername, formname, fs);
end
function locks.access_denied(playername, formname, ask_for_pw)
local fs = [[
size[6,3;]
label[0.5,1;Access denied]
box[0.1,1.5;5.5,0.05;#FFFFFF]
button_exit[4,2;2,1;cancel;Cancel]
]];
if ask_for_pw == true then
fs = fs.."button[0,2;3.5,1;enter_password;Enter Password]";
end
minetest.show_formspec(playername, formname, fs);
end
locks.access_granted_formspec = [[
size[6,3;]
label[0.5,1;Access granted]
box[0.1,1.5;5.5,0.05;#FFFFFF]
button_exit[1.5,2;3,1;proceed;Proceed]
]]
function locks.access_granted(playername, formname)
minetest.show_formspec(playername, formname, locks.access_granted_formspec);
end
locks.config_formspec = [[
size[12,9;]
image[0,0;0.7,0.7;locks_lock32.png] label[0.7,0;Locks configuration panel]
box[0.1,0.6;11.5,0.05;#FFFFFF]
label[0.1,0.7;Owner: %q]
checkbox[0.1,1;pipeworks;Enable Pipeworks;%s]
tooltip[pipeworks;Tubes from pipeworks may be used to extract items out of/add items to this shared locked object.]
textarea[0.4,2;6.5,4;allowed_users;Allowed Players:;%s]
label[6.5,2;Insert the Playernames here,
that should have access to this Object.
One Player per line]
tooltip[allowed_users;Insert the Playernames here,
that should have access to this Object.
One Player per line]
field[0.4,6.5;4.5,0;password;Password:;%s] button[4.5,6.2;2,0;save_pw;Set PW]
tooltip[password;Every player with this password can access this object]
label[6.5,5.5;Specify a password here.
Every Player with this password can access this object.
Set an empty Password to remove the Password]
box[0.1,8.5;11.5,0.05;#FFFFFF]
button_exit[4,9;2,0;ok;OK] button_exit[6,9;2,0;cancel;Cancel]
]]
locks.uniform_background = "";
if default and default.gui_bg then
locks.uniform_background = locks.uniform_background..default.gui_bg;
end
if default and default.gui_bg_img then
locks.uniform_background = locks.uniform_background..default.gui_bg_img;
end
if default and default.gui_slots then
locks.uniform_background = locks.uniform_background..default.gui_slots;
end
locks.config_formspec = locks.config_formspec..locks.uniform_background
locks.pipeworks_enabled = false;
if( minetest.get_modpath("pipeworks") ~= nil ) then
@ -62,7 +167,7 @@ function locks:lock_init( pos, default_formspec )
return;
end
local meta = minetest.env:get_meta(pos);
local meta = minetest.get_meta(pos);
if( meta == nil ) then
print( "Error: [locks] lock_init: unable to get meta data");
return;
@ -79,7 +184,9 @@ function locks:lock_init( pos, default_formspec )
-- the last player who entered the right password (to save space this is not a list)
meta:set_string("pw_user","");
-- this formspec is presented on right-click for every user
meta:set_string("formspec", default_formspec);
meta:set_string("formspec", default_formspec..
locks.get_authorize_button(6,0)..
locks.get_config_button(7,0));
-- by default, do not send output to pipework tubes
meta:set_int( "allow_pipeworks", 0 );
end
@ -91,7 +198,7 @@ function locks:get_lockdata( pos )
return;
end
local meta = minetest.env:get_meta(pos);
local meta = minetest.get_meta(pos);
if( meta == nil) then
return;
end
@ -112,7 +219,7 @@ function locks:set_lockdata( pos, data )
return;
end
local meta = minetest.env:get_meta(pos);
local meta = minetest.get_meta(pos);
if( meta == nil) then
return;
end
@ -140,7 +247,7 @@ function locks:lock_set_owner( pos, player_or_name, description )
return false;
end
local meta = minetest.env:get_meta(pos);
local meta = minetest.get_meta(pos);
if( meta == nil ) then
print( "Error: [locks] lock_set_owner: unable to get meta data");
return;
@ -170,7 +277,7 @@ function locks:lock_allow_dig( pos, player )
return false;
end
local meta = minetest.env:get_meta(pos);
local meta = minetest.get_meta(pos);
local lock_owner = meta:get_string("owner");
-- locks who lost their owner can be opened/digged by anyone
@ -210,7 +317,7 @@ function locks:lock_allow_use( pos, player )
end
local name = player:get_player_name();
local meta = minetest.env:get_meta(pos);
local meta = minetest.get_meta(pos);
-- pipeworks sends a special username
if( player.is_fake_player) then
@ -302,12 +409,49 @@ function locks:lock_handle_input( pos, formname, fields, player )
return false;
end
local meta = minetest.env:get_meta(pos);
local meta = minetest.get_meta(pos);
if( meta == nil ) then
print( "Error: [locks] lock_handle_input: unable to get meta data");
return;
end
local name = player:get_player_name();
local owner = meta:get_string("owner");
--first check for locks_config_button
if fields.locks_config then
-- else the player could set a new pw and gain access anyway...
if( owner and owner ~= "" and owner ~= name ) then
minetest.chat_send_player(name, "Only the owner can change the configuration.");
return;
end
local allow_pipeworks = "false";
if meta:get_int( 'allow_pipeworks' ) == 1 then
allow_pipeworks = "true";
end
local data = locks:get_lockdata( pos );
local fs = locks.config_formspec:format(data.owner,
allow_pipeworks,
data.allowed_users:gsub(",","\n"),
meta:get_string("password"));
minetest.show_formspec(player:get_player_name(), "locks_config:"..minetest.pos_to_string(pos), fs);
return true; -- we could full handle the input. No need to continue. so we return true
elseif fields.locks_authorize then
local data = locks:get_lockdata( pos );
if name == data.owner then
minetest.chat_send_player(name, "You are the owner of this object. Its not required to enter a password.",false)
elseif minetest.string_to_privs(meta:get_string("allowed_users"))[name] then
minetest.chat_send_player(name, "You are already authorized in the whitelist. Its not required to enter a password.",false)
else
local fs = locks.password_prompt;
minetest.show_formspec(name, "locks_authorize:"..minetest.pos_to_string(pos), fs);
end
return true;
end
-- is this input the lock is supposed to handle?
if( ( not( fields.locks_sent_lock_command )
or fields.locks_sent_lock_command == "" )
@ -316,8 +460,6 @@ function locks:lock_handle_input( pos, formname, fields, player )
return;
end
name = player:get_player_name();
if( fields.locks_sent_lock_command == "/help" ) then
if( name == meta:get_string( "owner" )) then
@ -559,6 +701,51 @@ function locks:lock_handle_input( pos, formname, fields, player )
end
--this is required to handle the locks control panel
minetest.register_on_player_receive_fields(function(player, formname, fields)
local playername = player:get_player_name();
if formname:find("locks_config:") then -- search if formname contains locks
--minetest.chat_send_player(playername,dump(fields));
local pos = minetest.string_to_pos(formname:gsub("locks_config:",""))
if fields.ok then
local data = locks:get_lockdata( pos )
data.allowed_users = fields.allowed_users:gsub("\n",",");
--data.password = fields.password;
locks:set_lockdata( pos, data )
--print("Player "..player:get_player_name().." submitted fields "..dump(fields))
elseif fields.save_pw then
local data = locks:get_lockdata( pos )
data.password = fields.password;
locks:set_lockdata( pos, data );
elseif fields.pipeworks then
local meta = minetest.get_meta(pos);
if fields.pipeworks == "true" then
meta:set_int( 'allow_pipeworks', 1 );
else
meta:set_int( 'allow_pipeworks', 0 );
end
end
return true; --everything handled good :)
elseif formname:find("locks_authorize:") then
if fields.password and fields.password ~="" then
local pos = minetest.string_to_pos(formname:gsub("locks_authorize:",""))
local meta = minetest.get_meta(pos);
if meta:get_string("password")==fields.password then
locks.access_granted(playername, formname);
meta:set_string("pw_user", playername)
else
locks.access_denied(playername, formname, true);
end
elseif fields.enter_password then --if the user clicks the "Enter Password" button in the "access denied" formspec
locks.prompt_password(playername, formname);
end
return true --evrything is great :)
end
return false;
end)
-- craftitem; that can be used to craft shared locked objects
minetest.register_craftitem("locks:lock", {
@ -611,5 +798,3 @@ dofile(minetest.get_modpath("locks").."/shared_locked_chest.lua");
dofile(minetest.get_modpath("locks").."/shared_locked_sign_wall.lua");
dofile(minetest.get_modpath("locks").."/shared_locked_xdoors2.lua");
dofile(minetest.get_modpath("locks").."/shared_locked_furnace.lua");

View File

@ -1,9 +1,10 @@
-- 25.02.16 Added new Locks config Buttons.
-- 09.01.13 Added support for pipeworks.
locks.chest_add = {};
locks.chest_add.tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
"default_chest_side.png", "default_chest_side.png", "default_chest_front.png"};
"default_chest_side.png", "default_chest_side.png", "default_chest_front.png^locks_lock16.png"};
locks.chest_add.groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2};
locks.chest_add.tube = {};
@ -16,17 +17,17 @@ if( locks.pipeworks_enabled ) then
"default_chest_side.png^pipeworks_tube_connection_wooden.png",
"default_chest_side.png^pipeworks_tube_connection_wooden.png",
"default_chest_side.png^pipeworks_tube_connection_wooden.png",
"default_chest_front.png"};
"default_chest_front.png^locks_lock16.png"};
locks.chest_add.groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,
tubedevice = 1, tubedevice_receiver = 1 };
locks.chest_add.tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.env:get_meta(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("main", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.env:get_meta(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:room_for_item("main", stack)
end,
@ -45,20 +46,28 @@ minetest.register_node("locks:shared_locked_chest", {
legacy_facedir_simple = true,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local meta = minetest.get_meta(pos)
-- prepare the lock of the chest
locks:lock_init( pos,
"size[8,10]"..
-- "field[0.5,0.2;8,1.0;locks_sent_lock_command;Locked chest. Type password, command or /help for help:;]"..
-- "button_exit[3,0.8;2,1.0;locks_sent_input;Proceed]"..
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]"..
"field[0.3,9.6;6,0.7;locks_sent_lock_command;Locked chest. Type /help for help:;]"..
"background[-0.5,-0.65;9,11.2;bg_shared_locked_chest.jpg]"..
"button_exit[6.3,9.2;1.7,0.7;locks_sent_input;Proceed]" );
-- "size[8,9]"..
---- "field[0.5,0.2;8,1.0;locks_sent_lock_command;Locked chest. Type password, command or /help for help:;]"..
---- "button_exit[3,0.8;2,1.0;locks_sent_input;Proceed]"..
-- "list[current_name;main;0,0;8,4;]"..
-- "list[current_player;main;0,5;8,4;]");
-- "list[current_player;main;0,5;8,4;]"..
-- "field[0.3,9.6;6,0.7;locks_sent_lock_command;Locked chest. Type /help for help:;]"..
-- "background[-0.5,-0.65;9,11.2;bg_shared_locked_chest.jpg]"..
-- "button_exit[6.3,9.2;1.7,0.7;locks_sent_input;Proceed]" );
---- "size[8,9]"..
---- "list[current_name;main;0,0;8,4;]"..
---- "list[current_player;main;0,5;8,4;]");
locks.uniform_background ..
"list[current_name;main;0,1;8,4;]"..
"list[current_player;main;0,5.85;8,1;]" ..
"list[current_player;main;0,7.08;8,3;8]" ..
"listring[current_name;main]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0,5.85) );
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
end,
@ -78,7 +87,7 @@ minetest.register_node("locks:shared_locked_chest", {
if( not(locks:lock_allow_dig( pos, player ))) then
return false;
end
local meta = minetest.env:get_meta(pos);
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,

View File

@ -3,6 +3,7 @@
-- containing only the furnace and adopted slightly for my locks mod
-- 25.02.16 Added new Locks config Buttons.
-- 09.01.13 Added support for pipeworks.
@ -60,7 +61,7 @@ if( locks.pipeworks_enabled ) then
tubedevice = 1, tubedevice_receiver = 1 };
locks.furnace_add.tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.env:get_meta(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if direction.y == 1 then
return inv:add_item("fuel",stack)
@ -69,7 +70,7 @@ if( locks.pipeworks_enabled ) then
end
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.env:get_meta(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if direction.y == 1 then
return inv:room_for_item("fuel", stack)
@ -86,29 +87,29 @@ end
function locks.get_furnace_active_formspec(pos, percent)
local formspec =
"size[8,9]"..
"image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:"..
"image[2,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-percent)..":default_furnace_fire_fg.png]"..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;src;2,1;1,1;]"..
"list[current_name;fuel;2,2.5;1,1;]"..
"list[current_name;src;2,0.5;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
"list[current_player;main;0,5;8,4;]"..
"background[-0.5,-0.65;9,10.35;bg_shared_locked_furnace.jpg]"..
"field[0.3,4.5;6,0.7;locks_sent_lock_command;Locked furnace. Type /help for help:;]"..
"button_exit[6.3,4;1.7,0.7;locks_sent_input;Proceed]" ;
locks.uniform_background..
locks.get_authorize_button(6,0)..
locks.get_config_button(7,0)
return formspec
end
locks.furnace_inactive_formspec =
"size[8,9]"..
"image[2,2;1,1;default_furnace_fire_bg.png]"..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;src;2,1;1,1;]"..
"image[2,1.5;1,1;default_furnace_fire_bg.png]"..
"list[current_name;fuel;2,2.5;1,1;]"..
"list[current_name;src;2,0.5;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
"list[current_player;main;0,5;8,4;]"..
"background[-0.5,-0.65;9,10.35;bg_shared_locked_furnace.jpg]"..
"field[0.3,4.5;6,0.7;locks_sent_lock_command;Locked furnace. Type /help for help:;]"..
"button_exit[6.3,4;1.7,0.7;locks_sent_input;Proceed]" ;
locks.uniform_background..
locks.get_authorize_button(6,0)..
locks.get_config_button(7,0)
minetest.register_node("locks:shared_locked_furnace", {
description = "Shared locked furnace",

View File

@ -1,4 +1,5 @@
-- 25.02.16 Added new Locks config Buttons.
-- allow aborting with ESC in newer Versions of MT again
-- a sign
@ -23,14 +24,15 @@ minetest.register_node("locks:shared_locked_sign_wall", {
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local meta = minetest.get_meta(pos)
-- prepare the lock of the sign
locks:lock_init( pos,
"size[8,4]"..
"field[0.3,0.6;6,0.7;text;Text:;${text}]"..
"field[0.3,3.6;6,0.7;locks_sent_lock_command;Locked sign. Type /help for help:;]"..
"button_exit[6.3,3.2;1.7,0.7;locks_sent_input;Proceed]");
-- "field[0.3,3.6;6,0.7;locks_sent_lock_command;Locked sign. Type /help for help:;]"..
-- "background[-0.5,-0.5;9,5;bg_shared_locked_sign.jpg]" );
"button_exit[6.3,3.2;1.7,0.7;locks_sent_input;Proceed]"..
locks.uniform_background );
end,
after_place_node = function(pos, placer)
@ -44,24 +46,23 @@ minetest.register_node("locks:shared_locked_sign_wall", {
on_receive_fields = function(pos, formname, fields, sender)
-- if the user already has the right to use this and did input text
if( fields.text
and ( not(fields.locks_sent_lock_command)
or fields.locks_sent_lock_command=="")
-- if locks can not handle the input
if not locks:lock_handle_input( pos, formname, fields, sender ) then
--then handle compatibility stuff or insert text
if( fields.text
and ( not(fields.locks_sent_lock_command) --compatibility
or fields.locks_sent_lock_command=="") --compatibility
and locks:lock_allow_use( pos, sender )) then
--print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
local meta = minetest.env:get_meta(pos)
local meta = minetest.get_meta(pos)
fields.text = fields.text or "";
print((sender:get_player_name() or "").." wrote \""..fields.text..
"\" to sign at "..minetest.pos_to_string(pos));
meta:set_string("text", fields.text);
meta:set_string("infotext", '"'..fields.text..'"'.." ["..sender:get_player_name().."]");
-- a command for the lock?
else
locks:lock_handle_input( pos, formname, fields, sender );
end
end
end
end,
});

View File

@ -1,7 +1,8 @@
-- xDoors² mod by xyz
-- xDoors² mod by xyz
-- modified by Sokomine to allow locked doors that can only be opened/closed/dig up by the player who placed them
-- a little bit modified by addi to allow someone with the priv "opendoors" to open/close/dig all locked doors.
-- Sokomine: modified again so that it uses the new locks-mod
-- 25.02.16 Added new Locks config Buttons.
local door_bottom = {-0.5, -0.5, -0.5, 0.5, 0.5, -0.4}
local door_top = {
@ -33,13 +34,15 @@ local xdoors2_transform = function(pos, node, puncher)
local p2 = 0
if t == 2 then
p2 = (node.param2 + 1) % 4
minetest.sound_play("doors_door_open", { pos = pos, gain = 0.3, max_hear_distance = 10})
else
p2 = (node.param2 + 3) % 4
minetest.sound_play("doors_door_close", { pos = pos, gain = 0.3, max_hear_distance = 10})
end
local olddata = locks:get_lockdata( pos );
minetest.env:add_node(pos, {name = "locks:door_bottom_"..t, param2 = p2})
minetest.env:add_node({x = pos.x, y = pos.y + 1, z = pos.z}, {name = "locks:door_top_"..t, param2 = p2})
minetest.add_node(pos, {name = "locks:door_bottom_"..t, param2 = p2})
minetest.add_node({x = pos.x, y = pos.y + 1, z = pos.z}, {name = "locks:door_top_"..t, param2 = p2})
-- remember who owns the door, what passwords are set etc.
locks:set_lockdata( pos, olddata );
@ -51,8 +54,8 @@ local xdoors2_destruct = function(pos, oldnode)
if is_top(oldnode.name) then
pos = {x = pos.x, y = pos.y - 1, z = pos.z}
end
minetest.env:remove_node(pos)
minetest.env:remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
minetest.remove_node(pos)
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
end
for i = 1, 2 do
@ -77,8 +80,8 @@ for i = 1, 2 do
on_construct = function(pos)
locks:lock_init( pos,
"size[8,2]"..
"field[0.3,0.6;6,0.7;locks_sent_lock_command;Locked door. Type /help for help:;]"..
"button_exit[6.3,1.2;1.7,0.7;locks_sent_input;Proceed]" );
locks.uniform_background..
"button_exit[6.3,1.2;1.7,1;locks_sent_input;Proceed]" );
end,
on_receive_fields = function(pos, formname, fields, sender)
@ -110,8 +113,8 @@ for i = 1, 2 do
on_construct = function(pos)
locks:lock_init( pos,
"size[8,2]"..
"field[0.3,0.6;6,0.7;locks_sent_lock_command;Locked door. Type /help for help:;]"..
"button_exit[6.3,0.2;1.7,0.7;locks_sent_input;Proceed]" );
locks.uniform_background..
"button_exit[6.3,1.2;1.7,1;locks_sent_input;Proceed]" );
end,
on_receive_fields = function(pos, formname, fields, sender)
@ -137,40 +140,47 @@ minetest.register_node("locks:door", {
inventory_image = 'locks_xdoors2_door.png',
wield_image = 'xdoors2_door.png',
stack_max = 1,
sunlight_propogates = true,
on_place = function(itemstack, placer, pointed_thing)
local above = pointed_thing.above
-- there should be 2 empty nodes
if minetest.env:get_node({x = above.x, y = above.y + 1, z = above.z}).name ~= "air" then
return itemstack
end
local above1 = {x = above.x, y = above.y + 1, z = above.z};
if (minetest.is_protected(above, placer:get_player_name())
or minetest.is_protected(above1, placer:get_player_name())) then
minetest.chat_send_player(placer:get_player_name(), "This area is protected!")
return itemstack
else
-- there should be 2 empty nodes
if minetest.get_node(above1).name ~= "air" then
return itemstack
end
local fdir = 0
local placer_pos = placer:getpos()
if placer_pos then
dir = {
x = above.x - placer_pos.x,
y = above.y - placer_pos.y,
z = above.z - placer_pos.z
}
fdir = minetest.dir_to_facedir(dir)
end
local fdir = 0
local placer_pos = placer:getpos()
if placer_pos then
dir = {
x = above.x - placer_pos.x,
y = above.y - placer_pos.y,
z = above.z - placer_pos.z
}
fdir = minetest.dir_to_facedir(dir)
end
local t = 1
local another_door = minetest.env:get_node({x = above.x + delta[fdir + 1].x, y = above.y, z = above.z + delta[fdir + 1].z})
if (another_door.name:sub(-1) == "1" and another_door.param2 == fdir)
or (another_door.name:sub(-1) == "2" and another_door.param2 == (fdir + 1) % 4) then
t = 2
end
local t = 1
local another_door = minetest.get_node({x = above.x + delta[fdir + 1].x, y = above.y, z = above.z + delta[fdir + 1].z})
if (another_door.name:sub(-1) == "1" and another_door.param2 == fdir)
or (another_door.name:sub(-1) == "2" and another_door.param2 == (fdir + 1) % 4) then
t = 2
end
minetest.env:add_node(above, {name = "locks:door_bottom_"..t, param2 = fdir})
minetest.env:add_node({x = above.x, y = above.y + 1, z = above.z}, {name = "locks:door_top_"..t, param2 = fdir})
minetest.add_node(above, {name = "locks:door_bottom_"..t, param2 = fdir})
minetest.add_node({x = above.x, y = above.y + 1, z = above.z}, {name = "locks:door_top_"..t, param2 = fdir})
-- store who owns the door; the other data can be default for now
locks:lock_set_owner( above, placer:get_player_name() or "", "Shared locked door");
locks:lock_set_owner( {x = above.x, y = above.y + 1, z = above.z}, placer:get_player_name() or "", "Shared locked door");
-- store who owns the door; the other data can be default for now
locks:lock_set_owner( above, placer:get_player_name() or "", "Shared locked door");
locks:lock_set_owner( {x = above.x, y = above.y + 1, z = above.z}, placer:get_player_name() or "", "Shared locked door");
return ItemStack("")
return ItemStack("")
end
end
})

View File

@ -2,13 +2,14 @@ local screwdriver_exists = minetest.global_exists("screwdriver")
local corner_nodebox = {
type = "fixed",
-- ±0.001 is to prevent z-fighting
fixed = {{ -16/32-0.001, -17/32, -3/32, 0, -13/32, 3/32 },
{ -3/32, -17/32, -16/32+0.001, 3/32, -13/32, 3/32}}
}
local corner_selectionbox = {
type = "fixed",
fixed = { -16/32-0.001, -18/32, -16/32, 5/32, -12/32, 5/32 },
fixed = { -16/32, -16/32, -16/32, 5/32, -12/32, 5/32 },
}
local corner_get_rules = function (node)

View File

@ -32,7 +32,7 @@ minetest.register_node("mesecons_extrawires:crossover_off", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3},
sounds = default.node_sound_defaults(),
mesecons = {
@ -59,7 +59,7 @@ minetest.register_node("mesecons_extrawires:crossover_01", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
mesecons = {
@ -86,7 +86,7 @@ minetest.register_node("mesecons_extrawires:crossover_10", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
mesecons = {
@ -113,7 +113,7 @@ minetest.register_node("mesecons_extrawires:crossover_on", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
mesecons = {

View File

@ -2,13 +2,14 @@ local screwdriver_exists = minetest.global_exists("screwdriver")
local tjunction_nodebox = {
type = "fixed",
-- ±0.001 is to prevent z-fighting
fixed = {{ -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 },
{ -3/32, -17/32, -16/32+0.001, 3/32, -13/32, -3/32},}
}
local tjunction_selectionbox = {
type = "fixed",
fixed = { -16/32-0.001, -18/32, -16/32, 16/32+0.001, -12/32, 7/32 },
fixed = { -16/32, -16/32, -16/32, 16/32, -12/32, 7/32 },
}
local tjunction_get_rules = function (node)

View File

@ -27,10 +27,11 @@ minetest.register_node("mesecons_insulated:insulated_on", {
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = { -16/32-0.001, -18/32, -7/32, 16/32+0.001, -12/32, 7/32 }
fixed = { -16/32, -16/32, -7/32, 16/32, -12/32, 7/32 }
},
node_box = {
type = "fixed",
-- ±0.001 is to prevent z-fighting
fixed = { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 }
},
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
@ -63,10 +64,11 @@ minetest.register_node("mesecons_insulated:insulated_off", {
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = { -16/32-0.001, -18/32, -7/32, 16/32+0.001, -12/32, 7/32 }
fixed = { -16/32, -16/32, -7/32, 16/32, -12/32, 7/32 }
},
node_box = {
type = "fixed",
-- ±0.001 is to prevent z-fighting
fixed = { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 }
},
groups = {dig_immediate = 3},

View File

@ -45,7 +45,7 @@ local soundnames = {
local node_sounds = {
["default:glass"] = "mesecons_noteblock_hihat",
["default:stone"] = "mesecons_noteblock_kick",
["default:lava_source"] = "fire_large",
["default:lava_source"] = "fire_fire",
["default:chest"] = "mesecons_noteblock_snare",
["default:tree"] = "mesecons_noteblock_crash",
["default:wood"] = "mesecons_noteblock_litecrash",

View File

@ -1,7 +1,7 @@
This mod uses nodeboxes to supply a complete set of 3D pipes and tubes,
along devices that work with them.
See https://github.com/VanessaE/pipeworks/wiki/ for detailed information about usage of this mod.
See https://gitlab.com/VanessaE/pipeworks/wikis/ for detailed information about usage of this mod.
Unlike the previous version of this mod, these pipes are rounded, and when
placed, they'll automatically join together as needed. Pipes can go vertically

View File

@ -350,8 +350,10 @@ luaentity.register_entity("pipeworks:tubed_item", {
-- compatible with Minetest 0.4.13.
-- Using item_drop here makes Minetest 0.4.13 crash.
local dropped_item = minetest.add_item(self.start_pos, stack)
dropped_item:set_velocity(vector.multiply(velocity, 5))
self:remove()
if dropped_item then
dropped_item:set_velocity(vector.multiply(velocity, 5))
self:remove()
end
return
else
velocity = vector.multiply(velocity, -1)

View File

@ -331,12 +331,25 @@ if pipeworks.enable_node_breaker then
virtplayer:set_wielded_item(wieldstack)
else
local under_node = minetest.get_node(pointed_thing.under)
local on_dig = (minetest.registered_nodes[under_node.name] or {on_dig=minetest.node_dig}).on_dig
-- check that the current tool is capable of destroying the target node.
local def = minetest.registered_nodes[under_node.name]
if not def then
-- do not dig an unknown node
return
end
-- check that the current tool is capable of destroying the
-- target node.
-- if we can't, don't dig, and leave the wield stack unchanged.
-- note that wieldstack:get_tool_capabilities() returns hand properties if the item has none of it's own.
if can_tool_dig_node(under_node.name, wieldstack:get_tool_capabilities(), wieldstack:get_name()) then
on_dig(pointed_thing.under, under_node, virtplayer)
-- note that wieldstack:get_tool_capabilities() returns hand
-- properties if the item has none of it's own.
if can_tool_dig_node(under_node.name,
wieldstack:get_tool_capabilities(),
wieldstack:get_name()) then
def.on_dig(pointed_thing.under, under_node, virtplayer)
local sound = def.sounds and def.sounds.dug
if sound then
minetest.sound_play(sound.name,
{pos=pointed_thing.under, gain=sound.gain})
end
wieldstack = virtplayer:get_wielded_item()
else
--pipeworks.logger(dname.."couldn't dig node!")

View File

@ -1,4 +1,19 @@
License
=======
- Code WTFPL
- Texture CC
## 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.

View File

@ -3,16 +3,53 @@ 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,4 +3,6 @@ farming?
vines?
doc?
intllib?
loot?
loot?
hemp?
cottages?

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.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")
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")
dofile( minetest.get_modpath( ropes.name ) .. "/doc.lua" )
dofile( minetest.get_modpath( ropes.name ) .. "/functions.lua" )

View File

@ -46,6 +46,17 @@ 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,6 +134,17 @@ 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}
@ -225,9 +236,8 @@ 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 = "ropes_creak",
footstep = {name = "ropes_creak", gain = 0.8, max_hear_distance = 6},
dig = "__group",
dug = "__group",
},
@ -262,7 +272,7 @@ local rope_bottom_def = {
drawtype = "nodebox",
groups = {choppy=2, flammable=2, not_in_creative_inventory=1},
sounds = {
footstep = "ropes_creak",
footstep = {name = "ropes_creak", gain = 0.8, max_hear_distance = 6},
dig = "__group",
dug = "__group",
},

View File

@ -102,8 +102,8 @@ minetest.register_node("steel:plate_rusted", {
local base_tex = "strut.png"
local streetsmod = minetest.get_modpath("streets") or minetest.get_modpath ("steelsupport")
-- cheapie's fork breaks it into several individual mods, with differernt names for the same content.
local streetsmod = minetest.get_modpath("streets") or minetest.get_modpath("steelsupport")
-- cheapie's fork breaks it into several individual mods, with different names for the same content.
if streetsmod then
minetest.register_alias("steel:strut","streets:steel_support")

View File

@ -155,6 +155,11 @@ local default_dyes = {
unifieddyes.player_current_dye = {}
unifieddyes.player_selected_dye = {}
unifieddyes.player_last_right_clicked = {}
unifieddyes.palette_has_color = {}
unifieddyes.player_showall = {}
-- unifieddyes.player_last_right_clicked[placer:get_player_name()] = {pos = pos, node = node, def = def}
-- if a node with a palette is placed in the world,
-- but the itemstack used to place it has no palette_index (color byte),
@ -179,7 +184,7 @@ minetest.register_on_placenode(
color = 240
elseif def.palette == "unifieddyes_palette_colorwallmounted.png" then
param2 = newnode.param2 % 8
elseif def.palette ~= "unifieddyes_palette.png" then -- it's a split palette
else -- it's a split palette
param2 = newnode.param2 % 32
end
@ -207,14 +212,6 @@ function unifieddyes.make_colored_itemstack(item, palette, color)
return stack:to_string(),paletteidx
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.
@ -238,7 +235,7 @@ local function register_c(craft, hue, sat, val)
local output = craft.output
if craft.output_prefix then
if craft.palette ~= true then
if craft.palette ~= "split" then
output = craft.output_prefix..color..craft.output_suffix
else
if hue == "white" or hue == "black" or string.find(hue, "grey") then
@ -271,7 +268,7 @@ function unifieddyes.register_color_craft(craft)
if craft.palette == "wallmounted" then
register_c(craft, "green", "", "light_")
register_c(craft, "azure", "", "")
register_c(craft, "blue", "", "light_")
hues_table = unifieddyes.HUES_WALLMOUNTED
sats_table = {""}
vals_table = unifieddyes.VALS
@ -394,8 +391,7 @@ end
-- in the function below, color is just a color string, while
-- palette_type can be:
--
-- false/nil = standard 89 color palette
-- true = 89 color palette split into pieces for colorfacedir
-- "split" = 89 color palette split into pieces for colorfacedir
-- "wallmounted" = 32-color abridged palette
-- "extended" = 256 color palette
@ -546,7 +542,7 @@ function unifieddyes.getpaletteidx(color, palette_type)
if grayscale_wallmounted[color] then
return (grayscale_wallmounted[color] * 8), 0
end
elseif palette_type == true then
elseif palette_type == "split" then
if grayscale[color] then
return (grayscale[color] * 32), 0
end
@ -554,10 +550,6 @@ function unifieddyes.getpaletteidx(color, palette_type)
if grayscale_extended[color] then
return grayscale_extended[color]+240, 0
end
else
if grayscale[color] then
return grayscale[color], 0
end
end
local shade = "" -- assume full
@ -589,7 +581,7 @@ function unifieddyes.getpaletteidx(color, palette_type)
if color == "green" and shade == "light" then return 48,3
elseif color == "brown" then return 17,1
elseif color == "pink" then return 56,7
elseif color == "azure" then return 40,5
elseif color == "blue" and shade == "light" then return 40,5
elseif hues_wallmounted[color] and shades_wallmounted[shade] then
return (shades_wallmounted[shade] * 64 + hues_wallmounted[color] * 8), hues_wallmounted[color]
end
@ -601,7 +593,7 @@ function unifieddyes.getpaletteidx(color, palette_type)
color = "red"
shade = "light"
end
if palette_type == true then -- it's colorfacedir, so "split" 89-color palette
if palette_type == "split" then -- it's colorfacedir
-- If using this palette, translate new color names back to old.
@ -620,17 +612,6 @@ function unifieddyes.getpaletteidx(color, palette_type)
if hues_extended[color] and shades_extended[shade] then
return (hues_extended[color] + shades_extended[shade]*24), hues_extended[color]
end
else -- it's the regular 89-color palette, do the same translation if needed
if color == "spring" then
color = "aqua"
elseif color == "azure" then
color = "skyblue"
elseif color == "rose" then
color = "redviolet"
end
if hues[color] and shades[shade] then
return (hues[color] * 8 + shades[shade]), hues[color]
end
end
end
end
@ -677,8 +658,8 @@ function unifieddyes.on_airbrush(itemstack, player, pointed_thing)
elseif def.palette == "unifieddyes_palette_colorwallmounted.png" then
palette = "wallmounted"
fdir = node.param2 % 8
elseif def.palette ~= "unifieddyes_palette.png" then
palette = true
else
palette = "split"
fdir = node.param2 % 32
end
@ -701,7 +682,7 @@ function unifieddyes.on_airbrush(itemstack, player, pointed_thing)
local oldidx = node.param2 - fdir
local name = def.airbrush_replacement_node or node.name
if palette == true then
if palette == "split" then
local modname = string.sub(name, 1, string.find(name, ":")-1)
local nodename2 = string.sub(name, string.find(name, ":")+1)
local oldcolor = "snozzberry"
@ -776,28 +757,6 @@ function unifieddyes.color_to_name(param2, def)
return unifieddyes.VALS_EXTENDED[v]..unifieddyes.HUES_EXTENDED[h+1][1]..unifieddyes.SATS[s]
end
elseif def.palette == "unifieddyes_palette.png" then
local color = param2
local h = math.floor(color/8)
local s = 1
local val = ""
if color == 1 or color == h or color > 103 or color == 6 or color == 7 then return "white"
elseif color == 2 then return "light_grey"
elseif color == 3 then return "grey"
elseif color == 4 then return "dark_grey"
elseif color == 5 then return "black"
end
local c = color - h*8
if c == 2 then s = 2
elseif c == 3 then val = "light_"
elseif c == 4 then val = "medium_"
elseif c == 5 then val = "medium_" s = 2
elseif c == 6 then val = "dark_"
else val = "dark_" s = 2
end
return val..unifieddyes.HUES[h+1]..unifieddyes.SATS[s]
elseif def.palette == "unifieddyes_palette_colorwallmounted.png" then
local color = math.floor(param2 / 8)
if color == 0 then return "white"
@ -838,20 +797,79 @@ function unifieddyes.color_to_name(param2, def)
end
end
local hps = 0.6 -- horizontal position scale
local vps = 1.3 -- vertical position scale
local vs = 0.3 -- vertical shift/offset
local color_button_size = ";0.75,0.75;"
function unifieddyes.make_colored_square(hexcolor, colorname, showall, creative, painting_with, nodepalette, hp, v2, selindic, inv)
local dye = "dye:"..colorname
local overlay = ""
local colorize = minetest.formspec_escape("^[colorize:#"..hexcolor..":255")
if not creative and inv:contains_item("main", dye) then
overlay = "^unifieddyes_onhand_overlay.png"
end
local unavail_overlay = ""
if not showall and not unifieddyes.palette_has_color[nodepalette.."_"..colorname] then
if overlay == "" then
unavail_overlay = "^unifieddyes_unavailable_overlay.png"
else
unavail_overlay = "^unifieddyes_onhand_unavailable_overlay.png"
end
end
if dye == painting_with then
overlay = "^unifieddyes_select_overlay.png"
selindic = "unifieddyes_white_square.png"..colorize..overlay..unavail_overlay.."]"..
"tooltip["..colorname..";"..colorname.."]"
end
local form = "image_button["..
(hp*hps)..","..(v2*vps+vs)..
color_button_size..
"unifieddyes_white_square.png"..colorize..overlay..unavail_overlay..";"..
colorname..";]"..
"tooltip["..colorname..";"..colorname.."]"
return form, selindic
end
function unifieddyes.show_airbrush_form(player)
if not player then return end
local t = {}
local player_name = player:get_player_name()
local painting_with = unifieddyes.player_selected_dye[player_name] or unifieddyes.player_current_dye[player_name]
local creative = creative and creative.is_enabled_for(player_name)
local inv = player:get_inventory()
local nodepalette = "extended"
local showall = unifieddyes.player_showall[player_name]
local base_form = "size[15,8.5]label[7,-0.25;Select a color:]"
t[1] = "size[15,8.5]label[7,-0.25;Select a color:]"
local selindic = "unifieddyes_select_overlay.png^unifieddyes_question.png]"
local size="0.75,0.75;"
local hps=0.6
local vps=1.3
local vs=0.3
local last_right_click = unifieddyes.player_last_right_clicked[player_name]
if last_right_click then
if last_right_click.def and last_right_click.def.palette then
if last_right_click.def.palette == "unifieddyes_palette_colorwallmounted.png" then
nodepalette = "wallmounted"
elseif last_right_click.def.palette == "unifieddyes_palette_extended.png" then
t[#t+1] = "label[0.5,8.25;(Right-clicked a node that supports all 256 colors, showing them all)]"
showall = true
elseif last_right_click.def.palette ~= "unifieddyes_palette_extended.png" then
nodepalette = "split"
elseif not string.find(last_right_click.def.palette, "unifieddyes_palette_") then
t[#t+1] = "label[0.5,8.25;(Right-clicked a node not supported by the Airbrush, showing all colors)]"
end
else
t[#t+1] = "label[0.5,8.25;(Right-clicked a non-colorable node, showing all colors)]"
end
end
for v = 0, 6 do
local val = unifieddyes.VALS_EXTENDED[v+1]
@ -877,29 +895,10 @@ function unifieddyes.show_airbrush_form(player)
local g2 = math.max(math.min(g + (4-v)*factor, 255), 0)
local b2 = math.max(math.min(b + (4-v)*factor, 255), 0)
local color = string.format("%02x", r2)..string.format("%02x", g2)..string.format("%02x", b2)
local dye = "dye:"..val..hue..sat
local overlay = ""
local colorize = minetest.formspec_escape("^[colorize:#"..color..":255")
if not creative and inv:contains_item("main", dye) then
overlay = "^unifieddyes_available_overlay.png"
end
if dye == painting_with then
overlay = "^unifieddyes_select_overlay.png"
selindic = "unifieddyes_white_square.png"..colorize..overlay.."]"..
"tooltip["..val..hue..sat..";"..val..hue..sat.."]"
end
base_form = base_form.."image_button["..
(hp*hps)..","..(v2*vps+vs)..";"..
size..
"unifieddyes_white_square.png"..colorize..overlay..";"..
val..hue..sat..";]"..
"tooltip["..val..hue..sat..";"..val..hue..sat.."]"
local hexcolor = string.format("%02x", r2)..string.format("%02x", g2)..string.format("%02x", b2)
local f
f, selindic = unifieddyes.make_colored_square(hexcolor, val..hue..sat, showall, creative, painting_with, nodepalette, hp, v2, selindic, inv)
t[#t+1] = f
end
if v > 3 then
@ -929,28 +928,10 @@ function unifieddyes.show_airbrush_form(player)
local g3 = math.floor(p+(g2-p)*0.5)
local b3 = math.floor(p+(b2-p)*0.5)
local color = string.format("%02x", r3)..string.format("%02x", g3)..string.format("%02x", b3)
local dye = "dye:"..val..hue..sat
local overlay = ""
local colorize = minetest.formspec_escape("^[colorize:#"..color..":255")
if not creative and inv:contains_item("main", dye) then
overlay = "^unifieddyes_available_overlay.png"
end
if dye == painting_with then
overlay = "^unifieddyes_select_overlay.png"
selindic = "unifieddyes_white_square.png"..colorize..overlay.."]"..
"tooltip["..val..hue..sat..";"..val..hue..sat.."]"
end
base_form = base_form.."image_button["..
(hp*hps)..","..(v2*vps+vs)..";"..
size..
"unifieddyes_white_square.png"..colorize..overlay..";"..
val..hue..sat..";]"..
"tooltip["..val..hue..sat..";"..val..hue..sat.."]"
local hexcolor = string.format("%02x", r3)..string.format("%02x", g3)..string.format("%02x", b3)
local f
f, selindic = unifieddyes.make_colored_square(hexcolor, val..hue..sat, showall, creative, painting_with, nodepalette, hp, v2, selindic, inv)
t[#t+1] = f
end
end
end
@ -960,61 +941,69 @@ function unifieddyes.show_airbrush_form(player)
local hp=(15-y)+0.5
local grey = string.format("%02x", y*17)..string.format("%02x", y*17)..string.format("%02x", y*17)
local grey2 = "grey_"..y
local hexgrey = string.format("%02x", y*17)..string.format("%02x", y*17)..string.format("%02x", y*17)
local grey = "grey_"..y
if y == 0 then grey2 = "black"
elseif y == 4 then grey2 = "dark_grey"
elseif y == 8 then grey2 = "grey"
elseif y == 11 then grey2 = "light_grey"
elseif y == 15 then grey2 = "white"
if y == 0 then grey = "black"
elseif y == 4 then grey = "dark_grey"
elseif y == 8 then grey = "grey"
elseif y == 11 then grey = "light_grey"
elseif y == 15 then grey = "white"
end
local dye = "dye:"..grey2
local overlay = ""
local colorize = minetest.formspec_escape("^[colorize:#"..grey..":255")
if not creative and inv:contains_item("main", dye) then
overlay = "^unifieddyes_available_overlay.png"
end
if dye == painting_with then
overlay = "^unifieddyes_select_overlay.png"
selindic = "unifieddyes_white_square.png"..colorize..overlay.."]"..
"tooltip["..grey2..";"..grey2.."]"
end
base_form = base_form.."image_button["..
(hp*hps)..","..(v2*vps+vs)..";"..
size..
"unifieddyes_white_square.png"..colorize..overlay..";"..
grey2..";]tooltip["..grey2..";"..grey2.."]"
local f
f, selindic = unifieddyes.make_colored_square(hexgrey, grey, showall, creative, painting_with, nodepalette, hp, v2, selindic, inv)
t[#t+1] = f
end
if not creative then
base_form = base_form..
"image[10.3,"..(vps*5+vs)..";"..size..
"unifieddyes_available_overlay.png]"..
"label[11.0,"..(vps*5.1+vs)..";Dyes on hand]"
end
base_form = base_form..
"image[12.5,"..(vps*5+vs)..";"..size..
selindic..
"label[13.2,"..(vps*5.1+vs)..";Your selection]"
t[#t+1] = "image[10.3,"
t[#t+1] = (vps*5+vs)
t[#t+1] = color_button_size
t[#t+1] = "unifieddyes_onhand_overlay.png]label[11.0,"
t[#t+1] = (vps*5.02+vs)
t[#t+1] = ";Dyes]"
t[#t+1] = "label[11.0,"
t[#t+1] = (vps*5.18+vs)
t[#t+1] = ";on hand]"
base_form = base_form..
"button_exit[11,8;2,1;cancel;Cancel]"..
"button_exit[13,8;2,1;accept;Accept]"
end
t[#t+1] = "image[11.9,"
t[#t+1] = (vps*5+vs)
t[#t+1] = color_button_size
t[#t+1] = selindic
if painting_with then
base_form = base_form..
"label[1,"..(7.5+vs)..";Selected dye: "..
painting_with.."]"
t[#t+1] = "label[12.6,"
t[#t+1] = (vps*5.02+vs)
t[#t+1] = ";Your selection:]"
t[#t+1] = "label[12.6,"
t[#t+1] = (vps*5.18+vs)
t[#t+1] = ";"
t[#t+1] = painting_with
t[#t+1] = "]"
else
t[#t+1] = "label[12.6,"
t[#t+1] = (vps*5.1+vs)
t[#t+1] = ";Your selection]"
end
minetest.show_formspec(player_name, "unifieddyes:dye_select_form", base_form)
t[#t+1] = "button_exit[11,8;2,1;cancel;Cancel]button_exit[13,8;2,1;accept;Accept]"
if last_right_click and last_right_click.def and last_right_click.def.palette and nodepalette ~= "extended" then
if showall then
t[#t+1] = "button[0.5,8;2,1;show_avail;Show Available]"
t[#t+1] = "label[2.5,8.25;(Currently showing all 256 colors)]"
else
t[#t+1] = "button[0.5,8;2,1;show_all;Show All Colors]"
t[#t+1] = "label[2.5,8.25;(Currently only showing what the right-clicked node can use)]"
end
end
minetest.show_formspec(player_name, "unifieddyes:dye_select_form", table.concat(t))
end
minetest.register_tool("unifieddyes:airbrush", {
@ -1028,15 +1017,21 @@ minetest.register_tool("unifieddyes:airbrush", {
on_use = unifieddyes.on_airbrush,
on_place = function(itemstack, placer, pointed_thing)
local keys = placer:get_player_control()
local player_name = placer:get_player_name()
local pos = minetest.get_pointed_thing_position(pointed_thing)
local node
local def
if pos then node = minetest.get_node(pos) end
if node then def = minetest.registered_items[node.name] end
unifieddyes.player_last_right_clicked[player_name] = {pos = pos, node = node, def = def}
if not keys.sneak then
unifieddyes.show_airbrush_form(placer)
elseif keys.sneak then
local player_name = placer:get_player_name()
local pos = minetest.get_pointed_thing_position(pointed_thing)
if not pos then return end
local node = minetest.get_node(pos)
local def = minetest.registered_items[node.name]
if not def then return end
if not pos or not def then return end
local newcolor = unifieddyes.color_to_name(node.param2, def)
if not newcolor then
@ -1059,21 +1054,56 @@ minetest.register_craft( {
})
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname == "unifieddyes:dye_select_form" then
local player_name = player:get_player_name()
if fields.quit then
if not fields.accept then
unifieddyes.player_selected_dye[player_name] = nil
return
else
local nodepalette = "extended"
local showall = unifieddyes.player_showall[player_name]
local last_right_click = unifieddyes.player_last_right_clicked[player_name]
if last_right_click and last_right_click.def then
if last_right_click.def.palette then
if last_right_click.def.palette == "unifieddyes_palette_colorwallmounted.png" then
nodepalette = "wallmounted"
elseif last_right_click.def.palette ~= "unifieddyes_palette_extended.png" then
nodepalette = "split"
end
end
end
if fields.show_all then
unifieddyes.player_showall[player_name] = true
unifieddyes.show_airbrush_form(player)
return
elseif fields.show_avail then
unifieddyes.player_showall[player_name] = false
unifieddyes.show_airbrush_form(player)
return
elseif fields.quit then
if fields.accept then
local dye = unifieddyes.player_selected_dye[player_name]
if not dye then
minetest.chat_send_player(player_name, "*** Clicked \"Accept\", but no color was selected!")
return
end
unifieddyes.player_current_dye[player_name] = dye
unifieddyes.player_selected_dye[player_name] = nil
elseif not showall
and not unifieddyes.palette_has_color[nodepalette.."_"..string.sub(dye, 5)] then
minetest.chat_send_player(player_name, "*** Clicked \"Accept\", but the selected color can't be used on the")
minetest.chat_send_player(player_name, "*** node that was right-clicked (and \"Show All\" wasn't in effect).")
if unifieddyes.player_current_dye[player_name] then
minetest.chat_send_player(player_name, "*** Ignoring it and sticking with "..string.sub(unifieddyes.player_current_dye[player_name], 5)..".")
else
minetest.chat_send_player(player_name, "*** Ignoring it.")
end
return
else
unifieddyes.player_current_dye[player_name] = dye
unifieddyes.player_selected_dye[player_name] = nil
minetest.chat_send_player(player_name, "*** Selected "..string.sub(dye, 5).." for the airbrush.")
return
end
else -- assume "Cancel" or Esc.
unifieddyes.player_selected_dye[player_name] = nil
return
end
else
@ -1083,7 +1113,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local inv = player:get_inventory()
local creative = creative and creative.is_enabled_for(player_name)
local dye = "dye:"..s3
if minetest.registered_items[dye] and (creative or inv:contains_item("main", dye)) then
if (showall or unifieddyes.palette_has_color[nodepalette.."_"..s3]) and
(minetest.registered_items[dye] and (creative or inv:contains_item("main", dye))) then
unifieddyes.player_selected_dye[player_name] = dye
unifieddyes.show_airbrush_form(player)
end
@ -1091,30 +1123,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
end)
-- build a table to convert from classic/89-color palette to extended palette
-- the first five entries are for the old greyscale - white, light, grey, dark, black
unifieddyes.convert_classic_palette = {
240,
244,
247,
251,
253
}
for hue = 0, 11 do
-- light
local paletteidx = unifieddyes.getpaletteidx("dye:light_"..unifieddyes.HUES[hue+1], false)
unifieddyes.convert_classic_palette[paletteidx] = hue*2 + 48
for sat = 0, 1 do
for val = 0, 2 do
-- all other shades
local paletteidx = unifieddyes.getpaletteidx("dye:"..unifieddyes.VALS[val+1]..unifieddyes.HUES[hue+1]..unifieddyes.SATS[sat+1], false)
unifieddyes.convert_classic_palette[paletteidx] = hue*2 + sat*24 + (val*48+96)
end
end
end
-- Generate all dyes that are not part of the default minetest_game dyes mod
for _, h in ipairs(unifieddyes.HUES_EXTENDED) do
@ -1229,6 +1237,43 @@ minetest.register_craftitem(":dye:light_grey", {
groups = { dye=1, not_in_creative_inventory=1 },
})
-- build a table of color <-> palette associations to reduce the need for
-- realtime lookups with getpaletteidx()
for _, palette in ipairs({"extended", "split", "wallmounted"}) do
local palette2 = palette
for i in ipairs(unifieddyes.SATS) do
local sat = (palette == "wallmounted") and "" or unifieddyes.SATS[i]
for _, hue in ipairs(unifieddyes.HUES_EXTENDED) do
for _, val in ipairs(unifieddyes.VALS_EXTENDED) do
local color = val..hue[1]..sat
if unifieddyes.getpaletteidx("dye:"..color, palette2) then
unifieddyes.palette_has_color[palette.."_"..color] = true
end
end
end
end
for y = 0, 15 do
local grey = "grey_"..y
if y == 0 then grey = "black"
elseif y == 4 then grey = "dark_grey"
elseif y == 8 then grey = "grey"
elseif y == 11 then grey = "light_grey"
elseif y == 15 then grey = "white"
end
if unifieddyes.getpaletteidx("dye:"..grey, palette2) then
unifieddyes.palette_has_color[palette.."_"..grey] = true
end
end
end
unifieddyes.palette_has_color["wallmounted_light_red"] = true
-- crafting!
unifieddyes.base_color_crafts = {
{ "red", "flowers:rose", nil, nil, nil, nil, 4 },
{ "vermilion", "dye:red", "dye:orange", nil, nil, nil, 3 },

View File

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

View File

@ -377,7 +377,7 @@ for _,color in pairs(hues) do
minetest.register_craft({
output = unifieddyes.make_colored_itemstack(
"mesecons_extrawires:insulated_corner_"..color.."_off 3",
true,
"split",
dye),
recipe = {
{"", dye, ""},
@ -389,7 +389,7 @@ for _,color in pairs(hues) do
minetest.register_craft({
output = unifieddyes.make_colored_itemstack(
"mesecons_extrawires:insulated_tjunction_"..color.."_off 3",
true,
"split",
dye),
recipe = {
{"", dye, ""},
@ -402,7 +402,7 @@ for _,color in pairs(hues) do
type = "shapeless",
output = unifieddyes.make_colored_itemstack(
"mesecons_insulated:insulated_"..color.."_off",
true,
"split",
dye),
recipe = {
dye,
@ -413,7 +413,7 @@ for _,color in pairs(hues) do
minetest.register_craft({
output = unifieddyes.make_colored_itemstack(
"mesecons_extrawires:insulated_corner_"..color.."_off",
true,
"split",
dye),
type = "shapeless",
recipe = {
@ -425,7 +425,7 @@ for _,color in pairs(hues) do
minetest.register_craft({
output = unifieddyes.make_colored_itemstack(
"mesecons_extrawires:insulated_tjunction_"..color.."_off",
true,
"split",
dye),
type = "shapeless",
recipe = {
@ -444,7 +444,7 @@ for _,color in pairs(hues) do -- allow re-dying of grey wires since they're so l
type = "shapeless",
output = unifieddyes.make_colored_itemstack(
"mesecons_insulated:insulated_"..color.."_off",
true,
"split",
dye),
recipe = {
dye,
@ -455,7 +455,7 @@ for _,color in pairs(hues) do -- allow re-dying of grey wires since they're so l
minetest.register_craft({
output = unifieddyes.make_colored_itemstack(
"mesecons_extrawires:insulated_corner_"..color.."_off",
true,
"split",
dye),
type = "shapeless",
recipe = {
@ -467,7 +467,7 @@ for _,color in pairs(hues) do -- allow re-dying of grey wires since they're so l
minetest.register_craft({
output = unifieddyes.make_colored_itemstack(
"mesecons_extrawires:insulated_tjunction_"..color.."_off",
true,
"split",
dye),
type = "shapeless",
recipe = {

View File

@ -1,3 +1,11 @@
local function above_or_under(placer, pointed_thing)
if placer:get_player_control().sneak then
return pointed_thing.above
else
return pointed_thing.under
end
end
minetest.register_tool(":worldedit:wand", {
description = "WorldEdit Wand tool, Left-click to set 1st position, right-click to set 2nd",
inventory_image = "worldedit_wand.png",
@ -7,7 +15,7 @@ minetest.register_tool(":worldedit:wand", {
on_use = function(itemstack, placer, pointed_thing)
if placer ~= nil and pointed_thing ~= nil and pointed_thing.type == "node" then
local name = placer:get_player_name()
worldedit.pos1[name] = pointed_thing.under
worldedit.pos1[name] = above_or_under(placer, pointed_thing)
worldedit.mark_pos1(name)
end
return itemstack -- nothing consumed, nothing changed
@ -16,7 +24,7 @@ minetest.register_tool(":worldedit:wand", {
on_place = function(itemstack, placer, pointed_thing) -- Left Click
if placer ~= nil and pointed_thing ~= nil and pointed_thing.type == "node" then
local name = placer:get_player_name()
worldedit.pos2[name] = pointed_thing.under
worldedit.pos2[name] = above_or_under(placer, pointed_thing)
worldedit.mark_pos2(name)
end
return itemstack -- nothing consumed, nothing changed