diff options
148 files changed, 3551 insertions, 1551 deletions
diff --git a/anvil/init.lua b/anvil/init.lua index f4098c8..910c187 100644 --- a/anvil/init.lua +++ b/anvil/init.lua @@ -69,7 +69,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 + 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 +80,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 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 @@ -180,12 +180,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 @@ -193,7 +194,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) @@ -214,7 +215,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 diff --git a/anvil/locale/es.po b/anvil/locale/es.po new file mode 100644 index 0000000..167dbb4 --- /dev/null +++ b/anvil/locale/es.po @@ -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." diff --git a/areas/README.md b/areas/README.md index bd6a54d..f7c07c6 100644 --- a/areas/README.md +++ b/areas/README.md @@ -7,7 +7,7 @@ Configuration If you wish to specify configuration options, such as whether players are allowed to protect their own areas with the `protect` command (disabled by -default), you should check config.lua and set the appropriate settings in your +default), you should check settings.lua and set the appropriate settings in your server's configuration file (probably `minetest.conf`). diff --git a/biome_lib/init.lua b/biome_lib/init.lua index 5cb6202..cb23eb7 100644 --- a/biome_lib/init.lua +++ b/biome_lib/init.lua @@ -66,7 +66,7 @@ local humidity_persistence = 0.5 local humidity_scale = 250 local time_scale = 1 -local time_speed = tonumber(minetest.setting_get("time_speed")) +local time_speed = tonumber(minetest.settings:get("time_speed")) if time_speed and time_speed > 0 then time_scale = 72 / time_speed @@ -717,7 +717,7 @@ end -- Check for infinite stacks -if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then +if minetest.get_modpath("unified_inventory") or not minetest.settings:get_bool("creative_mode") then biome_lib.expect_infinite_stacks = false else biome_lib.expect_infinite_stacks = true diff --git a/blox/init.lua b/blox/init.lua index cfcc71e..c022863 100644 --- a/blox/init.lua +++ b/blox/init.lua @@ -103,12 +103,12 @@ for _, nodeclass in ipairs(NodeClass) do minetest.register_node("blox:stone_"..nodeclass, {
description = "Blox stone "..nodeclass,
- drawtype = "mesh",
tiles = {
{ name = "default_stone.png", color = 0xffffffff },
+ },
+ overlay_tiles = {
"blox_stone_"..nodeclass..".png"
},
- mesh = "blox_block_with_overlay.obj",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
paramtype = "light",
@@ -123,12 +123,12 @@ for _, nodeclass in ipairs(NodeClass) do minetest.register_node("blox:cobble_"..nodeclass, {
description = "Blox cobble "..nodeclass,
- drawtype = "mesh",
tiles = {
{ name = "default_cobble.png", color = 0xffffffff },
+ },
+ overlay_tiles = {
"blox_cobble_"..nodeclass..".png"
},
- mesh = "blox_block_with_overlay.obj",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
paramtype = "light",
@@ -143,12 +143,12 @@ for _, nodeclass in ipairs(NodeClass) do minetest.register_node("blox:wood_"..nodeclass, {
description = "Blox wood "..nodeclass,
- drawtype = "mesh",
tiles = {
{ name = "default_wood.png", color = 0xffffffff },
+ },
+ overlay_tiles = {
"blox_wood_"..nodeclass..".png"
},
- mesh = "blox_block_with_overlay.obj",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
paramtype = "light",
diff --git a/boost_cart/cart_entity.lua b/boost_cart/cart_entity.lua index 1633758..4147c09 100644 --- a/boost_cart/cart_entity.lua +++ b/boost_cart/cart_entity.lua @@ -231,7 +231,7 @@ function cart_entity:on_step(dtime) local acc = nil local acc_meta = minetest.get_meta(pos):get_string("cart_acceleration") - if acc_meta == "halt" then + if acc_meta == "halt" and not self.punched then -- Stop rail vel = {x=0, y=0, z=0} acc = false diff --git a/boost_cart/init.lua b/boost_cart/init.lua index 7dd5c44..bfae5d9 100644 --- a/boost_cart/init.lua +++ b/boost_cart/init.lua @@ -9,6 +9,7 @@ boost_cart.punch_speed_max = 7 if not boost_cart.modpath then + -- For Minetest 0.4.12 and older that don't look at the "mod.conf" file error("\nWrong mod directory name! Please change it to 'boost_cart'.\n" .. "See also: http://dev.minetest.net/Installing_Mods") end diff --git a/boost_cart/mod.conf b/boost_cart/mod.conf new file mode 100644 index 0000000..7da19df --- /dev/null +++ b/boost_cart/mod.conf @@ -0,0 +1 @@ +name = boost_cart
\ No newline at end of file diff --git a/boost_cart/rails.lua b/boost_cart/rails.lua index c2a58cd..a03961b 100644 --- a/boost_cart/rails.lua +++ b/boost_cart/rails.lua @@ -1,4 +1,12 @@ -boost_cart:register_rail(":default:rail", { +-- Common rail registrations + +local regular_rail_itemname = "default:rail" +if minetest.registered_nodes["carts:rail"] then + -- MTG Compatibility + regular_rail_itemname = "carts:rail" +end + +boost_cart:register_rail(":"..regular_rail_itemname, { description = "Rail", tiles = { "carts_rail_straight.png", "carts_rail_curved.png", diff --git a/bushes_classic/cooking.lua b/bushes_classic/cooking.lua index 25af7e8..0e0810a 100644 --- a/bushes_classic/cooking.lua +++ b/bushes_classic/cooking.lua @@ -1,4 +1,9 @@ -local S = biome_lib.intllib +local S +if minetest.get_modpath("intllib") then + S = intllib.Getter() +else + S = function(s) return s end +end -- Basket @@ -71,7 +76,7 @@ for i, berry in ipairs(bushes_classic.bushes) do else minetest.register_craftitem(":bushes:"..berry, { - description = desc, + description = S(desc), inventory_image = "bushes_"..berry..".png", groups = {berry = 1, [berry] = 1}, on_use = minetest.item_eat(1), diff --git a/bushes_classic/init.lua b/bushes_classic/init.lua index 021f569..17a86a6 100644 --- a/bushes_classic/init.lua +++ b/bushes_classic/init.lua @@ -3,7 +3,12 @@ -- -- License: WTFPL -local S = biome_lib.intllib +local S +if minetest.get_modpath("intllib") then + S = intllib.Getter() +else + S = function(s) return s end +end bushes_classic = {} @@ -17,7 +22,7 @@ bushes_classic.bushes = { } bushes_classic.bushes_descriptions = { - "Strawberry", + "Strawberry", "Blackberry", "Blueberry", "Raspberry", diff --git a/bushes_classic/locale/es.txt b/bushes_classic/locale/es.txt new file mode 100644 index 0000000..fc74322 --- /dev/null +++ b/bushes_classic/locale/es.txt @@ -0,0 +1,43 @@ +# Traducido por Carlos Barraza + +Strawberry = Frutilla +Blackberry = Mora +Blueberry = Arándano +Raspberry = Frambuesa +Gooseberry = Grosella +Mixed Berry = Mezcla de Baya +Basket with Strawberry Pies = Cesta con Pasteles de Frutilla +Basket with Blackberry Pies = Cesta con Pasteles de Mora +Basket with Blueberry Pies = Cesta con Pasteles de Arándano +Basket with Raspberry Pies = Cesta con Pasteles de Frambuesa +Basket with Gooseberry Pies = Cesta con Pasteles de Grosella +Basket with Mixed Berry Pies = Cesta con Pasteles de Mezcla de Baya +currently fruitless = Actualmente infructuoso +Strawberry Bush = Arbusto de Frutilla +Blackberry Bush = Arbusto de Mora +Blueberry Bush = Arbusto de Arándano +Raspberry Bush = Arbusto de Frambuesa +Gooseberry Bush = Arbusto de Grosella +Mixed Berry Bush = Arbusto de Mezcla de Baya +Basket = Cesta +Sugar = Azúcar +Raw Strawberry pie = Pastel de Frutilla Crudo +Raw Blackberry pie = Pastel de Mora Crudo +Raw Blueberry pie = Pastel de Arándano Crudo +Raw Raspberry pie = Pastel de Frambuesa Crudo +Raw Gooseberry pie = Pastel de Grosella Crudo +Raw Mixed Berry pie = Pastel de Mezcla de Bayas Cruda +Cooked Strawberry pie = Pastel de Frutilla Cocido +Cooked Blackberry pie = Pastel de Mora Cocido +Cooked Blueberry pie = Pastel de Arándano Cocido +Cooked Raspberry pie = Pastel de Frambuesa Cocido +Cooked Gooseberry pie = Pastel de Grosella Cocido +Cooked Mixed Berry pie = Pastel de Mezcla de Bayas Cocido +Slice of Strawberry pie = Rebanada de Pastel de Frutilla +Slice of Blackberry pie = Rebanada de Pastel de Mora +Slice of Blueberry pie = Rebanada de Pastel de Arándano +Slice of Raspberry pie = Rebanada de Pastel de Frambuesa +Slice of Gooseberry pie = Rebanada de Pastel de Grosella +Slice of Mixed Berry pie = Rebanada de Pastel de Mezcla de Bayas + +[Bushes] Loaded. = [Arbustos] Cargado. diff --git a/bushes_classic/nodes.lua b/bushes_classic/nodes.lua index 352e2a9..e45c7e7 100644 --- a/bushes_classic/nodes.lua +++ b/bushes_classic/nodes.lua @@ -1,4 +1,9 @@ -local S = biome_lib.intllib +local S +if minetest.get_modpath("intllib") then + S = intllib.Getter() +else + S = function(s) return s end +end plantlife_bushes = {} diff --git a/castle_farming/locale/es.po b/castle_farming/locale/es.po new file mode 100644 index 0000000..72983b3 --- /dev/null +++ b/castle_farming/locale/es.po @@ -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" diff --git a/castle_gates/locale/es.po b/castle_gates/locale/es.po new file mode 100644 index 0000000..c102161 --- /dev/null +++ b/castle_gates/locale/es.po @@ -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" diff --git a/castle_lighting/locale/es.po b/castle_lighting/locale/es.po new file mode 100644 index 0000000..f0faee9 --- /dev/null +++ b/castle_lighting/locale/es.po @@ -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" diff --git a/caverealms/falling_ice.lua b/caverealms/falling_ice.lua index 46b704b..f1ea438 100644 --- a/caverealms/falling_ice.lua +++ b/caverealms/falling_ice.lua @@ -186,7 +186,7 @@ function caverealms:nodeupdate_single(p, delay) end if minetest.get_item_group(n.name, "attached_node") ~= 0 then - if not check_attached_node(p, n) then + if not caverealms:check_attached_node(p, n) then caverealms:drop_attached_node(p) caverealms:nodeupdate(p) end diff --git a/caverealms/nodes.lua b/caverealms/nodes.lua index a1e819c..5292eea 100644 --- a/caverealms/nodes.lua +++ b/caverealms/nodes.lua @@ -86,10 +86,10 @@ minetest.register_node("caverealms:thin_ice", { --alternate version for stalactites minetest.register_node("caverealms:hanging_thin_ice", { - description = "Thin Ice", + description = "Thin Ice (hanging)", tiles = {"caverealms_thin_ice.png"}, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3, not_in_creative_inventory = 1}, sounds = default.node_sound_glass_defaults(), use_texture_alpha = true, drawtype = "glasslike", diff --git a/coloredwood/init.lua b/coloredwood/init.lua index 2c09e21..765938b 100644 --- a/coloredwood/init.lua +++ b/coloredwood/init.lua @@ -18,7 +18,7 @@ coloredwood = {} coloredwood.enable_stairsplus = true -if minetest.setting_getbool("coloredwood_enable_stairsplus") == false or not minetest.get_modpath("moreblocks") then +if minetest.settings:get_bool("coloredwood_enable_stairsplus") == false or not minetest.get_modpath("moreblocks") then coloredwood.enable_stairsplus = false end diff --git a/concrete/locale/es.txt b/concrete/locale/es.txt new file mode 100644 index 0000000..b7ea30a --- /dev/null +++ b/concrete/locale/es.txt @@ -0,0 +1,8 @@ +# technic_concrete traducido por Carlos Barraza + +Rebar = Barra de refuerzo +Concrete Block = Bloque de concreto +Blast-resistant Concrete Block = Bloque de concreto resistente a explosiones +Concrete Post Platform = Plataforma de concreto +Concrete Post = Postes de concreto + diff --git a/currency/barter.lua b/currency/barter.lua index dad2e4a..1fb4f1b 100644 --- a/currency/barter.lua +++ b/currency/barter.lua @@ -1,5 +1,9 @@ barter = {}
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
barter.chest = {}
barter.chest.formspec = {
main = "size[8,9]"..
@@ -7,20 +11,20 @@ barter.chest.formspec = { "list[current_name;pl2;5,0;3,4;]"..
"list[current_player;main;0,5;8,4;]",
pl1 = {
- start = "button[3,1;1,1;pl1_start;Start]",
+ start = "button[3,1;1,1;pl1_start;" .. S("Start") .. "]",
player = function(name) return "label[3,0;"..name.."]" end,
- accept1 = "button[3,1;1,1;pl1_accept1;Confirm]"..
- "button[3,2;1,1;pl1_cancel;Cancel]",
- accept2 = "button[3,1;1,1;pl1_accept2;Exchange]"..
- "button[3,2;1,1;pl1_cancel;Cancel]",
+ accept1 = "button[3,1;1,1;pl1_accept1;" .. S("Confirm") .. "]"..
+ "button[3,2;1,1;pl1_cancel;" .. S("Cancel") .. "]",
+ accept2 = "button[3,1;1,1;pl1_accept2;" .. S("Exchange") .. "]"..
+ "button[3,2;1,1;pl1_cancel;" .. S("Cancel") .. "]",
},
pl2 = {
- start = "button[4,1;1,1;pl2_start;Start]",
+ start = "button[4,1;1,1;pl2_start;" .. S("Start") .. "]",
player = function(name) return "label[4,0;"..name.."]" end,
- accept1 = "button[4,1;1,1;pl2_accept1;Confirm]"..
- "button[4,2;1,1;pl2_cancel;Cancel]",
- accept2 = "button[4,1;1,1;pl2_accept2;Exchange]"..
- "button[4,2;1,1;pl2_cancel;Cancel]",
+ accept1 = "button[4,1;1,1;pl2_accept1;" .. S("Confirm") .. "]"..
+ "button[4,2;1,1;pl2_cancel;" .. S("Cancel") .. "]",
+ accept2 = "button[4,1;1,1;pl2_accept2;" .. S("Exchange") .. "]"..
+ "button[4,2;1,1;pl2_cancel;" .. S("Cancel") .. "]",
},
}
@@ -90,7 +94,7 @@ end minetest.register_node("currency:barter", {
drawtype = "nodebox",
- description = "Barter Table",
+ description = S("Barter Table"),
paramtype = "light",
paramtype2 = "facedir",
tiles = {"barter_top.png",
@@ -111,7 +115,7 @@ minetest.register_node("currency:barter", { sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
- meta:set_string("infotext", "Barter Table")
+ meta:set_string("infotext", S("Barter Table"))
meta:set_string("pl1","")
meta:set_string("pl2","")
barter.chest.update_formspec(meta)
diff --git a/currency/craftitems.lua b/currency/craftitems.lua index 47ad953..a8d7570 100644 --- a/currency/craftitems.lua +++ b/currency/craftitems.lua @@ -1,26 +1,30 @@ +-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
minetest.register_craftitem("currency:minegeld", {
- description = "1 MineGeld Note",
+ description = S("1 MineGeld Note"),
inventory_image = "minegeld.png",
stack_max = 30000,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld_5", {
- description = "5 MineGeld Note",
+ description = S("5 MineGeld Note"),
inventory_image = "minegeld_5.png",
stack_max = 30000,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld_10", {
- description = "10 MineGeld Note",
+ description = S("10 MineGeld Note"),
inventory_image = "minegeld_10.png",
stack_max = 30000,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld_bundle", {
- description = "Bundle of random Minegeld notes",
+ description = S("Bundle of random Minegeld notes"),
inventory_image = "minegeld_bundle.png",
stack_max = 30000,
})
diff --git a/currency/depends.txt b/currency/depends.txt index d3f04d8..b650e9b 100644 --- a/currency/depends.txt +++ b/currency/depends.txt @@ -1,2 +1,4 @@ default -pipeworks? +intllib? +loot? +pipeworks?
\ No newline at end of file diff --git a/currency/income.lua b/currency/income.lua index 2bb42bc..cbbd5d8 100644 --- a/currency/income.lua +++ b/currency/income.lua @@ -1,5 +1,9 @@ players_income = {} +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + local timer = 0 minetest.register_globalstep(function(dtime) timer = timer + dtime; @@ -11,7 +15,7 @@ minetest.register_globalstep(function(dtime) players_income[name] = 0 end players_income[name] = 1 - minetest.log("info", "[Currency] basic income for "..name.."") + minetest.log("info", "[Currency] "..S("basic income for @1", name)) end end end) @@ -27,7 +31,7 @@ earn_income = function(player) local inv = player:get_inventory() inv:add_item("main", {name="currency:minegeld_5", count=count}) players_income[name] = 0 - minetest.log("info", "[Currency] added basic income for "..name.." to inventory") + minetest.log("info", "[Currency] "..S("added basic income for @1 to inventory", name)) end end diff --git a/currency/init.lua b/currency/init.lua index 744fcad..fa85bd2 100644 --- a/currency/init.lua +++ b/currency/init.lua @@ -1,20 +1,24 @@ -minetest.log("info", " Currency mod loading... ")
local modpath = minetest.get_modpath("currency")
+-- internationalization boilerplate
+local S, NS = dofile(modpath.."/intllib.lua")
+
+minetest.log("info", S("Currency mod loading..."))
+
dofile(modpath.."/craftitems.lua")
-minetest.log("info", "[Currency] Craft_items Loaded!")
+minetest.log("info", "[Currency] "..S("Craft_items Loaded!"))
dofile(modpath.."/shop.lua")
-minetest.log("info", "[Currency] Shop Loaded!")
+minetest.log("info", "[Currency] "..S("Shop Loaded!"))
dofile(modpath.."/barter.lua")
-minetest.log("info", "[Currency] Barter Loaded!")
+minetest.log("info", "[Currency] "..S("Barter Loaded!"))
dofile(modpath.."/safe.lua")
-minetest.log("info", "[Currency] Safe Loaded!")
+minetest.log("info", "[Currency] "..S("Safe Loaded!"))
dofile(modpath.."/crafting.lua")
-minetest.log("info", "[Currency] Crafting Loaded!")
+minetest.log("info", "[Currency] "..S("Crafting Loaded!"))
if minetest.setting_getbool("creative_mode") then
- minetest.log("info", "[Currency] Creative mode in use, skipping basic income.")
+ minetest.log("info", "[Currency] "..S("Creative mode in use, skipping basic income."))
else
dofile(modpath.."/income.lua")
- minetest.log("info", "[Currency] Income Loaded!")
+ minetest.log("info", "[Currency] "..S("Income Loaded!"))
end
diff --git a/currency/intllib.lua b/currency/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/currency/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense <http://unlicense.org>. + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/currency/locale/template.pot b/currency/locale/template.pot new file mode 100644 index 0000000..f528214 --- /dev/null +++ b/currency/locale/template.pot @@ -0,0 +1,177 @@ +# 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-20 13:58-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" + +#: barter.lua:14 barter.lua:22 +msgid "Start" +msgstr "" + +#: barter.lua:16 barter.lua:24 +msgid "Confirm" +msgstr "" + +#: barter.lua:17 barter.lua:19 barter.lua:25 barter.lua:27 +msgid "Cancel" +msgstr "" + +#: barter.lua:18 barter.lua:26 shop.lua:20 +msgid "Exchange" +msgstr "" + +#: barter.lua:97 barter.lua:118 +msgid "Barter Table" +msgstr "" + +#: craftitems.lua:6 +msgid "1 MineGeld Note" +msgstr "" + +#: craftitems.lua:13 +msgid "5 MineGeld Note" +msgstr "" + +#: craftitems.lua:20 +msgid "10 MineGeld Note" +msgstr "" + +#: craftitems.lua:27 +msgid "Bundle of random Minegeld notes" +msgstr "" + +#: income.lua:18 +msgid "basic income for @1" +msgstr "" + +#: income.lua:34 +msgid "added basic income for @1 to inventory" +msgstr "" + +#: init.lua:6 +msgid "Currency mod loading..." +msgstr "" + +#: init.lua:9 +msgid "Craft_items Loaded!" +msgstr "" + +#: init.lua:11 +msgid "Shop Loaded!" +msgstr "" + +#: init.lua:13 +msgid "Barter Loaded!" +msgstr "" + +#: init.lua:15 +msgid "Safe Loaded!" +msgstr "" + +#: init.lua:17 +msgid "Crafting Loaded!" +msgstr "" + +#: init.lua:20 +msgid "Creative mode in use, skipping basic income." +msgstr "" + +#: init.lua:23 +msgid "Income Loaded!" +msgstr "" + +#: safe.lua:29 +msgid "Safe" +msgstr "" + +#: safe.lua:44 +msgid "Safe (owned by @1)" +msgstr "" + +#: safe.lua:61 safe.lua:70 safe.lua:79 +msgid "@1 tried to access a safe belonging to @2 at @3" +msgstr "" + +#: safe.lua:86 +msgid "@1 moves stuff in safe at @2" +msgstr "" + +#: safe.lua:89 +msgid "@1 moves stuff to safe at @2" +msgstr "" + +#: safe.lua:92 +msgid "@1 takes stuff from safe at @2" +msgstr "" + +#: shop.lua:11 +msgid "Customer gives (pay here!)" +msgstr "" + +#: shop.lua:13 +msgid "Customer gets:" +msgstr "" + +#: shop.lua:15 +msgid "Owner wants:" +msgstr "" + +#: shop.lua:17 +msgid "Owner gives:" +msgstr "" + +#: shop.lua:26 +msgid "Customers gave:" +msgstr "" + +#: shop.lua:28 +msgid "Your stock:" +msgstr "" + +#: shop.lua:30 +msgid "You want:" +msgstr "" + +#: shop.lua:32 +msgid "In exchange, you give:" +msgstr "" + +#: shop.lua:34 +msgid "Owner, Use (E)+Place (right mouse button) for customer interface" +msgstr "" + +#: shop.lua:88 +msgid "Shop" +msgstr "" + +#: shop.lua:102 +msgid "Exchange shop (owned by @1)" +msgstr "" + +#: shop.lua:151 +msgid "This is your own shop, you can't exchange to yourself!" +msgstr "" + +#: shop.lua:188 +msgid "Exchanged!" +msgstr "" + +#: shop.lua:191 +msgid "Exchange can not be done, contact the shop owner." +msgstr "" + +#: shop.lua:193 +msgid "Exchange can not be done, check if you put all items!" +msgstr "" diff --git a/currency/loot.lua b/currency/loot.lua new file mode 100644 index 0000000..e687724 --- /dev/null +++ b/currency/loot.lua @@ -0,0 +1,30 @@ +if not minetest.get_modpath("loot") then + return +end + +loot.register_loot({ + weights = { generic = 50 }, + payload = { + stack = ItemStack("currency:minegeld"), + min_size = 1, + max_size = 250, + }, +}) + +loot.register_loot({ + weights = { generic = 50 }, + payload = { + stack = ItemStack("currency:minegeld_5"), + min_size = 1, + max_size = 50, + }, +}) + +loot.register_loot({ + weights = { generic = 50 }, + payload = { + stack = ItemStack("currency:minegeld_10"), + min_size = 1, + max_size = 10, + }, +})
\ No newline at end of file diff --git a/currency/safe.lua b/currency/safe.lua index 794e23a..1c53184 100644 --- a/currency/safe.lua +++ b/currency/safe.lua @@ -1,3 +1,7 @@ +-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
function default.get_safe_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec =
@@ -22,12 +26,12 @@ local function has_safe_privilege(meta, player) end
minetest.register_node("currency:safe", {
- description = "Safe",
+ description = S("Safe"),
inventory_image = "safe_front.png",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"safe_side.png",
- "safe_side.png",
+ "safe_side.png",
"safe_side.png",
"safe_side.png",
"safe_side.png",
@@ -37,8 +41,7 @@ minetest.register_node("currency:safe", { after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
- meta:set_string("infotext", "Safe (owned by "..
- meta:get_string("owner")..")")
+ meta:set_string("infotext", S("Safe (owned by @1)", meta:get_string("owner")))
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
@@ -55,10 +58,8 @@ minetest.register_node("currency:safe", { allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if not has_safe_privilege(meta, player) then
- minetest.log("action", player:get_player_name()..
- " tried to access a safe belonging to "..
- meta:get_string("owner").." at "..
- minetest.pos_to_string(pos))
+ minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3",
+ player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos)))
return 0
end
return count
@@ -66,10 +67,8 @@ minetest.register_node("currency:safe", { allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not has_safe_privilege(meta, player) then
- minetest.log("action", player:get_player_name()..
- " tried to access a safe belonging to "..
- meta:get_string("owner").." at "..
- minetest.pos_to_string(pos))
+ minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3",
+ player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos)))
return 0
end
return stack:get_count()
@@ -77,25 +76,20 @@ minetest.register_node("currency:safe", { allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not has_safe_privilege(meta, player) then
- minetest.log("action", player:get_player_name()..
- " tried to access a safe belonging to "..
- meta:get_string("owner").." at "..
- minetest.pos_to_string(pos))
+ minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3",
+ player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos)))
return 0
end
return stack:get_count()
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
- minetest.log("action", player:get_player_name()..
- " moves stuff in safe at "..minetest.pos_to_string(pos))
+ minetest.log("action", S("@1 moves stuff in safe at @2", player:get_player_name(), minetest.pos_to_string(pos)))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
- minetest.log("action", player:get_player_name()..
- " moves stuff to safe at "..minetest.pos_to_string(pos))
+ minetest.log("action", S("@1 moves stuff to safe at @2", player:get_player_name(), minetest.pos_to_string(pos)))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
- minetest.log("action", player:get_player_name()..
- " takes stuff from safe at "..minetest.pos_to_string(pos))
+ minetest.log("action", S("@1 takes stuff from safe at @2", player:get_player_name(), minetest.pos_to_string(pos)))
end,
on_rightclick = function(pos, node, clicker)
local meta = minetest.get_meta(pos)
diff --git a/currency/shop.lua b/currency/shop.lua index 36765a3..301a08c 100644 --- a/currency/shop.lua +++ b/currency/shop.lua @@ -1,38 +1,44 @@ +-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
default.shop = {}
default.shop.current_shop = {}
default.shop.formspec = {
customer = function(pos)
local list_name = "nodemeta:"..pos.x..','..pos.y..','..pos.z
local formspec = "size[8,9.5]"..
- "label[0,0;Customer gives (pay here !)]"..
+ "label[0,0;" .. S("Customer gives (pay here!)") .. "]"..
"list[current_player;customer_gives;0,0.5;3,2;]"..
- "label[0,2.5;Customer gets]"..
+ "label[0,2.5;" .. S("Customer gets:") .. "]"..
"list[current_player;customer_gets;0,3;3,2;]"..
- "label[5,0;Owner wants]"..
+ "label[5,0;" .. S("Owner wants:") .. "]"..
"list["..list_name..";owner_wants;5,0.5;3,2;]"..
- "label[5,2.5;Owner gives]"..
+ "label[5,2.5;" .. S("Owner gives:") .. "]"..
"list["..list_name..";owner_gives;5,3;3,2;]"..
"list[current_player;main;0,5.5;8,4;]"..
- "button[3,2;2,1;exchange;Exchange]"
+ "button[3,2;2,1;exchange;" .. S("Exchange") .. "]"
return formspec
end,
owner = function(pos)
local list_name = "nodemeta:"..pos.x..','..pos.y..','..pos.z
local formspec = "size[8,9.5]"..
- "label[0,0;Customers gave:]"..
+ "label[0,0;" .. S("Customers gave:") .. "]"..
"list["..list_name..";customers_gave;0,0.5;3,2;]"..
- "label[0,2.5;Your stock:]"..
+ "label[0,2.5;" .. S("Your stock:") .. "]"..
"list["..list_name..";stock;0,3;3,2;]"..
- "label[5,0;You want:]"..
+ "label[5,0;" .. S("You want:") .. "]"..
"list["..list_name..";owner_wants;5,0.5;3,2;]"..
- "label[5,2.5;In exchange, you give:]"..
+ "label[5,2.5;" .. S("In exchange, you give:") .. "]"..
"list["..list_name..";owner_gives;5,3;3,2;]"..
- "label[0,5;Owner, Use(E)+Place(RMB) for customer interface]"..
+ "label[0,5;" .. S("Owner, Use (E)+Place (right mouse button) for customer interface") .. "]"..
"list[current_player;main;0,5.5;8,4;]"
return formspec
end,
}
+local have_pipeworks = minetest.global_exists("pipeworks")
+
default.shop.check_privilege = function(listname,playername,meta)
--[[if listname == "pl1" then
if playername ~= meta:get_string("pl1") then
@@ -81,10 +87,10 @@ default.shop.exchange = function(meta) end
minetest.register_node("currency:shop", {
- description = "Shop",
+ description = S("Shop"),
paramtype2 = "facedir",
tiles = {"shop_top.png",
- "shop_top.png",
+ "shop_top.png",
"shop_side.png",
"shop_side.png",
"shop_side.png",
@@ -95,7 +101,7 @@ minetest.register_node("currency:shop", { after_place_node = function(pos, placer, itemstack)
local owner = placer:get_player_name()
local meta = minetest.get_meta(pos)
- meta:set_string("infotext", "Exchange shop (owned by "..owner..")")
+ meta:set_string("infotext", S("Exchange shop (owned by @1)", owner))
meta:set_string("owner",owner)
--[[meta:set_string("pl1","")
meta:set_string("pl2","")]]
@@ -104,9 +110,9 @@ minetest.register_node("currency:shop", { inv:set_size("stock", 3*2)
inv:set_size("owner_wants", 3*2)
inv:set_size("owner_gives", 3*2)
- if minetest.get_modpath("pipeworks") then pipeworks.after_place(pos) end
+ if have_pipeworks then pipeworks.after_place(pos) end
end,
- after_dig_node = (pipeworks and pipeworks.after_dig),
+ after_dig_node = (have_pipeworks and pipeworks and pipeworks.after_dig),
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
@@ -160,7 +166,7 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields) local pos = default.shop.current_shop[name]
local meta = minetest.get_meta(pos)
if meta:get_string("owner") == name then
- minetest.chat_send_player(name,"This is your own shop, you can't exchange to yourself !")
+ minetest.chat_send_player(name,S("This is your own shop, you can't exchange to yourself!"))
else
local minv = meta:get_inventory()
local pinv = sender:get_inventory()
@@ -197,12 +203,12 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields) minv:remove_item("stock",item)
pinv:add_item("customer_gets",item)
end
- minetest.chat_send_player(name,"Exchanged!")
+ minetest.chat_send_player(name,S("Exchanged!"))
else
if owners_fault then
- minetest.chat_send_player(name,"Exchange can not be done, contact the shop owner.")
+ minetest.chat_send_player(name,S("Exchange can not be done, contact the shop owner."))
else
- minetest.chat_send_player(name,"Exchange can not be done, check if you put all items !")
+ minetest.chat_send_player(name,S("Exchange can not be done, check if you put all items!"))
end
end
end
diff --git a/dryplants/juncus.lua b/dryplants/juncus.lua index bfbf23c..2ea094f 100644 --- a/dryplants/juncus.lua +++ b/dryplants/juncus.lua @@ -25,7 +25,7 @@ end minetest.register_node("dryplants:juncus", { description = "Juncus", drawtype = "plantlike", - visual_scale = 2, + visual_scale = math.sqrt(8), paramtype = "light", tiles = {"dryplants_juncus_03.png"}, inventory_image = "dryplants_juncus_inv.png", @@ -67,7 +67,7 @@ minetest.register_node("dryplants:juncus", { minetest.register_node("dryplants:juncus_02", { description = "Juncus", drawtype = "plantlike", - visual_scale = 2, + visual_scale = math.sqrt(8), paramtype = "light", tiles = {"dryplants_juncus_02.png"}, walkable = false, diff --git a/dryplants/reedmace.lua b/dryplants/reedmace.lua index 9547c7a..b01e118 100644 --- a/dryplants/reedmace.lua +++ b/dryplants/reedmace.lua @@ -125,7 +125,7 @@ minetest.register_node("dryplants:reedmace_top", { minetest.register_node("dryplants:reedmace_height_2", { description = "Reedmace, height: 2", drawtype = "plantlike", - visual_scale = 2, + visual_scale = math.sqrt(8), paramtype = "light", tiles = {"dryplants_reedmace_height_2.png"}, inventory_image = "dryplants_reedmace_top.png", @@ -148,7 +148,7 @@ minetest.register_node("dryplants:reedmace_height_2", { minetest.register_node("dryplants:reedmace_height_3", { description = "Reedmace, height: 3", drawtype = "plantlike", - visual_scale = 2, + visual_scale = math.sqrt(8), paramtype = "light", tiles = {"dryplants_reedmace_height_3.png"}, inventory_image = "dryplants_reedmace_top.png", @@ -171,7 +171,7 @@ minetest.register_node("dryplants:reedmace_height_3", { minetest.register_node("dryplants:reedmace_height_3_spikes", { description = "Reedmace, height: 3 & Spikes", drawtype = "plantlike", - visual_scale = 2, + visual_scale = math.sqrt(8), paramtype = "light", tiles = {"dryplants_reedmace_height_3_spikes.png"}, inventory_image = "dryplants_reedmace_top.png", diff --git a/extranodes/locale/es.txt b/extranodes/locale/es.txt new file mode 100644 index 0000000..8b28218 --- /dev/null +++ b/extranodes/locale/es.txt @@ -0,0 +1,7 @@ +# technic_extranodes traducido por Carlos Barraza + +Marble = Mármol +Marble Bricks = Ladrillos de mármol +Granite = Granito +Concrete = Concreto + diff --git a/farming/README.txt b/farming/README.txt index 811a535..95c8154 100644 --- a/farming/README.txt +++ b/farming/README.txt @@ -13,6 +13,8 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: +1.25 - Added check for farming.conf setting file to disable specific crops globally (inside mod folder) or world specific (inside world folder) +1.24 - Added Hemp which can be crafted into fibre, paper, string, rope and oil. 1.23 - Huge code tweak and tidy done and added barley seeds to be found in dry grass, barley can make flour for bread also. 1.22 - Added grape bushes at high climates which can be cultivated into grape vines using trellis (9 sticks). 1.21 - Added auto-refill code for planting crops (thanks crabman77), also fixed a few bugs @@ -45,7 +47,7 @@ Changelog: 0.1 - Fixed growing bug 0.0 - Initial release -Lucky Blocks: 10 (plus 3 for default farming items) +Lucky Blocks: 11 (plus 3 for default farming items) License of media (textures): @@ -150,4 +152,5 @@ Created by TenPlus1 farming_rhubarb_2.png farming_rhubarb_3.png farming_rhubarb.png - farming_rhubarb_pie.png
\ No newline at end of file + farming_rhubarb_pie.png + farming_hemp*.png diff --git a/farming/beanpole.lua b/farming/beanpole.lua index f06aea5..fd93383 100644 --- a/farming/beanpole.lua +++ b/farming/beanpole.lua @@ -6,46 +6,69 @@ local S = farming.intllib --- beans -minetest.register_craftitem("farming:beans", { - description = S("Green Beans"), - inventory_image = "farming_beans.png", - on_use = minetest.item_eat(1), +-- place beans +function place_beans(itemstack, placer, pointed_thing, plantname) - on_place = function(itemstack, placer, pointed_thing) + local pt = pointed_thing - if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then - return - end + -- check if pointing at a node + if not pt or pt.type ~= "node" then - local nodename = minetest.get_node(pointed_thing.under).name + return + end - if nodename == "farming:beanpole" then - minetest.set_node(pointed_thing.under, {name = "farming:beanpole_1"}) + local under = minetest.get_node(pt.under) - minetest.sound_play("default_place_node", {pos = pointed_thing.above, gain = 1.0}) - else - return - end + -- return if any of the nodes are not registered + if not minetest.registered_nodes[under.name] then + return + end - if not minetest.setting_getbool("creative_mode") then + -- am I right-clicking on something that has a custom on_place set? + -- thanks to Krock for helping with this issue :) + local def = minetest.registered_nodes[under.name] + if def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack) + end - itemstack:take_item() + -- check if pointing at bean pole + if under.name ~= "farming:beanpole" then + return + end - -- check for refill - if itemstack:get_count() == 0 then + -- add the node and remove 1 item from the itemstack + minetest.set_node(pt.under, {name = plantname}) - minetest.after(0.20, - farming.refill_plant, - placer, - "farming:beans", - placer:get_wield_index() - ) - end - end + minetest.sound_play("default_place_node", {pos = pt.under, gain = 1.0}) - return itemstack + if not minetest.setting_getbool("creative_mode") then + + itemstack:take_item() + + -- check for refill + if itemstack:get_count() == 0 then + + minetest.after(0.20, + farming.refill_plant, + placer, + "farming:beans", + placer:get_wield_index() + ) + end end + + return itemstack +end + +-- beans +minetest.register_craftitem("farming:beans", { + description = S("Green Beans"), + inventory_image = "farming_beans.png", + on_use = minetest.item_eat(1), + + on_place = function(itemstack, placer, pointed_thing) + return place_beans(itemstack, placer, pointed_thing, "farming:beanpole_1") + end, }) -- beans can be used for green dye diff --git a/farming/compatibility.lua b/farming/compatibility.lua index 4354e60..b7c906c 100644 --- a/farming/compatibility.lua +++ b/farming/compatibility.lua @@ -140,3 +140,17 @@ minetest.register_alias("farming_plus:tomato", "farming:tomato_8") -- Weed minetest.register_alias("farming:weed", "default:grass_2") + +-- Classic Bushes compatibility +if minetest.get_modpath("bushes_classic") then + + if eth then + minetest.register_alias("bushes:strawberry", "farming:strawberry") + else + minetest.register_alias("bushes:strawberry", "farming:raspberries") + end + + minetest.register_alias("bushes:blueberry", "farming:blueberries") + minetest.register_alias("bushes:raspberry", "farming:raspberries") + +end
\ No newline at end of file diff --git a/farming/corn.lua b/farming/corn.lua index 3c27ea3..402ec82 100644 --- a/farming/corn.lua +++ b/farming/corn.lua @@ -31,9 +31,21 @@ minetest.register_craft({ }) -- ethanol (thanks to JKMurray for this idea) -minetest.register_craftitem("farming:bottle_ethanol", { +minetest.register_node("farming:bottle_ethanol", { description = S("Bottle of Ethanol"), + drawtype = "plantlike", + tiles = {"farming_bottle_ethanol.png"}, inventory_image = "farming_bottle_ethanol.png", + wield_image = "farming_bottle_ethanol.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + }, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, + sounds = default.node_sound_glass_defaults(), }) minetest.register_craft( { diff --git a/farming/cucumber.lua b/farming/cucumber.lua index 8e29215..eb29347 100644 --- a/farming/cucumber.lua +++ b/farming/cucumber.lua @@ -48,7 +48,7 @@ crop_def.tiles = {"farming_cucumber_4.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:cucumber'}, rarity = 1}, + {items = {'farming:cucumber 2'}, rarity = 1}, {items = {'farming:cucumber 2'}, rarity = 2}, } } diff --git a/farming/farming.conf_example b/farming/farming.conf_example new file mode 100644 index 0000000..696d007 --- /dev/null +++ b/farming/farming.conf_example @@ -0,0 +1,27 @@ + +--[[ + Farming settings can be changed here and kept inside mod folder + even after the mod has been updated, or you can place inside + world folder for map specific settings. +--]] + +-- true to enable crop/food in-game and on mapgen +farming.carrot = true +farming.potato = true +farming.tomato = true +farming.cucumber = true +farming.corn = true +farming.coffee = true +farming.coffee = true +farming.melon = true +farming.sugar = true +farming.pumpkin = true +farming.cocoa = true +farming.raspberry = true +farming.blueberry = true +farming.rhubarb = true +farming.beans = true +farming.grapes = true +farming.barley = true +farming.hemp = true +farming.donuts = true diff --git a/farming/hemp.lua b/farming/hemp.lua new file mode 100644 index 0000000..29b6a42 --- /dev/null +++ b/farming/hemp.lua @@ -0,0 +1,213 @@ + +local S = farming.intllib + +-- hemp seeds +minetest.register_node("farming:seed_hemp", { + description = S("Hemp Seed"), + tiles = {"farming_hemp_seed.png"}, + inventory_image = "farming_hemp_seed.png", + wield_image = "farming_hemp_seed.png", + drawtype = "signlike", + groups = {seed = 1, snappy = 3, attached_node = 1}, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = farming.select, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:hemp_1") + end, +}) + +-- harvested hemp +minetest.register_craftitem("farming:hemp_leaf", { + description = S("Hemp Leaf"), + inventory_image = "farming_hemp_leaf.png", +}) + +-- hemp oil +minetest.register_node("farming:hemp_oil", { + description = S("Bottle of Hemp Oil"), + drawtype = "plantlike", + tiles = {"farming_hemp_oil.png"}, + inventory_image = "farming_hemp_oil.png", + wield_image = "farming_hemp_oil.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + }, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_craft( { + output = "farming:hemp_oil", + recipe = { + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"}, + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"}, + {"", "vessels:glass_bottle", ""} + } +}) + +minetest.register_craft( { + output = "farming:hemp_oil", + recipe = { + {"farming:seed_hemp", "farming:seed_hemp", "farming:seed_hemp"}, + {"farming:seed_hemp", "farming:seed_hemp", "farming:seed_hemp"}, + {"farming:seed_hemp", "vessels:glass_bottle", "farming:seed_hemp"} + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:hemp_oil", + burntime = 20, + replacements = {{ "farming:hemp_oil", "vessels:glass_bottle"}} +}) + +-- hemp fibre +minetest.register_craftitem("farming:hemp_fibre", { + description = S("Hemp Fibre"), + inventory_image = "farming_hemp_fibre.png", +}) + +minetest.register_craft( { + output = "farming:hemp_fibre 8", + recipe = { + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"}, + {"farming:hemp_leaf", "bucket:bucket_water", "farming:hemp_leaf"}, + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"} + }, + replacements = {{ "bucket:bucket_water", "bucket:bucket_empty"}} +}) + +minetest.register_craft( { + output = "farming:hemp_fibre 8", + recipe = { + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"}, + {"farming:hemp_leaf", "bucket:bucket_river_water", "farming:hemp_leaf"}, + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"} + }, + replacements = {{ "bucket:bucket_river_water", "bucket:bucket_empty"}} +}) + +-- paper +minetest.register_craft( { + output = "default:paper", + recipe = { + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}, + } +}) + +-- string +minetest.register_craft( { + output = "farming:cotton", + recipe = { + {"farming:hemp_fibre"}, + {"farming:hemp_fibre"}, + {"farming:hemp_fibre"}, + } +}) + +-- hemp rope +minetest.register_node("farming:hemp_rope", { + description = S("Hemp Rope"), + walkable = false, + climbable = true, + sunlight_propagates = true, + paramtype = "light", + tiles = {"farming_hemp_rope.png"}, + wield_image = "farming_hemp_rope.png", + inventory_image = "farming_hemp_rope.png", + drawtype = "plantlike", + groups = {flammable = 2, choppy = 3, oddly_breakable_by_hand = 3}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, +}) + +-- string +minetest.register_craft( { + output = "farming:hemp_rope 6", + recipe = { + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}, + {"farming:cotton", "farming:cotton", "farming:cotton"}, + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}, + } +}) + +-- hemp definition +local crop_def = { + drawtype = "plantlike", + tiles = {"farming_hemp_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:hemp_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_hemp_2.png"} +minetest.register_node("farming:hemp_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_hemp_3.png"} +minetest.register_node("farming:hemp_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_hemp_4.png"} +minetest.register_node("farming:hemp_4", table.copy(crop_def)) + +-- stage 5 +crop_def.tiles = {"farming_hemp_5.png"} +minetest.register_node("farming:hemp_5", table.copy(crop_def)) + +-- stage 6 +crop_def.tiles = {"farming_hemp_6.png"} +crop_def.drop = { + items = { + {items = {'farming:hemp_leaf'}, rarity = 2}, + {items = {'farming:seed_hemp'}, rarity = 1}, + } +} +minetest.register_node("farming:hemp_6", table.copy(crop_def)) + +-- stage 7 +crop_def.tiles = {"farming_hemp_7.png"} +crop_def.drop = { + items = { + {items = {'farming:hemp_leaf'}, rarity = 1}, + {items = {'farming:hemp_leaf'}, rarity = 3}, + {items = {'farming:seed_hemp'}, rarity = 1}, + {items = {'farming:seed_hemp'}, rarity = 3}, + } +} +minetest.register_node("farming:hemp_7", table.copy(crop_def)) + +-- stage 8 (final) +crop_def.tiles = {"farming_hemp_8.png"} +crop_def.groups.growing = 0 +crop_def.drop = { + items = { + {items = {'farming:hemp_leaf 2'}, rarity = 1}, + {items = {'farming:hemp_leaf'}, rarity = 2}, + {items = {'farming:seed_hemp'}, rarity = 1}, + {items = {'farming:seed_hemp'}, rarity = 2}, + } +} +minetest.register_node("farming:hemp_8", table.copy(crop_def)) diff --git a/farming/init.lua b/farming/init.lua index 2d64f61..07e935c 100644 --- a/farming/init.lua +++ b/farming/init.lua @@ -1,5 +1,5 @@ --[[ - Minetest Farming Redo Mod 1.23 (12th November 2016) + Farming Redo Mod 1.25 (6th May 2017) by TenPlus1 NEW growing routine by prestidigitator auto-refill by crabman77 @@ -14,38 +14,6 @@ farming.select = { fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5} } -farming.DEBUG = false --- farming.DEBUG = {} -- Uncomment to turn on profiling code/functions - -local DEBUG_abm_runs = 0 -local DEBUG_abm_time = 0 -local DEBUG_timer_runs = 0 -local DEBUG_timer_time = 0 - -if farming.DEBUG then - - function farming.DEBUG.reset_times() - DEBUG_abm_runs = 0 - DEBUG_abm_time = 0 - DEBUG_timer_runs = 0 - DEBUG_timer_time = 0 - end - - function farming.DEBUG.report_times() - - local abm_n = DEBUG_abm_runs - local abm_dt = DEBUG_abm_time - local abm_avg = (abm_n > 0 and abm_dt / abm_n) or 0 - local timer_n = DEBUG_timer_runs - local timer_dt = DEBUG_timer_time - local timer_avg = (timer_n > 0 and timer_dt / timer_n) or 0 - local dt = abm_dt + timer_dt - - print("ABM ran for "..abm_dt.."µs over "..abm_n.." runs: "..abm_avg.."µs/run") - print("Timer ran for "..timer_dt.."µs over "..timer_n.." runs: "..timer_avg.."µs/run") - print("Total farming time: "..dt.."µs") - end -end local statistics = dofile(farming.path.."/statistics.lua") @@ -353,23 +321,6 @@ end) local abm_func = farming.handle_growth -if farming.DEBUG then - - local normal_abm_func = abm_func - - abm_func = function(...) - - local t0 = minetest.get_us_time() - local r = { normal_abm_func(...) } - local t1 = minetest.get_us_time() - - DEBUG_abm_runs = DEBUG_abm_runs + 1 - DEBUG_abm_time = DEBUG_abm_time + (t1 - t0) - - return unpack(r) - end -end - -- Just in case a growing type or added node is missed (also catches existing -- nodes added to map before timers were incorporated). @@ -399,8 +350,7 @@ function farming.plant_growth_timer(pos, elapsed, node_name) if stages.plant_name == "farming:cocoa" then - if not minetest.find_node_near(pos, 1, - {"default:jungletree", "moretrees:jungletree_leaves_green"}) then + if not minetest.find_node_near(pos, 1, {"default:jungletree"}) then return true end @@ -465,23 +415,6 @@ function farming.plant_growth_timer(pos, elapsed, node_name) return growth ~= max_growth end -if farming.DEBUG then - - local timer_func = farming.plant_growth_timer; - - farming.plant_growth_timer = function(pos, elapsed, node_name) - - local t0 = minetest.get_us_time() - local r = { timer_func(pos, elapsed, node_name) } - local t1 = minetest.get_us_time() - - DEBUG_timer_runs = DEBUG_timer_runs + 1 - DEBUG_timer_time = DEBUG_timer_time + (t1 - t0) - - return unpack(r) - end -end - -- refill placed plant by crabman (26/08/2015) local can_refill_plant = { ["farming:blueberry_1"] = "farming:blueberries", @@ -502,6 +435,7 @@ local can_refill_plant = { ["farming:rhubarb_1"] = "farming:rhubarb", ["farming:cocoa_1"] = "farming:cocoa_beans", ["farming:barley_1"] = "farming:seed_barley", + ["farming:hemp_1"] = "farming:seed_hemp", } function farming.refill_plant(player, plantname, index) @@ -595,7 +529,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) end end --- Function to register plants (for compatibility) +-- Function to register plants (default farming compatibility) farming.register_plant = function(name, def) @@ -680,7 +614,7 @@ farming.register_plant = function(name, def) sounds = default.node_sound_leaves_defaults(), }) --- register_plant_node(node_name) + register_plant_node(node_name) end -- Return info @@ -688,30 +622,71 @@ farming.register_plant = function(name, def) return r end --- load crops +-- default settings +farming.carrot = true +farming.potato = true +farming.tomato = true +farming.cucumber = true +farming.corn = true +farming.coffee = true +farming.coffee = true +farming.melon = true +farming.sugar = true +farming.pumpkin = true +farming.cocoa = true +farming.raspberry = true +farming.blueberry = true +farming.rhubarb = true +farming.beans = true +farming.grapes = true +farming.barley = true +farming.hemp = true +farming.donuts = true + + +-- Load new global settings if found inside mod folder +local input = io.open(farming.path.."/farming.conf", "r") +if input then + dofile(farming.path .. "/farming.conf") + input:close() + input = nil +end + +-- load new world-specific settings if found inside world folder +local worldpath = minetest.get_worldpath() +local input = io.open(worldpath.."/farming.conf", "r") +if input then + dofile(worldpath .. "/farming.conf") + input:close() + input = nil +end + + +-- load crops dofile(farming.path.."/soil.lua") dofile(farming.path.."/hoes.lua") dofile(farming.path.."/grass.lua") dofile(farming.path.."/wheat.lua") dofile(farming.path.."/cotton.lua") -dofile(farming.path.."/carrot.lua") -dofile(farming.path.."/potato.lua") -dofile(farming.path.."/tomato.lua") -dofile(farming.path.."/cucumber.lua") -dofile(farming.path.."/corn.lua") -dofile(farming.path.."/coffee.lua") -dofile(farming.path.."/melon.lua") -dofile(farming.path.."/sugar.lua") -dofile(farming.path.."/pumpkin.lua") -dofile(farming.path.."/cocoa.lua") -dofile(farming.path.."/raspberry.lua") -dofile(farming.path.."/blueberry.lua") -dofile(farming.path.."/rhubarb.lua") -dofile(farming.path.."/beanpole.lua") -dofile(farming.path.."/grapes.lua") -dofile(farming.path.."/barley.lua") -dofile(farming.path.."/donut.lua") +if farming.carrot then dofile(farming.path.."/carrot.lua") end +if farming.potato then dofile(farming.path.."/potato.lua") end +if farming.tomato then dofile(farming.path.."/tomato.lua") end +if farming.cucumber then dofile(farming.path.."/cucumber.lua") end +if farming.corn then dofile(farming.path.."/corn.lua") end +if farming.coffee then dofile(farming.path.."/coffee.lua") end +if farming.melon then dofile(farming.path.."/melon.lua") end +if farming.sugar then dofile(farming.path.."/sugar.lua") end +if farming.pumpkin then dofile(farming.path.."/pumpkin.lua") end +if farming.cocoa then dofile(farming.path.."/cocoa.lua") end +if farming.raspberry then dofile(farming.path.."/raspberry.lua") end +if farming.blueberry then dofile(farming.path.."/blueberry.lua") end +if farming.rhubarb then dofile(farming.path.."/rhubarb.lua") end +if farming.beans then dofile(farming.path.."/beanpole.lua") end +if farming.grapes then dofile(farming.path.."/grapes.lua") end +if farming.barley then dofile(farming.path.."/barley.lua") end +if farming.hemp then dofile(farming.path.."/hemp.lua") end +if farming.donuts then dofile(farming.path.."/donut.lua") end dofile(farming.path.."/mapgen.lua") dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility dofile(farming.path.."/lucky_block.lua") diff --git a/farming/locale/de.txt b/farming/locale/de.txt index 82cee4f..9b85a04 100644 --- a/farming/locale/de.txt +++ b/farming/locale/de.txt @@ -74,7 +74,7 @@ Baked Potato = Ofenkartoffel #pumpkin.lua Pumpkin = Kürbis Pumpkin Slice = Kürbisscheibe -Jack 'O Lantern = Kürbislaterne +Jack 'O Lantern (punch to turn on and off) = Kürbislaterne (Punch zum Ein- und Ausschalten) Pumpkin Bread = Kürbisbrot Pumpkin Dough = Kürbisteig diff --git a/farming/locale/template.txt b/farming/locale/template.txt index 6d067f5..3f52730 100644 --- a/farming/locale/template.txt +++ b/farming/locale/template.txt @@ -72,7 +72,7 @@ Baked Potato = #pumpkin.lua Pumpkin = Pumpkin Slice = -Jack 'O Lantern = +Jack 'O Lantern (punch to turn on and off) = Pumpkin Bread = Pumpkin Dough = diff --git a/farming/lucky_block.lua b/farming/lucky_block.lua index df5c54f..94d7d36 100644 --- a/farming/lucky_block.lua +++ b/farming/lucky_block.lua @@ -14,5 +14,6 @@ if minetest.get_modpath("lucky_block") then {"dro", {"farming:bottle_ethanol"}, 1}, {"nod", "farming:melon", 0}, {"dro", {"farming:donut", "farming:donut_chocolate", "farming:donut_apple"}, 5}, + {"dro", {"farming:hemp_leaf", "farming:hemp_fibre", "farming:seed_hemp"}, 5}, }) end diff --git a/farming/mapgen.lua b/farming/mapgen.lua index 36d4792..090c193 100644 --- a/farming/mapgen.lua +++ b/farming/mapgen.lua @@ -1,5 +1,11 @@ + -- decoration function -local function register_plant(name, min, max, spawnby, num) +local function register_plant(name, min, max, spawnby, num, enabled) + + if enabled ~= true then + return + end + minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, @@ -20,46 +26,50 @@ local function register_plant(name, min, max, spawnby, num) }) end -function farming.register_mgv6_decorations() - register_plant("potato_3", 15, 40, "", -1) - register_plant("tomato_7", 5, 20, "", -1) - register_plant("carrot_8", 1, 30, "group:water", 1) - register_plant("cucumber_4", 1, 20, "group:water", 1) - register_plant("corn_7", 12, 22, "", -1) - register_plant("corn_8", 10, 20, "", -1) - register_plant("coffee_5", 20, 45, "", -1) - register_plant("melon_8", 1, 20, "group:water", 1) - register_plant("pumpkin_8", 1, 20, "group:water", 1) - register_plant("raspberry_4", 3, 10, "", -1) - register_plant("rhubarb_3", 3, 15, "", -1) - register_plant("blueberry_4", 3, 10, "", -1) - register_plant("beanbush", 18, 35, "", -1) - register_plant("grapebush", 25, 45, "", -1) -end --- v7 maps have a beach so plants growing near water is limited to 6 high -function farming.register_mgv7_decorations() - register_plant("potato_3", 15, 40, "", -1) - register_plant("tomato_7", 5, 20, "", -1) - register_plant("carrot_8", 1, 6, "", -1) - register_plant("cucumber_4", 1, 6, "", -1) - register_plant("corn_7", 12, 22, "", -1) - register_plant("corn_8", 10, 20, "", -1) - register_plant("coffee_5", 20, 45, "", -1) - register_plant("melon_8", 1, 6, "", -1) - register_plant("pumpkin_8", 1, 6, "", -1) - register_plant("raspberry_4", 3, 10, "", -1) - register_plant("rhubarb_3", 3, 15, "", -1) - register_plant("blueberry_4", 3, 10, "", -1) - register_plant("beanbush", 18, 35, "", -1) - register_plant("grapebush", 25, 45, "", -1) -end +-- add crops to mapgen +register_plant("potato_3", 15, 40, "", -1, farming.potato) +register_plant("tomato_7", 5, 20, "", -1, farming.tomato) +register_plant("corn_7", 12, 22, "", -1, farming.corn) +register_plant("coffee_5", 20, 45, "", -1, farming.coffee) +register_plant("raspberry_4", 3, 10, "", -1, farming.raspberry) +register_plant("rhubarb_3", 3, 15, "", -1, farming.rhubarb) +register_plant("blueberry_4", 3, 10, "", -1, farming.blueberry) +register_plant("beanbush", 18, 35, "", -1, farming.beans) +register_plant("grapebush", 25, 45, "", -1, farming.grapes) + --- detect mapgen -local mg_name = minetest.get_mapgen_params().mgname +if minetest.get_mapgen_params().mgname == "v6" then -if mg_name == "v6" then - farming.register_mgv6_decorations() + register_plant("carrot_8", 1, 30, "group:water", 1, farming.carrot) + register_plant("cucumber_4", 1, 20, "group:water", 1, farming.cucumber) + register_plant("melon_8", 1, 20, "group:water", 1, farming.melon) + register_plant("pumpkin_8", 1, 20, "group:water", 1, farming.pumpkin) else - farming.register_mgv7_decorations() + -- v7 maps have a beach so plants growing near water is limited to 6 high + register_plant("carrot_8", 1, 6, "", -1, farming.carrot) + register_plant("cucumber_4", 1, 6, "", -1, farming.cucumber) + register_plant("melon_8", 1, 6, "", -1, farming.melon) + register_plant("pumpkin_8", 1, 6, "", -1, farming.pumpkin) +end + +if farming.hemp then +minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = 0.06, + spread = {x = 100, y = 100, z = 100}, + seed = 420, + octaves = 3, + persist = 0.6 + }, + y_min = 5, + y_max = 35, + decoration = "farming:hemp_7", + spawn_by = "group:tree", + num_spawn_by = 1, +}) end diff --git a/farming/pumpkin.lua b/farming/pumpkin.lua index 4be0bf4..8bff778 100644 --- a/farming/pumpkin.lua +++ b/farming/pumpkin.lua @@ -53,7 +53,7 @@ minetest.register_craft({ -- jack 'o lantern minetest.register_node("farming:jackolantern", { - description = S("Jack 'O Lantern"), + description = S("Jack 'O Lantern (punch to turn on and off)"), tiles = { "farming_pumpkin_top.png", "farming_pumpkin_top.png", diff --git a/farming/textures/farming_hemp_1.png b/farming/textures/farming_hemp_1.png Binary files differnew file mode 100644 index 0000000..6fb4510 --- /dev/null +++ b/farming/textures/farming_hemp_1.png diff --git a/farming/textures/farming_hemp_2.png b/farming/textures/farming_hemp_2.png Binary files differnew file mode 100644 index 0000000..a676173 --- /dev/null +++ b/farming/textures/farming_hemp_2.png diff --git a/farming/textures/farming_hemp_3.png b/farming/textures/farming_hemp_3.png Binary files differnew file mode 100644 index 0000000..57136d5 --- /dev/null +++ b/farming/textures/farming_hemp_3.png diff --git a/farming/textures/farming_hemp_4.png b/farming/textures/farming_hemp_4.png Binary files differnew file mode 100644 index 0000000..b375cf3 --- /dev/null +++ b/farming/textures/farming_hemp_4.png diff --git a/farming/textures/farming_hemp_5.png b/farming/textures/farming_hemp_5.png Binary files differnew file mode 100644 index 0000000..890a3d2 --- /dev/null +++ b/farming/textures/farming_hemp_5.png diff --git a/farming/textures/farming_hemp_6.png b/farming/textures/farming_hemp_6.png Binary files differnew file mode 100644 index 0000000..258d4e3 --- /dev/null +++ b/farming/textures/farming_hemp_6.png diff --git a/farming/textures/farming_hemp_7.png b/farming/textures/farming_hemp_7.png Binary files differnew file mode 100644 index 0000000..1ce3a8d --- /dev/null +++ b/farming/textures/farming_hemp_7.png diff --git a/farming/textures/farming_hemp_8.png b/farming/textures/farming_hemp_8.png Binary files differnew file mode 100644 index 0000000..8d2143f --- /dev/null +++ b/farming/textures/farming_hemp_8.png diff --git a/farming/textures/farming_hemp_fibre.png b/farming/textures/farming_hemp_fibre.png Binary files differnew file mode 100644 index 0000000..fe3c918 --- /dev/null +++ b/farming/textures/farming_hemp_fibre.png diff --git a/farming/textures/farming_hemp_leaf.png b/farming/textures/farming_hemp_leaf.png Binary files differnew file mode 100644 index 0000000..997c8f0 --- /dev/null +++ b/farming/textures/farming_hemp_leaf.png diff --git a/farming/textures/farming_hemp_oil.png b/farming/textures/farming_hemp_oil.png Binary files differnew file mode 100644 index 0000000..fa8afe2 --- /dev/null +++ b/farming/textures/farming_hemp_oil.png diff --git a/farming/textures/farming_hemp_rope.png b/farming/textures/farming_hemp_rope.png Binary files differnew file mode 100644 index 0000000..03a7082 --- /dev/null +++ b/farming/textures/farming_hemp_rope.png diff --git a/farming/textures/farming_hemp_seed.png b/farming/textures/farming_hemp_seed.png Binary files differnew file mode 100644 index 0000000..6be42c8 --- /dev/null +++ b/farming/textures/farming_hemp_seed.png diff --git a/ferns/fern.lua b/ferns/fern.lua index 51cac8f..48f9db2 100644 --- a/ferns/fern.lua +++ b/ferns/fern.lua @@ -25,7 +25,7 @@ local nodenames = {} local function create_nodes()
local images = { "ferns_fern.png", "ferns_fern_mid.png", "ferns_fern_big.png" }
- local vscales = { 1, 2, 2.2 }
+ local vscales = { 1, math.sqrt(8), math.sqrt(11) }
local descs = { "Lady-fern (Athyrium)", nil, nil }
for i = 1, 3 do
diff --git a/ferns/gianttreefern.lua b/ferns/gianttreefern.lua index f6ef9f3..512acf6 100644 --- a/ferns/gianttreefern.lua +++ b/ferns/gianttreefern.lua @@ -104,7 +104,7 @@ end minetest.register_node("ferns:tree_fern_leaves_giant", { description = "Tree Fern Crown (Dicksonia)", drawtype = "plantlike", - visual_scale = math.sqrt(8), + visual_scale = math.sqrt(11), wield_scale = {x=0.175, y=0.175, z=0.175}, paramtype = "light", tiles = {"ferns_fern_tree_giant.png"}, diff --git a/ferns/treefern.lua b/ferns/treefern.lua index 7ba44d5..01d7318 100644 --- a/ferns/treefern.lua +++ b/ferns/treefern.lua @@ -55,7 +55,7 @@ end minetest.register_node("ferns:tree_fern_leaves", { description = "Tree Fern Crown (Dicksonia)", drawtype = "plantlike", - visual_scale = 2, + visual_scale = math.sqrt(8), paramtype = "light", paramtype2 = "facedir", --tiles = {"[combine:32x32:0,0=top_left.png:0,16=bottom_left.png:16,0=top_right.png:16,16=bottom_right.png"}, @@ -89,7 +89,7 @@ minetest.register_node("ferns:tree_fern_leaves", { }) minetest.register_node("ferns:tree_fern_leaves_02", { drawtype = "plantlike", - visual_scale = 2, + visual_scale = math.sqrt(8), paramtype = "light", tiles = {"ferns_fern_big.png"}, walkable = false, diff --git a/flowers_plus/init.lua b/flowers_plus/init.lua index a80778a..06b221c 100644 --- a/flowers_plus/init.lua +++ b/flowers_plus/init.lua @@ -1,4 +1,9 @@ -local S = biome_lib.intllib +local S +if minetest.get_modpath("intllib") then + S = intllib.Getter() +else + S = function(s) return s end +end -- This file supplies a few additional plants and some related crafts -- for the plantlife modpack. Last revision: 2013-04-24 diff --git a/flowers_plus/locale/es.txt b/flowers_plus/locale/es.txt new file mode 100644 index 0000000..3496a60 --- /dev/null +++ b/flowers_plus/locale/es.txt @@ -0,0 +1,13 @@ +# Traducido por Carlos Barraza + +Waterlily = Lirio de agua +Seaweed = Algas marinas +Potted Rose = Rosa en maceta +Potted Tulip = Tulipán en maceta +Potted Yellow Dandelion = Diente de león amarillo en maceta +Potted White Dandelion = Diente de león blanco en maceta +Potted Blue Geranium = Geranio azul en maceta +Potted Viola = Viola en maceta +Flower Pot = Florero + +[Flowers] Loaded. = [Flores] Cargado. diff --git a/homedecor/bathroom_furniture.lua b/homedecor/bathroom_furniture.lua index 8980422..2f57ddb 100644 --- a/homedecor/bathroom_furniture.lua +++ b/homedecor/bathroom_furniture.lua @@ -4,11 +4,11 @@ local S = homedecor_i18n.gettext minetest.register_node("homedecor:bathroom_tiles_dark", { description = S("Bathroom/kitchen tiles (dark)"), tiles = { - { name = "homedecor_bathroom_tiles_bg.png", color = 0xff606060 }, - "homedecor_bathroom_tiles_fg.png" + "homedecor_bathroom_tiles_bg.png" + }, + overlay_tiles = { + { name = "homedecor_bathroom_tiles_fg.png", color = 0xff606060 }, }, - drawtype = "mesh", - mesh = "homedecor_block_with_overlay.obj", paramtype = "light", paramtype2 = "color", palette = "unifieddyes_palette_extended.png", @@ -23,11 +23,11 @@ minetest.register_node("homedecor:bathroom_tiles_dark", { minetest.register_node("homedecor:bathroom_tiles_medium", { description = S("Bathroom/kitchen tiles (medium)"), tiles = { - { name = "homedecor_bathroom_tiles_bg.png", color = 0xffc0c0c0 }, - "homedecor_bathroom_tiles_fg.png" + "homedecor_bathroom_tiles_bg.png" + }, + overlay_tiles = { + { name = "homedecor_bathroom_tiles_fg.png", color = 0xffc0c0c0 }, }, - drawtype = "mesh", - mesh = "homedecor_block_with_overlay.obj", paramtype = "light", paramtype2 = "color", palette = "unifieddyes_palette_extended.png", @@ -42,11 +42,11 @@ minetest.register_node("homedecor:bathroom_tiles_medium", { minetest.register_node("homedecor:bathroom_tiles_light", { description = S("Bathroom/kitchen tiles (light)"), tiles = { - { name = "homedecor_bathroom_tiles_bg.png", color = 0xffffffff }, - "homedecor_bathroom_tiles_fg.png" + "homedecor_bathroom_tiles_bg.png" + }, + overlay_tiles = { + { name = "homedecor_bathroom_tiles_fg.png", color = 0xffffffff }, }, - drawtype = "mesh", - mesh = "homedecor_block_with_overlay.obj", paramtype = "light", paramtype2 = "color", palette = "unifieddyes_palette_extended.png", diff --git a/homedecor/bedroom.lua b/homedecor/bedroom.lua index 94f886d..a5c5a4f 100644 --- a/homedecor/bedroom.lua +++ b/homedecor/bedroom.lua @@ -67,11 +67,12 @@ homedecor.register("bed_regular", { homedecor.bed_expansion(pos, clicker, itemstack, pointed_thing, true) return itemstack else --- if minetest.get_modpath("beds") then --- beds.on_rightclick(pos, clicker) --- end + if minetest.get_modpath("beds") then + beds.on_rightclick(pos, clicker) + end return itemstack end + return itemstack end }) @@ -98,13 +99,13 @@ homedecor.register("bed_extended", { unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger) homedecor.unextend_bed(pos) end, --- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) --- local itemname = itemstack:get_name() --- if minetest.get_modpath("beds") then --- beds.on_rightclick(pos, clicker) --- end --- return itemstack --- end, + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + local itemname = itemstack:get_name() + if minetest.get_modpath("beds") then + beds.on_rightclick(pos, clicker) + end + return itemstack + end, drop = "homedecor:bed_regular" }) @@ -139,13 +140,13 @@ homedecor.register("bed_kingsize", { inv:add_item("main", "homedecor:bed_regular 2") end end, --- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) --- local itemname = itemstack:get_name() --- if minetest.get_modpath("beds") then --- beds.on_rightclick(pos, clicker) --- end --- return itemstack --- end + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + local itemname = itemstack:get_name() + if minetest.get_modpath("beds") then + beds.on_rightclick(pos, clicker) + end + return itemstack + end }) for _, w in pairs({ N_("mahogany"), N_("oak") }) do diff --git a/homedecor/books.lua b/homedecor/books.lua index 9236a25..639ba8d 100644 --- a/homedecor/books.lua +++ b/homedecor/books.lua @@ -1,155 +1,159 @@ - local S = homedecor_i18n.gettext +local function N_(x) return x end + +local bookcolors = { + { N_("red"), 0xffd26466 }, + { N_("green"), 0xff62aa66 }, + { N_("blue"), 0xff8686d7 }, + { N_("violet"), 0xff9c65a7 }, + { N_("grey"), 0xff757579 }, + { N_("brown"), 0xff896958 } +} + local BOOK_FORMNAME = "homedecor:book_form" local player_current_book = { } -local function book_dig(pos, node, digger) - if minetest.is_protected(pos, digger:get_player_name()) then return end - local meta = minetest.get_meta(pos) - local data = minetest.serialize({ - title = meta:get_string("title") or "", - text = meta:get_string("text") or "", - owner = meta:get_string("owner") or "", - _recover = meta:get_string("_recover") or "", - }) - local stack = ItemStack({ - name = "homedecor:book", - metadata = data, - }) - stack = digger:get_inventory():add_item("main", stack) - if not stack:is_empty() then - minetest.item_drop(stack, digger, pos) - end - minetest.remove_node(pos) -end - -local inv_img = "homedecor_book_inv.png^homedecor_book_trim_inv.png" +for _, c in ipairs(bookcolors) do + local color, hue = unpack(c) -homedecor.register("book", { - description = S("Writable Book"), - mesh = "homedecor_book.obj", - tiles = { - "homedecor_book_cover.png", - { name = "homedecor_book_edges.png", color = 0xffffffff }, - { name = "homedecor_book_cover_trim.png", color = 0xffffffff } - }, - inventory_image = inv_img, - wield_image = inv_img, - groups = { snappy=3, oddly_breakable_by_hand=3, book=1, ud_param2_colorable = 1 }, - walkable = false, - paramtype2 = "colorwallmounted", - palette = "unifieddyes_palette_colorwallmounted.png", - after_dig_node = unifieddyes.after_dig_node, - stack_max = 1, - on_punch = function(pos, node, puncher, pointed_thing) - local fdir = node.param2 - minetest.swap_node(pos, { name = "homedecor:book_open", param2 = fdir }) - end, - on_place = function(itemstack, placer, pointed_thing) - local plname = placer:get_player_name() - local pos = pointed_thing.under - local node = minetest.get_node_or_nil(pos) - local def = node and minetest.registered_nodes[node.name] - if not def or not def.buildable_to then - pos = pointed_thing.above - node = minetest.get_node_or_nil(pos) - def = node and minetest.registered_nodes[node.name] - if not def or not def.buildable_to then return itemstack end - end - if minetest.is_protected(pos, plname) then return itemstack end - local fdir = minetest.dir_to_facedir(placer:get_look_dir()) - minetest.set_node(pos, { - name = "homedecor:book", - param2 = fdir, - }) - local text = itemstack:get_metadata() or "" + local function book_dig(pos, node, digger) + if minetest.is_protected(pos, digger:get_player_name()) then return end local meta = minetest.get_meta(pos) - local data = minetest.deserialize(text) or {} - if type(data) ~= "table" then - data = {} - -- Store raw metadata in case some data is lost by the - -- transition to the new meta format, so it is not lost - -- and can be recovered if needed. - meta:set_string("_recover", text) - end - meta:set_string("title", data.title or "") - meta:set_string("text", data.text or "") - meta:set_string("owner", data.owner or "") - if data.title and data.title ~= "" then - meta:set_string("infotext", data.title) - end - if not homedecor.expect_infinite_stacks then - itemstack:take_item() + local data = minetest.serialize({ + title = meta:get_string("title") or "", + text = meta:get_string("text") or "", + owner = meta:get_string("owner") or "", + _recover = meta:get_string("_recover") or "", + }) + local stack = ItemStack({ + name = "homedecor:book_"..color, + metadata = data, + }) + stack = digger:get_inventory():add_item("main", stack) + if not stack:is_empty() then + minetest.item_drop(stack, digger, pos) end - unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) - return itemstack - end, - on_rotate = unifieddyes.fix_after_screwdriver_nsew, - on_dig = book_dig, - selection_box = { - type = "fixed", - fixed = {-0.2, -0.5, -0.25, 0.2, -0.35, 0.25} - } -}) + minetest.remove_node(pos) + end -homedecor.register("book_open", { - mesh = "homedecor_book_open.obj", - tiles = { - "homedecor_book_cover.png", - { name = "homedecor_book_edges.png", color = 0xffffffff }, - { name = "homedecor_book_pages.png", color = 0xffffffff } - }, - groups = { snappy=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1, ud_param2_colorable = 1 }, - drop = "homedecor:book", - walkable = false, - paramtype2 = "colorwallmounted", - palette = "unifieddyes_palette_colorwallmounted.png", - after_place_node = unifieddyes.fix_rotation_nsew, - after_dig_node = unifieddyes.after_dig_node, - on_rotate = unifieddyes.fix_after_screwdriver_nsew, - on_dig = book_dig, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - local meta = minetest.get_meta(pos) - local player_name = clicker:get_player_name() - local title = meta:get_string("title") or "" - local text = meta:get_string("text") or "" - local owner = meta:get_string("owner") or "" - local formspec - if owner == "" or owner == player_name then - formspec = "size[8,8]"..default.gui_bg..default.gui_bg_img.. - "field[0.5,1;7.5,0;title;Book title :;".. - minetest.formspec_escape(title).."]".. - "textarea[0.5,1.5;7.5,7;text;Book content :;".. - minetest.formspec_escape(text).."]".. - "button_exit[2.5,7.5;3,1;save;Save]" - else - formspec = "size[8,8]"..default.gui_bg.. - "button_exit[7,0.25;1,0.5;close;X]".. - default.gui_bg_img.. - "label[0.5,0.5;by "..owner.."]".. - "label[0.5,0;"..minetest.formspec_escape(title).."]".. - "textarea[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text)..";]" - end - player_current_book[player_name] = pos - minetest.show_formspec(player_name, BOOK_FORMNAME, formspec) - return itemstack - end, - on_punch = function(pos, node, puncher, pointed_thing) - local fdir = node.param2 - minetest.swap_node(pos, { name = "homedecor:book", param2 = fdir }) - minetest.sound_play("homedecor_book_close", { - pos=pos, - max_hear_distance = 3, - gain = 2, + homedecor.register("book_"..color, { + description = S("Writable Book (@1)", S(color)), + mesh = "homedecor_book.obj", + tiles = { + { name = "homedecor_book_cover.png", color = hue }, + { name = "homedecor_book_edges.png", color = "white" } + }, + overlay_tiles = { + { name = "homedecor_book_cover_trim.png", color = "white" }, + "" + }, + groups = { snappy=3, oddly_breakable_by_hand=3, book=1 }, + walkable = false, + stack_max = 1, + on_punch = function(pos, node, puncher, pointed_thing) + local fdir = node.param2 + minetest.swap_node(pos, { name = "homedecor:book_open_"..color, param2 = fdir }) + end, + on_place = function(itemstack, placer, pointed_thing) + local plname = placer:get_player_name() + local pos = pointed_thing.under + local node = minetest.get_node_or_nil(pos) + local def = node and minetest.registered_nodes[node.name] + if not def or not def.buildable_to then + pos = pointed_thing.above + node = minetest.get_node_or_nil(pos) + def = node and minetest.registered_nodes[node.name] + if not def or not def.buildable_to then return itemstack end + end + if minetest.is_protected(pos, plname) then return itemstack end + local fdir = minetest.dir_to_facedir(placer:get_look_dir()) + minetest.set_node(pos, { + name = "homedecor:book_"..color, + param2 = fdir, }) - end, - selection_box = { - type = "fixed", - fixed = {-0.35, -0.5, -0.25, 0.35, -0.4, 0.25} - } -}) + local text = itemstack:get_metadata() or "" + local meta = minetest.get_meta(pos) + local data = minetest.deserialize(text) or {} + if type(data) ~= "table" then + data = {} + -- Store raw metadata in case some data is lost by the + -- transition to the new meta format, so it is not lost + -- and can be recovered if needed. + meta:set_string("_recover", text) + end + meta:set_string("title", data.title or "") + meta:set_string("text", data.text or "") + meta:set_string("owner", data.owner or "") + if data.title and data.title ~= "" then + meta:set_string("infotext", data.title) + end + if not homedecor.expect_infinite_stacks then + itemstack:take_item() + end + return itemstack + end, + on_dig = book_dig, + selection_box = { + type = "fixed", + fixed = {-0.2, -0.5, -0.25, 0.2, -0.35, 0.25} + } + }) + + homedecor.register("book_open_"..color, { + mesh = "homedecor_book_open.obj", + tiles = { + { name = "homedecor_book_cover.png", color = hue }, + { name = "homedecor_book_edges.png", color = "white" }, + { name = "homedecor_book_pages.png", color = "white" } + }, + groups = { snappy=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1 }, + drop = "homedecor:book_"..color, + walkable = false, + on_dig = book_dig, + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + local meta = minetest.get_meta(pos) + local player_name = clicker:get_player_name() + local title = meta:get_string("title") or "" + local text = meta:get_string("text") or "" + local owner = meta:get_string("owner") or "" + local formspec + if owner == "" or owner == player_name then + formspec = "size[8,8]"..default.gui_bg..default.gui_bg_img.. + "field[0.5,1;7.5,0;title;Book title :;".. + minetest.formspec_escape(title).."]".. + "textarea[0.5,1.5;7.5,7;text;Book content :;".. + minetest.formspec_escape(text).."]".. + "button_exit[2.5,7.5;3,1;save;Save]" + else + formspec = "size[8,8]"..default.gui_bg.. + "button_exit[7,0.25;1,0.5;close;X]".. + default.gui_bg_img.. + "label[0.5,0.5;by "..owner.."]".. + "label[0.5,0;"..minetest.formspec_escape(title).."]".. + "textarea[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text)..";]" + end + player_current_book[player_name] = pos + minetest.show_formspec(player_name, BOOK_FORMNAME, formspec) + return itemstack + end, + on_punch = function(pos, node, puncher, pointed_thing) + local fdir = node.param2 + minetest.swap_node(pos, { name = "homedecor:book_"..color, param2 = fdir }) + minetest.sound_play("homedecor_book_close", { + pos=pos, + max_hear_distance = 3, + gain = 2, + }) + end, + selection_box = { + type = "fixed", + fixed = {-0.35, -0.5, -0.25, 0.35, -0.4, 0.25} + } + }) + +end minetest.register_on_player_receive_fields(function(player, form_name, fields) if form_name ~= BOOK_FORMNAME or not fields.save then @@ -169,67 +173,5 @@ minetest.register_on_player_receive_fields(function(player, form_name, fields) player:get_player_name(), fields.title, fields.text, minetest.pos_to_string(player:getpos()))) end) --- convert old static nodes to param2 - -local bookcolors = { - "red", - "green", - "blue", - "violet", - "grey", - "brown" -} - -homedecor.old_static_books = {} -for _, color in ipairs(bookcolors) do - table.insert(homedecor.old_static_books, "homedecor:book_"..color) - table.insert(homedecor.old_static_books, "homedecor:book_open_"..color) -end - -minetest.register_lbm({ - name = "homedecor:convert_books", - label = "Convert homedecor books to use param2 color", - run_at_every_load = false, - nodenames = homedecor.old_static_books, - action = function(pos, node) - local name = node.name - local color = string.sub(name, string.find(name, "_", -7)+1) - local newname = "homedecor:book" - if string.find(name, "open") then - newname = "homedecor:book_open" - end - - local old_fdir = math.floor(node.param2 % 32) - local new_fdir = 3 - - if old_fdir == 0 then - new_fdir = 3 - elseif old_fdir == 1 then - new_fdir = 4 - elseif old_fdir == 2 then - new_fdir = 2 - elseif old_fdir == 3 then - new_fdir = 5 - end - - if color == "grey" then - color = "dark_grey" - elseif color == "violet" then - color = "dark_magenta" - elseif color == "brown" then - color = "dark_orange" - elseif color == "blue" then - color = "light_blue" - else - color = "medium_"..color - end - - local paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted") - local param2 = paletteidx + new_fdir - - minetest.swap_node(pos, { name = newname, param2 = param2 }) - local meta = minetest.get_meta(pos) - meta:set_string("dye", "unifieddyes:"..color) - - end -}) +minetest.register_alias("homedecor:book", "homedecor:book_grey") +minetest.register_alias("homedecor:book_open", "homedecor:book_open_grey") diff --git a/homedecor/init.lua b/homedecor/init.lua index 666724c..f845c79 100644 --- a/homedecor/init.lua +++ b/homedecor/init.lua @@ -15,7 +15,7 @@ homedecor = { modpath = modpath, -- infinite stacks - expect_infinite_stacks = minetest.setting_getbool("creative_mode") and not minetest.get_modpath("unified_inventory") + expect_infinite_stacks = minetest.settings:get_bool("creative_mode") and not minetest.get_modpath("unified_inventory") } -- Determine if the item being pointed at is the underside of a node (e.g a ceiling) diff --git a/homedecor/lighting.lua b/homedecor/lighting.lua index 7dd504e..cca06b7 100644 --- a/homedecor/lighting.lua +++ b/homedecor/lighting.lua @@ -21,6 +21,15 @@ minetest.register_node("homedecor:glowlight_half", { "homedecor_glowlight_thick_sides.png", "homedecor_glowlight_thick_sides.png" }, + overlay_tiles = { + { name = "homedecor_glowlight_top_overlay.png", color = "white"}, + "", + { name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"}, + { name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"}, + { name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"}, + { name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"}, + }, + use_texture_alpha = true, drawtype = "nodebox", paramtype = "light", paramtype2 = "colorwallmounted", @@ -52,6 +61,15 @@ minetest.register_node("homedecor:glowlight_quarter", { "homedecor_glowlight_thin_sides.png", "homedecor_glowlight_thin_sides.png" }, + overlay_tiles = { + { name = "homedecor_glowlight_top_overlay.png", color = "white"}, + "", + { name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"}, + { name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"}, + { name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"}, + { name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"}, + }, + use_texture_alpha = true, drawtype = "nodebox", paramtype = "light", paramtype2 = "colorwallmounted", @@ -83,6 +101,15 @@ minetest.register_node("homedecor:glowlight_small_cube", { "homedecor_glowlight_cube_sides.png", "homedecor_glowlight_cube_sides.png" }, + overlay_tiles = { + { name = "homedecor_glowlight_cube_tb_overlay.png", color = "white"}, + { name = "homedecor_glowlight_cube_tb_overlay.png", color = "white"}, + { name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"}, + { name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"}, + { name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"}, + { name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"}, + }, + use_texture_alpha = true, paramtype = "light", paramtype2 = "colorwallmounted", drawtype = "nodebox", @@ -106,9 +133,10 @@ minetest.register_node("homedecor:glowlight_small_cube", { homedecor.register("plasma_lamp", { description = S("Plasma Lamp"), - drawtype = "glasslike_framed", - tiles = {"default_gold_block.png","homedecor_glass_face_clean.png"}, - special_tiles = { + drawtype = "mesh", + mesh = "plasma_lamp.obj", + tiles = { + "default_gold_block.png", { name="homedecor_plasma_storm.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}, @@ -119,16 +147,13 @@ homedecor.register("plasma_lamp", { sunlight_propagates = true, groups = {cracky=3,oddly_breakable_by_hand=3}, sounds = default.node_sound_glass_defaults(), - after_place_node = function(pos, placer, itemstack, pointed_thing) - minetest.swap_node(pos, {name = "homedecor:plasma_lamp", param2 = 255}) - end }) homedecor.register("plasma_ball", { description = S("Plasma Ball"), mesh = "homedecor_plasma_ball.obj", tiles = { - "homedecor_generic_plastic.png", + { name = "homedecor_generic_plastic.png", color = homedecor.color_black }, { name = "homedecor_plasma_ball_streamers.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}, diff --git a/homedecor/models/homedecor_book.obj b/homedecor/models/homedecor_book.obj index c7a3af7..5c40342 100644 --- a/homedecor/models/homedecor_book.obj +++ b/homedecor/models/homedecor_book.obj @@ -1,243 +1,206 @@ -# Blender v2.72 (sub 0) OBJ File: 'book.blend' +# Blender v2.78 (sub 0) OBJ File: 'book.blend' # www.blender.org o Cube.002_Cube.001 -v -0.216625 -0.161995 -0.448008 -v -0.216625 -0.149566 -0.485966 -v -0.216625 -0.113157 -0.485966 -v -0.216625 -0.142021 -0.448008 -v -0.208120 -0.115781 -0.485966 -v -0.208120 -0.142021 -0.448008 -v 0.220555 -0.113157 -0.485966 -v 0.220555 0.159347 -0.485966 -v 0.212050 -0.115781 -0.485966 -v -0.208120 -0.161995 -0.448008 -v -0.208120 0.148926 -0.485966 -v -0.208120 0.155653 -0.448008 -v 0.212051 0.155653 -0.448008 -v 0.212051 0.148926 -0.485966 -v -0.208120 -0.152482 -0.485966 -v 0.212050 -0.152482 -0.485966 -v 0.220555 -0.161995 -0.448008 -v 0.212050 -0.161995 -0.448008 -v 0.212050 -0.145193 -0.500002 -v -0.208120 -0.145193 -0.500002 -v -0.208120 -0.115781 -0.500002 -v 0.212050 -0.115781 -0.500002 -v 0.212050 -0.115781 -0.396013 -v -0.208120 -0.115781 -0.396013 -v -0.208120 -0.145193 -0.396013 -v 0.212050 -0.145193 -0.396013 -v 0.212050 -0.152482 -0.410049 -v -0.208120 -0.152482 -0.410049 -v 0.212051 0.148926 -0.410049 -v -0.208120 0.148926 -0.410049 -v 0.212050 -0.115781 -0.410049 -v 0.220555 0.159347 -0.410049 -v 0.220555 -0.113157 -0.410049 -v -0.208120 -0.115781 -0.410049 -v -0.216625 -0.113157 -0.410049 -v -0.216625 -0.149566 -0.410049 -v -0.216625 -0.115781 -0.396013 -v -0.216625 -0.141549 -0.396013 -v 0.220555 -0.149566 -0.410049 -v 0.220555 -0.141549 -0.396013 -v 0.220555 0.159346 -0.396013 -v -0.216624 0.159347 -0.396013 -v 0.220555 -0.115781 -0.396013 -v -0.216624 0.159347 -0.410049 -v -0.216625 -0.115781 -0.500002 -v -0.216625 -0.141549 -0.500002 -v 0.212050 -0.142021 -0.448008 -v 0.220555 -0.149566 -0.485966 -v 0.220555 -0.141549 -0.500002 -v 0.220555 0.159346 -0.500002 -v -0.216624 0.159347 -0.500002 -v 0.220555 -0.142021 -0.448008 -v 0.220555 -0.115781 -0.500002 -v -0.216624 0.159347 -0.485966 -v -0.216625 -0.162729 -0.448008 -v -0.216625 -0.150269 -0.486432 -v -0.208120 -0.162729 -0.448008 -v -0.208120 -0.153192 -0.486432 -v 0.212050 -0.153192 -0.486432 -v 0.220555 -0.162729 -0.448008 -v 0.212050 -0.162729 -0.448008 -v 0.212050 -0.145885 -0.500640 -v -0.208120 -0.145885 -0.500640 -v -0.208120 -0.116399 -0.500640 -v 0.212050 -0.116399 -0.500640 -v 0.212050 -0.116399 -0.395375 -v -0.208120 -0.116399 -0.395375 -v -0.208120 -0.145885 -0.395375 -v 0.212050 -0.145885 -0.395375 -v 0.212050 -0.153192 -0.409583 -v -0.208120 -0.153192 -0.409583 -v -0.216625 -0.150269 -0.409583 -v -0.216625 -0.116399 -0.395375 -v -0.216625 -0.142232 -0.395375 -v 0.220555 -0.150269 -0.409583 -v 0.220555 -0.142232 -0.395375 -v 0.220555 0.159416 -0.395375 -v -0.216624 0.159417 -0.395375 -v 0.220555 -0.116399 -0.395375 -v -0.216625 -0.116399 -0.500640 -v -0.216625 -0.142232 -0.500640 -v 0.220555 -0.150269 -0.486432 -v 0.220555 -0.142232 -0.500640 -v 0.220555 0.159416 -0.500640 -v -0.216624 0.159417 -0.500640 -v 0.220555 -0.116399 -0.500640 -vt 0.921987 0.383861 -vt 0.921987 0.340448 -vt 0.931829 0.340448 -vt 0.931829 0.383861 -vt 0.931829 0.427274 -vt 0.921987 0.427274 -vt 0.768089 0.490273 -vt 0.722954 0.490273 -vt 0.722954 0.009727 -vt 0.768089 0.009727 -vt 0.768089 0.500000 -vt 0.722404 0.500000 -vt 0.809636 0.490273 -vt 0.809086 0.500000 -vt 0.352434 0.000000 -vt 0.670829 0.000000 -vt 0.670829 0.009727 -vt 0.670829 0.490273 -vt 0.670829 0.500000 -vt 0.352433 0.499999 -vt 0.809636 0.009727 -vt 0.809086 0.000000 -vt 0.823601 0.000000 -vt 0.824288 0.009727 -vt 0.012060 0.509727 -vt 0.000000 0.500001 -vt 0.315359 0.500000 -vt 0.318396 0.509727 -vt 0.700649 0.000000 -vt 0.704866 0.009727 -vt 0.731001 0.867517 -vt 0.731001 0.844673 -vt 0.774928 0.811661 -vt 0.774928 0.853302 -vt 0.687072 0.853302 -vt 0.687072 0.811661 -vt 0.774928 0.500000 -vt 0.791171 0.500000 -vt 0.791171 0.814662 -vt 0.791171 0.844133 -vt 0.851343 0.522844 -vt 0.851343 0.500000 -vt 0.895271 0.514215 -vt 0.895271 0.555856 -vt 0.912144 0.383862 -vt 0.912144 0.340448 -vt 0.334639 0.500000 -vt 0.334639 0.999999 -vt 0.318396 0.999999 -vt 0.318396 0.500000 -vt 0.895271 0.867517 -vt 0.911514 0.523384 -vt 0.911514 0.552855 -vt 0.911514 0.867516 -vt 0.824288 0.490273 -vt 0.823601 0.500000 -vt 0.807415 0.555856 -vt 0.807415 0.514215 -vt 0.768089 0.000000 -vt 0.722404 0.000000 -vt 0.912144 0.427274 -vt 0.318396 0.990273 -vt 0.315359 1.000000 -vt 0.000000 1.000000 -vt 0.012060 0.990274 -vt 0.704866 0.490273 -vt 0.318396 0.490273 -vt 0.318396 0.009727 -vt 0.352433 0.009727 -vt 0.352433 0.490273 -vt 0.705553 0.490273 -vt 0.705553 0.009727 -vt 0.670829 0.509727 -vt 0.364493 0.509726 -vt 0.667792 0.500000 -vt 0.318396 0.000000 -vt 0.348216 0.000000 -vt 0.704866 0.500000 -vt 0.807415 0.867517 -vt 0.791172 0.867516 -vt 0.791171 0.552855 -vt 0.791171 0.523384 -vt 0.336190 0.500000 -vt 0.352433 0.999999 -vt 0.336190 0.999999 -vt 0.670829 0.844133 -vt 0.670829 0.814662 -vt 0.687072 0.500000 -vt 0.348216 0.500000 -vt 0.364493 0.990273 -vt 0.670829 0.990273 -vt 0.667792 1.000000 -vt 0.704866 0.000000 -vt 0.000000 0.000001 -vt 0.668539 0.639838 -vt 0.640677 0.639838 -vt 0.640677 0.630641 -vt 0.672479 0.630641 -vt 0.439305 1.000000 -vt 0.439305 0.319104 -vt 0.527160 0.379125 -vt 0.527160 0.984613 -vt 0.087857 1.000000 -vt 0.087857 0.319104 -vt 0.175712 0.334491 -vt 0.175712 0.939979 -vt 0.351448 0.984613 -vt 0.351448 0.379125 -vt 0.000000 0.939979 -vt 0.000000 0.334491 -vt 0.351448 0.000000 -vt 0.351448 0.961094 -vt 0.263593 0.961094 -vt 0.263593 0.000000 -vt 0.175736 0.000000 -vt 0.175736 0.961094 -vn -0.123900 0.803100 -0.582900 -vn -0.123900 0.803000 0.582900 -vn 0.000000 -0.970000 0.243100 -vn 0.162500 -0.947900 0.274000 -vn 0.162500 -0.947900 -0.274000 -vn 0.000000 0.000000 -1.000000 -vn -0.320700 -0.831600 -0.453400 -vn 0.000000 -0.000000 1.000000 -vn -1.000000 0.000000 0.000000 -vn 1.000000 0.000000 0.000000 -vn 0.123900 0.803100 -0.582900 -vn 0.000000 1.000000 -0.000000 -vn 0.320700 -0.831600 -0.453400 -vn -0.162500 -0.947900 -0.274000 -vn 0.000000 -0.970000 -0.243100 -vn -0.162500 -0.947900 0.274000 -vn 0.123900 0.803000 0.582900 -vn 0.000000 -0.887500 -0.460900 -vn 0.000000 -0.887500 0.460900 -vn 0.320700 -0.831600 0.453400 -vn -0.320700 -0.831600 0.453400 -vn 0.000000 0.984700 -0.174500 -vn -0.000000 0.984700 0.174500 -vn 0.000000 -0.970600 0.240900 -vn 0.163000 -0.948500 0.271500 -vn 0.163000 -0.948500 -0.271500 -vn -0.322100 -0.833000 -0.449800 -vn 0.322100 -0.833000 -0.449800 -vn -0.163000 -0.948500 -0.271500 -vn 0.000000 -0.970600 -0.240900 -vn -0.163000 -0.948500 0.271500 -vn 0.000000 -0.889300 -0.457400 -vn 0.000000 -0.889300 0.457400 -vn 0.322100 -0.833000 0.449800 -vn -0.322100 -0.833000 0.449800 +v 0.161995 -0.448008 0.216625 +v 0.149566 -0.485966 0.216625 +v 0.113157 -0.485966 0.216625 +v 0.142021 -0.448008 0.216625 +v 0.115781 -0.485966 0.208120 +v 0.142021 -0.448008 0.208120 +v 0.113157 -0.485966 -0.220555 +v -0.159347 -0.485966 -0.220555 +v 0.115781 -0.485966 -0.212050 +v 0.161995 -0.448008 0.208120 +v -0.148926 -0.485966 0.208120 +v -0.155653 -0.448008 0.208120 +v -0.155653 -0.448008 -0.212051 +v -0.148926 -0.485966 -0.212051 +v 0.152482 -0.485966 0.208120 +v 0.152482 -0.485966 -0.212050 +v 0.161995 -0.448008 -0.220555 +v 0.161995 -0.448008 -0.212050 +v 0.145193 -0.500002 -0.212050 +v 0.145193 -0.500002 0.208120 +v 0.115781 -0.500002 0.208120 +v 0.115781 -0.500002 -0.212050 +v 0.115781 -0.396013 -0.212050 +v 0.115781 -0.396013 0.208120 +v 0.145193 -0.396013 0.208120 +v 0.145193 -0.396013 -0.212050 +v 0.152482 -0.410049 -0.212050 +v 0.152482 -0.410049 0.208120 +v -0.148926 -0.410049 -0.212051 +v -0.148926 -0.410049 0.208120 +v 0.115781 -0.410049 -0.212050 +v -0.159347 -0.410049 -0.220555 +v 0.113157 -0.410049 -0.220555 +v 0.115781 -0.410049 0.208120 +v 0.113157 -0.410049 0.216625 +v 0.149566 -0.410049 0.216625 +v 0.115781 -0.396013 0.216625 +v 0.141549 -0.396013 0.216625 +v 0.149566 -0.410049 -0.220555 +v 0.141549 -0.396013 -0.220555 +v -0.159346 -0.396013 -0.220555 +v -0.159347 -0.396013 0.216624 +v 0.115781 -0.396013 -0.220555 +v -0.159347 -0.410049 0.216624 +v 0.115781 -0.500002 0.216625 +v 0.141549 -0.500002 0.216625 +v 0.142021 -0.448008 -0.212050 +v 0.149566 -0.485966 -0.220555 +v 0.141549 -0.500002 -0.220555 +v -0.159346 -0.500002 -0.220555 +v -0.159347 -0.500002 0.216624 +v 0.142021 -0.448008 -0.220555 +v 0.115781 -0.500002 -0.220555 +v -0.159347 -0.485966 0.216624 +vt 0.9220 0.3839 +vt 0.9220 0.3404 +vt 0.9318 0.3404 +vt 0.9318 0.3839 +vt 0.9318 0.4273 +vt 0.9220 0.4273 +vt 0.7681 0.4903 +vt 0.7230 0.4903 +vt 0.7230 0.0097 +vt 0.7681 0.0097 +vt 0.7681 0.5000 +vt 0.7224 0.5000 +vt 0.8096 0.4903 +vt 0.8091 0.5000 +vt 0.3524 0.0000 +vt 0.6708 0.0000 +vt 0.6708 0.0097 +vt 0.6708 0.4903 +vt 0.6708 0.5000 +vt 0.3524 0.5000 +vt 0.8096 0.0097 +vt 0.8091 0.0000 +vt 0.8236 0.0000 +vt 0.8243 0.0097 +vt 0.0121 0.5097 +vt 0.0000 0.5000 +vt 0.3154 0.5000 +vt 0.3184 0.5097 +vt 0.7006 0.0000 +vt 0.7049 0.0097 +vt 0.7310 0.8675 +vt 0.7310 0.8447 +vt 0.7749 0.8117 +vt 0.7749 0.8533 +vt 0.6871 0.8533 +vt 0.6871 0.8117 +vt 0.7749 0.5000 +vt 0.7912 0.5000 +vt 0.7912 0.8147 +vt 0.7912 0.8441 +vt 0.8513 0.5228 +vt 0.8513 0.5000 +vt 0.8953 0.5142 +vt 0.8953 0.5559 +vt 0.9220 0.3404 +vt 0.9220 0.3839 +vt 0.9121 0.3839 +vt 0.9121 0.3404 +vt 0.3346 0.5000 +vt 0.3346 1.0000 +vt 0.3184 1.0000 +vt 0.3184 0.5000 +vt 0.8953 0.8675 +vt 0.9115 0.5234 +vt 0.9115 0.5529 +vt 0.9115 0.8675 +vt 0.8243 0.4903 +vt 0.8236 0.5000 +vt 0.8074 0.5559 +vt 0.8074 0.5142 +vt 0.7681 0.0000 +vt 0.7224 0.0000 +vt 0.9220 0.4273 +vt 0.9121 0.4273 +vt 0.3184 0.9903 +vt 0.3154 1.0000 +vt 0.0000 1.0000 +vt 0.0121 0.9903 +vt 0.7049 0.4903 +vt 0.3184 0.4903 +vt 0.3184 0.0097 +vt 0.3524 0.0097 +vt 0.3524 0.4903 +vt 0.7056 0.4903 +vt 0.7056 0.0097 +vt 0.6708 0.5097 +vt 0.3645 0.5097 +vt 0.3524 0.5000 +vt 0.6678 0.5000 +vt 0.3184 0.0000 +vt 0.3482 0.0000 +vt 0.7049 0.5000 +vt 0.8074 0.8675 +vt 0.7912 0.8675 +vt 0.7912 0.5529 +vt 0.7912 0.5234 +vt 0.3362 0.5000 +vt 0.3524 1.0000 +vt 0.3362 1.0000 +vt 0.6708 0.8441 +vt 0.6708 0.8147 +vt 0.6708 0.5000 +vt 0.6871 0.5000 +vt 0.3482 0.5000 +vt 0.3184 0.5000 +vt 0.3645 0.9903 +vt 0.6708 0.9903 +vt 0.6678 1.0000 +vt 0.7049 0.0000 +vt 0.0000 0.5000 +vt 0.0000 0.0000 +vt 0.6685 0.6398 +vt 0.6407 0.6398 +vt 0.6407 0.6306 +vt 0.6725 0.6306 +vt 0.4393 1.0000 +vt 0.4393 0.3191 +vt 0.5272 0.3791 +vt 0.5272 0.9846 +vt 0.0879 1.0000 +vt 0.0879 0.3191 +vt 0.1757 0.3345 +vt 0.1757 0.9400 +vt 0.3514 0.9846 +vt 0.3514 0.3791 +vt 0.0000 0.9400 +vt 0.0000 0.3345 +vt 0.3514 0.0000 +vt 0.3514 0.9611 +vt 0.2636 0.9611 +vt 0.2636 0.0000 +vt 0.1757 0.0000 +vt 0.1757 0.9611 +vn -0.8031 -0.5829 0.1239 +vn -0.8030 0.5829 0.1239 +vn 0.9700 0.2431 -0.0000 +vn 0.9479 0.2740 -0.1625 +vn 0.9479 -0.2740 -0.1625 +vn -0.0000 -1.0000 -0.0000 +vn 0.8316 -0.4534 0.3207 +vn 0.0000 1.0000 -0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 0.0000 -1.0000 +vn -0.8031 -0.5829 -0.1239 +vn -1.0000 -0.0000 -0.0000 +vn 0.8316 -0.4534 -0.3207 +vn 0.9479 -0.2740 0.1625 +vn 0.9700 -0.2431 -0.0000 +vn 0.9479 0.2740 0.1625 +vn -0.8030 0.5829 -0.1239 +vn 0.8875 -0.4609 -0.0000 +vn 0.8875 0.4609 -0.0000 +vn 0.8316 0.4534 -0.3207 +vn 0.8316 0.4534 0.3207 +vn -0.9847 -0.1745 0.0000 +vn -0.9847 0.1745 0.0000 g Cube.002_Cube.001_Cube.002_Cube.001_cover s off f 47/1/1 31/2/1 33/3/1 52/4/1 @@ -253,58 +216,37 @@ f 1/31/9 4/32/9 3/33/9 2/34/9 f 1/31/9 36/35/9 35/36/9 4/32/9 f 2/34/9 3/33/9 54/37/9 51/38/9 45/39/9 46/40/9 f 52/41/10 17/42/10 48/43/10 7/44/10 -f 34/2/11 6/1/11 4/45/11 35/46/11 -f 50/47/12 51/48/12 54/49/12 8/50/12 -f 8/51/10 7/44/10 48/43/10 49/52/10 53/53/10 50/54/10 -f 19/55/13 49/56/13 48/14/13 16/13/13 -f 52/41/10 33/57/10 39/58/10 17/42/10 -f 10/10/14 1/59/14 2/22/14 15/21/14 +f 34/45/11 6/46/11 4/47/11 35/48/11 +f 50/49/12 51/50/12 54/51/12 8/52/12 +f 8/53/10 7/44/10 48/43/10 49/54/10 53/55/10 50/56/10 +f 19/57/13 49/58/13 48/14/13 16/13/13 +f 52/41/10 33/59/10 39/60/10 17/42/10 +f 10/10/14 1/61/14 2/22/14 15/21/14 f 18/7/15 10/10/15 15/21/15 16/13/15 -f 10/10/16 28/9/16 36/60/16 1/59/16 -f 5/6/17 3/61/17 4/45/17 6/1/17 -f 9/62/8 7/63/8 8/64/8 14/65/8 -f 16/13/18 15/21/18 20/24/18 19/55/18 -f 22/17/6 19/30/6 20/66/6 21/18/6 -f 23/67/8 24/68/8 25/69/8 26/70/8 -f 27/8/19 26/71/19 25/72/19 28/9/19 -f 31/73/6 29/74/6 32/20/6 33/75/6 -f 25/69/8 24/68/8 37/76/8 38/77/8 -f 26/71/20 27/8/20 39/12/20 40/78/20 -f 32/79/10 41/80/10 43/81/10 40/82/10 39/58/10 33/57/10 -f 41/83/12 32/20/12 44/84/12 42/85/12 -f 36/35/9 38/86/9 37/87/9 42/19/9 44/88/9 35/36/9 -f 23/67/8 26/70/8 40/89/8 43/50/8 -f 30/90/6 34/91/6 35/92/6 44/84/6 -f 28/9/21 25/72/21 38/93/21 36/60/21 -f 29/74/6 30/90/6 44/84/6 32/20/6 -f 41/26/8 42/94/8 37/76/8 24/68/8 23/67/8 43/50/8 -f 54/26/8 11/25/8 14/65/8 8/64/8 -f 46/95/6 45/96/6 21/97/6 20/98/6 +f 10/10/16 28/9/16 36/62/16 1/61/16 +f 5/63/17 3/64/17 4/47/17 6/46/17 +f 9/65/8 7/66/8 8/67/8 14/68/8 +f 16/13/18 15/21/18 20/24/18 19/57/18 +f 22/17/6 19/30/6 20/69/6 21/18/6 +f 23/70/8 24/71/8 25/72/8 26/73/8 +f 27/8/19 26/74/19 25/75/19 28/9/19 +f 31/76/6 29/77/6 32/78/6 33/79/6 +f 25/72/8 24/71/8 37/80/8 38/81/8 +f 26/74/20 27/8/20 39/12/20 40/82/20 +f 32/83/10 41/84/10 43/85/10 40/86/10 39/60/10 33/59/10 +f 41/87/12 32/78/12 44/88/12 42/89/12 +f 36/35/9 38/90/9 37/91/9 42/92/9 44/93/9 35/36/9 +f 23/70/8 26/73/8 40/94/8 43/95/8 +f 30/96/6 34/97/6 35/98/6 44/88/6 +f 28/9/21 25/75/21 38/99/21 36/62/21 +f 29/77/6 30/96/6 44/88/6 32/78/6 +f 41/100/8 42/101/8 37/80/8 24/71/8 23/70/8 43/95/8 +f 54/26/8 11/25/8 14/68/8 8/67/8 +f 46/102/6 45/103/6 21/104/6 20/105/6 g Cube.002_Cube.001_Cube.002_Cube.001_edges -f 13/99/10 47/100/10 9/101/10 14/102/10 -f 6/103/9 12/104/9 11/105/9 5/106/9 -f 13/99/10 29/107/10 31/108/10 47/100/10 -f 6/103/9 34/109/9 30/110/9 12/104/9 -f 14/111/22 11/112/22 12/113/22 13/114/22 -f 29/115/23 13/114/23 12/113/23 30/116/23 -g Cube.002_Cube.001_Cube.002_Cube.001_trim -f 61/7/24 70/8/24 71/9/24 57/10/24 -f 70/8/25 61/7/25 60/11/25 75/12/25 -f 59/13/26 82/14/26 60/11/26 61/7/26 -f 84/15/6 86/16/6 65/17/6 64/18/6 80/19/6 85/20/6 -f 58/21/27 56/22/27 81/23/27 63/24/27 -f 65/17/6 86/16/6 83/29/6 62/30/6 -f 62/55/28 83/56/28 82/14/28 59/13/28 -f 57/10/29 55/59/29 56/22/29 58/21/29 -f 61/7/30 57/10/30 58/21/30 59/13/30 -f 57/10/31 71/9/31 72/60/31 55/59/31 -f 59/13/32 58/21/32 63/24/32 62/55/32 -f 65/17/6 62/30/6 63/66/6 64/18/6 -f 66/67/8 67/68/8 68/69/8 69/70/8 -f 70/8/33 69/71/33 68/72/33 71/9/33 -f 68/69/8 67/68/8 73/76/8 74/77/8 -f 69/71/34 70/8/34 75/12/34 76/78/34 -f 66/67/8 69/70/8 76/89/8 79/50/8 -f 71/9/35 68/72/35 74/93/35 72/60/35 -f 77/26/8 78/94/8 73/76/8 67/68/8 66/67/8 79/50/8 -f 81/95/6 80/96/6 64/97/6 63/98/6 +f 13/106/10 47/107/10 9/108/10 14/109/10 +f 6/110/9 12/111/9 11/112/9 5/113/9 +f 13/106/10 29/114/10 31/115/10 47/107/10 +f 6/110/9 34/116/9 30/117/9 12/111/9 +f 14/118/22 11/119/22 12/120/22 13/121/22 +f 29/122/23 13/121/23 12/120/23 30/123/23 diff --git a/homedecor/models/homedecor_book_open.obj b/homedecor/models/homedecor_book_open.obj index ab2c1b3..3e81ef2 100644 --- a/homedecor/models/homedecor_book_open.obj +++ b/homedecor/models/homedecor_book_open.obj @@ -1,327 +1,335 @@ -# Blender v2.72 (sub 0) OBJ File: 'book-open.blend' +# Blender v2.78 (sub 0) OBJ File: 'book-open.blend' # www.blender.org o Cube.002_Cube.001 -v -0.216625 0.012428 -0.485966 -v 0.220555 -0.000000 -0.486750 -v 0.220555 0.321341 -0.485966 -v -0.208120 -0.000001 -0.462863 -v -0.208120 0.310920 -0.485966 -v -0.208120 0.306022 -0.464409 -v 0.212051 0.306022 -0.464409 -v 0.212051 0.310921 -0.485966 -v 0.212050 -0.000000 -0.462862 -v 0.212050 0.016802 -0.500002 -v -0.208120 0.016801 -0.500002 -v -0.208120 0.046213 -0.500002 -v 0.212050 0.046214 -0.500002 -v -0.216625 0.046213 -0.500002 -v -0.216625 0.020445 -0.500002 -v 0.220555 0.012429 -0.485966 -v 0.220555 0.020446 -0.500002 -v 0.220555 0.321340 -0.500002 -v -0.216624 0.321341 -0.500002 -v 0.220555 0.046214 -0.500002 -v -0.216624 0.321341 -0.485966 -v -0.208120 0.238235 -0.450057 -v -0.216625 -0.000001 -0.486750 -v 0.212051 0.238236 -0.450057 -v -0.208120 -0.306023 -0.464409 -v 0.212051 -0.306023 -0.464409 -v -0.208120 -0.238237 -0.450057 -v 0.212051 -0.238237 -0.450057 -v 0.212050 -0.046214 -0.500003 -v -0.208120 -0.046215 -0.500003 -v -0.208120 -0.016803 -0.500003 -v 0.212050 -0.016803 -0.500003 -v -0.216625 -0.000001 -0.481442 -v 0.220555 -0.000000 -0.481442 -v 0.212051 -0.310922 -0.485967 -v -0.208120 -0.310922 -0.485967 -v 0.220555 -0.321342 -0.485967 -v -0.216625 -0.012430 -0.485967 -v -0.216625 -0.046215 -0.500003 -v -0.216625 -0.020447 -0.500003 -v 0.220555 -0.012429 -0.485967 -v 0.220555 -0.020446 -0.500003 -v 0.220555 -0.321341 -0.500003 -v -0.216624 -0.321343 -0.500003 -v 0.220555 -0.046214 -0.500003 -v -0.216624 -0.321343 -0.485967 -v -0.208120 -0.000001 -0.486750 -v 0.212050 -0.000000 -0.486750 -v 0.212051 -0.086920 -0.442244 -v -0.208120 -0.086920 -0.442244 -v 0.212051 0.086847 -0.442244 -v -0.208120 0.086847 -0.442244 -v 0.212050 0.043405 -0.447755 -v -0.208120 0.043405 -0.447755 -v 0.212050 -0.043478 -0.447755 -v -0.208120 -0.043478 -0.447755 -v -0.216625 -0.010224 -0.490836 -v -0.216625 0.006214 -0.482857 -v 0.220555 0.006214 -0.482857 -v -0.208120 0.008400 -0.490836 -v 0.212050 0.008401 -0.490836 -v 0.220555 0.010223 -0.490836 -v -0.216625 0.010222 -0.490836 -v 0.220555 -0.010223 -0.490836 -v 0.212050 -0.008401 -0.490836 -v -0.208120 -0.008402 -0.490836 -v 0.220555 -0.006215 -0.482858 -v -0.216625 -0.006215 -0.482858 -v 0.212050 0.012429 -0.485966 -v 0.212050 -0.000000 -0.481442 -v 0.212050 -0.012429 -0.485967 -v 0.212050 0.006214 -0.482857 -v 0.212050 -0.006215 -0.482858 -v -0.208120 0.012428 -0.485966 -v -0.208120 -0.000001 -0.481442 -v -0.208120 -0.012430 -0.485967 -v -0.208120 0.006214 -0.482857 -v -0.208120 -0.006215 -0.482858 -vt 0.965735 0.839196 -vt 0.711783 0.839196 -vt 0.711783 0.832541 -vt 0.711783 0.503765 -vt 0.711783 0.497110 -vt 0.965736 0.497110 -vt 0.395683 0.494736 -vt 0.395683 0.261171 -vt 0.403533 0.261171 -vt 0.403532 0.502890 -vt 0.687998 0.839196 -vt 0.684635 0.832541 -vt 0.987044 0.738829 -vt 0.987044 0.497110 -vt 1.000000 0.497110 -vt 0.999999 0.712393 -vt 0.999999 0.732556 -vt 0.992051 0.000000 -vt 0.992051 0.342086 -vt 0.979145 0.342086 -vt 0.979145 0.000000 -vt 0.969912 1.000000 -vt 0.969911 0.758280 -vt 0.982867 0.764553 -vt 0.982867 0.784716 -vt 0.982868 0.999999 -vt 0.403533 0.241720 -vt 0.395683 0.241720 -vt 0.395683 0.008154 -vt 0.403532 0.000000 -vt 0.684634 0.503765 -vt 0.007850 0.008154 -vt 0.000000 0.000000 -vt 0.657486 0.832541 -vt 0.657486 0.503765 -vt 0.657486 0.497110 -vt 0.681271 0.497110 -vt 0.969911 0.497110 -vt 0.982867 0.497110 -vt 0.982868 0.712393 -vt 0.982868 0.732556 -vt 0.969912 0.738829 -vt 0.966239 0.000000 -vt 0.966239 0.342086 -vt 0.987044 0.758280 -vt 1.000000 0.764553 -vt 1.000000 0.784716 -vt 0.999999 1.000000 -vt 0.987043 1.000000 -vt 0.681271 0.839196 -vt 0.657486 0.839196 -vt 0.000000 0.261171 -vt 0.007850 0.261171 -vt 0.007850 0.494736 -vt 0.000000 0.502891 -vt 0.403534 0.839196 -vt 0.403533 0.497110 -vt 0.687998 0.497110 -vt 0.974407 0.740555 -vt 0.970635 0.748555 -vt 0.967042 0.743692 -vt 0.965736 0.748555 -vt 0.967042 0.753417 -vt 0.974406 0.756554 -vt 0.991539 0.740555 -vt 0.987768 0.748555 -vt 0.984174 0.743692 -vt 0.982868 0.748555 -vt 0.984174 0.753417 -vt 0.991539 0.756554 -vt 0.044849 0.844977 -vt 0.035593 0.844977 -vt 0.035446 0.838322 -vt 0.044554 0.838322 -vt 0.956803 0.342087 -vt 0.956803 0.335432 -vt 0.964557 0.335432 -vt 0.947366 0.342087 -vt 0.949048 0.335432 -vt 0.045143 0.838322 -vt 0.054251 0.838322 -vt 0.054104 0.844977 -vt 0.044554 0.509546 -vt 0.035446 0.509546 -vt 0.035593 0.502890 -vt 0.044849 0.502891 -vt 0.964557 0.006655 -vt 0.956803 0.006655 -vt 0.956803 0.000000 -vt 0.949048 0.006655 -vt 0.947366 0.000000 -vt 0.054104 0.502891 -vt 0.054251 0.509546 -vt 0.045143 0.509546 -vt 0.000000 0.256308 -vt 0.000000 0.251445 -vt 0.007850 0.251445 -vt 0.007850 0.256308 -vt 0.000000 0.246582 -vt 0.000000 0.241720 -vt 0.007850 0.241720 -vt 0.007850 0.246582 -vt 0.403533 0.251445 -vt 0.403533 0.256308 -vt 0.395683 0.256308 -vt 0.395683 0.251445 -vt 0.403533 0.246582 -vt 0.395683 0.246582 -vt 0.779948 0.000000 -vt 0.779948 1.000000 -vt 0.724984 1.000000 -vt 0.724983 0.000000 -vt 0.717416 1.000000 -vt 0.662450 1.000000 -vt 0.662449 0.000000 -vt 0.717416 0.000000 -vt 0.184400 1.000000 -vt 0.126957 0.970419 -vt 0.221962 0.896695 -vt 0.485666 0.793134 -vt 0.471964 0.896524 -vt 0.376957 0.970419 -vt 0.216239 0.433002 -vt 0.126957 0.260013 -vt 0.059402 0.000000 -vt 0.001957 0.029581 -vt 0.009688 0.014790 -vt 0.235664 0.793305 -vt 0.013207 0.000000 -vt 0.091241 0.566998 -vt 0.055557 0.728328 -vt 0.001957 0.739987 -vt 0.110666 0.206866 -vt 0.134686 0.985210 -vt 0.096964 0.103476 -vt 0.180555 0.271672 -vt 0.138205 1.000000 -vt 0.341239 0.566998 -vt 0.305555 0.728328 -vt 0.251957 0.739987 -vt 0.251957 0.029581 -vt 0.360664 0.206695 -vt 0.388207 1.000000 -vt 0.384688 0.985210 -vt 0.434402 1.000000 -vt 0.346962 0.103305 -vt 0.466241 0.433002 -vt 0.376957 0.260013 -vt 0.309400 0.000000 -vt 0.259687 0.014790 -vt 0.263205 0.000000 -vt 0.430558 0.271672 -vt 0.636817 0.156314 -vt 0.875000 0.156314 -vt 0.875000 0.984312 -vt 0.636817 0.984312 -vt 0.000000 0.156314 -vt 0.125000 0.156314 -vt 0.125000 0.984312 -vt 0.000000 0.984313 -vt 1.000000 0.156314 -vt 1.000000 0.984313 -vt 0.363296 0.156314 -vt 0.431676 0.156314 -vt 0.431676 0.984311 -vt 0.363296 0.984312 -vt 0.500000 0.156314 -vt 0.568437 0.156314 -vt 0.568437 0.984311 -vt 0.500000 0.984311 -vn 0.577300 0.577300 -0.577300 -vn 0.707100 0.000000 -0.707100 -vn 0.000000 0.000000 -1.000000 -vn -0.707100 0.000000 -0.707100 -vn -0.577300 0.577300 -0.577300 -vn -0.246900 -0.280700 0.927500 -vn -0.658800 -0.172900 0.732100 -vn -0.762700 -0.148700 0.629400 -vn -0.577300 -0.577300 0.577300 -vn 0.668800 -0.216600 -0.711100 -vn 0.071700 -0.428700 -0.900500 -vn -0.762700 0.148700 0.629400 -vn -0.577300 0.577300 0.577300 -vn -0.668800 -0.216600 -0.711100 -vn 0.577300 0.577300 0.577300 -vn 0.762700 0.148700 0.629400 -vn -0.658800 0.172900 0.732100 -vn -0.246900 0.280700 0.927500 -vn -0.071700 -0.428700 -0.900500 -vn 0.246900 0.280700 0.927500 -vn -0.071700 0.428800 -0.900500 -vn 0.071700 0.428800 -0.900500 -vn -0.668800 0.216600 -0.711100 -vn 0.577300 -0.577300 0.577300 -vn 0.577300 -0.577300 -0.577300 -vn 0.668800 0.216600 -0.711100 -vn 0.762700 -0.148700 0.629400 -vn -0.577300 -0.577300 -0.577300 -vn 0.658800 -0.172900 0.732100 -vn 0.246900 -0.280700 0.927500 -vn 0.794100 0.350300 -0.496700 -vn 0.814600 0.000000 -0.580000 -vn 0.681100 -0.246900 0.689300 -vn 0.660400 0.000000 0.750900 -vn 0.681100 0.246800 0.689300 -vn 0.794100 -0.350300 -0.496700 -vn -0.794100 -0.350300 -0.496700 -vn -0.814600 0.000000 -0.580000 -vn -0.681100 0.246800 0.689300 -vn -0.660400 0.000000 0.750900 -vn -0.681100 -0.246900 0.689300 -vn -0.794100 0.350300 -0.496700 -vn -0.062900 0.569600 -0.819500 -vn -0.023700 0.000000 -0.999700 -vn -0.062900 -0.569600 -0.819500 -vn 0.062900 0.569600 -0.819500 -vn 0.023700 0.000000 -0.999700 -vn 0.062900 -0.569600 -0.819500 -vn 0.760600 0.000000 0.649100 -vn 0.735000 -0.228600 0.638300 -vn 0.658800 0.172900 0.732100 -vn 0.735000 0.228600 0.638300 -vn -0.735000 -0.228600 0.638300 -vn -0.760600 0.000000 0.649100 -vn -0.735000 0.228600 0.638300 -vn -0.603500 0.559600 0.567900 -vn 0.603500 0.559600 0.567900 -vn 0.603500 -0.559600 0.567900 -vn -0.603500 -0.559600 0.567900 -vn 0.789000 -0.000200 0.614300 -vn 0.684400 -0.166600 0.709800 -vn -0.687600 0.027100 0.725500 -vn -0.684400 0.166400 0.709800 -vn 0.689800 0.093900 0.717800 -vn 0.687600 -0.027100 0.725500 -vn 0.689800 -0.093900 0.717800 -vn 0.687600 0.027100 0.725500 -vn 0.684400 0.166400 0.709800 -vn -0.689800 0.093900 0.717800 -vn -0.687600 -0.027100 0.725500 -vn -0.789000 -0.000200 0.614300 -vn -0.684400 -0.166600 0.709800 -vn -0.689800 -0.093900 0.717800 +v -0.012428 -0.485966 0.216625 +v 0.000000 -0.486750 -0.220555 +v -0.321341 -0.485966 -0.220555 +v 0.000001 -0.462863 0.208120 +v -0.310920 -0.485966 0.208120 +v -0.306022 -0.464409 0.208120 +v -0.306022 -0.464409 -0.212051 +v -0.310921 -0.485966 -0.212051 +v 0.000000 -0.462862 -0.212050 +v -0.016802 -0.500002 -0.212050 +v -0.016801 -0.500002 0.208120 +v -0.046213 -0.500002 0.208120 +v -0.046214 -0.500002 -0.212050 +v -0.046213 -0.500002 0.216625 +v -0.020445 -0.500002 0.216625 +v -0.012429 -0.485966 -0.220555 +v -0.020446 -0.500002 -0.220555 +v -0.321340 -0.500002 -0.220555 +v -0.321341 -0.500002 0.216624 +v -0.046214 -0.500002 -0.220555 +v -0.321341 -0.485966 0.216624 +v -0.238235 -0.450057 0.208120 +v 0.000001 -0.486750 0.216625 +v -0.238236 -0.450057 -0.212051 +v 0.306023 -0.464409 0.208120 +v 0.306023 -0.464409 -0.212051 +v 0.238237 -0.450057 0.208120 +v 0.238236 -0.450057 -0.212051 +v 0.046214 -0.500003 -0.212050 +v 0.046215 -0.500003 0.208120 +v 0.016803 -0.500003 0.208120 +v 0.016802 -0.500003 -0.212050 +v 0.000001 -0.481442 0.216625 +v 0.000000 -0.481442 -0.220555 +v 0.310922 -0.485967 -0.212051 +v 0.310922 -0.485967 0.208120 +v 0.321342 -0.485967 -0.220555 +v 0.012430 -0.485967 0.216625 +v 0.046215 -0.500003 0.216625 +v 0.020447 -0.500003 0.216625 +v 0.012429 -0.485967 -0.220555 +v 0.020446 -0.500003 -0.220555 +v 0.321341 -0.500003 -0.220555 +v 0.321343 -0.500003 0.216624 +v 0.046214 -0.500003 -0.220555 +v 0.321343 -0.485967 0.216624 +v 0.000001 -0.486750 0.208120 +v 0.000000 -0.486750 -0.212050 +v 0.086920 -0.442244 -0.212051 +v 0.086920 -0.442244 0.208120 +v -0.086847 -0.442244 -0.212050 +v -0.086847 -0.442244 0.208120 +v -0.043405 -0.447755 -0.212050 +v -0.043405 -0.447755 0.208120 +v 0.043478 -0.447755 -0.212050 +v 0.043478 -0.447755 0.208120 +v 0.010224 -0.490836 0.216625 +v -0.006214 -0.482857 0.216625 +v -0.006214 -0.482857 -0.220555 +v -0.008400 -0.490836 0.208120 +v -0.008401 -0.490836 -0.212050 +v -0.010223 -0.490836 -0.220555 +v -0.010222 -0.490836 0.216625 +v 0.010223 -0.490836 -0.220555 +v 0.008401 -0.490836 -0.212050 +v 0.008402 -0.490836 0.208120 +v 0.006215 -0.482858 -0.220555 +v 0.006215 -0.482858 0.216625 +v -0.012429 -0.485966 -0.212050 +v 0.000000 -0.481442 -0.212050 +v 0.012429 -0.485967 -0.212050 +v -0.006214 -0.482857 -0.212050 +v 0.006215 -0.482858 -0.212050 +v -0.012428 -0.485966 0.208120 +v 0.000001 -0.481442 0.208120 +v 0.012430 -0.485967 0.208120 +v -0.006214 -0.482857 0.208120 +v 0.006215 -0.482858 0.208120 +vt 0.9657 0.8392 +vt 0.7118 0.8392 +vt 0.7118 0.8325 +vt 0.7118 0.5038 +vt 0.7118 0.4971 +vt 0.9657 0.4971 +vt 0.3957 0.4947 +vt 0.3957 0.2612 +vt 0.4035 0.2612 +vt 0.4035 0.5029 +vt 0.6880 0.8392 +vt 0.6846 0.8325 +vt 0.9870 0.7388 +vt 0.9870 0.4971 +vt 1.0000 0.4971 +vt 1.0000 0.7124 +vt 1.0000 0.7326 +vt 0.9921 0.0000 +vt 0.9921 0.3421 +vt 0.9791 0.3421 +vt 0.9791 0.0000 +vt 0.9699 1.0000 +vt 0.9699 0.7583 +vt 0.9829 0.7646 +vt 0.9829 0.7847 +vt 0.9829 1.0000 +vt 0.4035 0.2417 +vt 0.3957 0.2417 +vt 0.3957 0.0082 +vt 0.4035 0.0000 +vt 0.6846 0.5038 +vt 0.0078 0.0082 +vt 0.0000 0.0000 +vt 0.6575 0.8325 +vt 0.6575 0.5038 +vt 0.6846 0.5038 +vt 0.6846 0.8325 +vt 0.6575 0.4971 +vt 0.6813 0.4971 +vt 0.9699 0.4971 +vt 0.9829 0.4971 +vt 0.9829 0.7124 +vt 0.9829 0.7326 +vt 0.9699 0.7388 +vt 0.9662 0.0000 +vt 0.9791 0.0000 +vt 0.9791 0.3421 +vt 0.9662 0.3421 +vt 0.9870 0.7583 +vt 1.0000 0.7646 +vt 1.0000 0.7847 +vt 1.0000 1.0000 +vt 0.9870 1.0000 +vt 0.6813 0.8392 +vt 0.6575 0.8392 +vt 0.0000 0.2612 +vt 0.0079 0.2612 +vt 0.0078 0.4947 +vt 0.0000 0.5029 +vt 0.4035 0.8392 +vt 0.4035 0.4971 +vt 0.6880 0.4971 +vt 0.9744 0.7406 +vt 0.9706 0.7486 +vt 0.9670 0.7437 +vt 0.9657 0.7486 +vt 0.9670 0.7534 +vt 0.9744 0.7566 +vt 0.9915 0.7406 +vt 0.9878 0.7486 +vt 0.9842 0.7437 +vt 0.9829 0.7486 +vt 0.9842 0.7534 +vt 0.9915 0.7566 +vt 0.0448 0.8450 +vt 0.0356 0.8450 +vt 0.0354 0.8383 +vt 0.0446 0.8383 +vt 0.9662 0.3421 +vt 0.9568 0.3421 +vt 0.9568 0.3354 +vt 0.9646 0.3354 +vt 0.9474 0.3421 +vt 0.9490 0.3354 +vt 0.0448 0.8450 +vt 0.0451 0.8383 +vt 0.0543 0.8383 +vt 0.0541 0.8450 +vt 0.0446 0.5095 +vt 0.0354 0.5095 +vt 0.0356 0.5029 +vt 0.0448 0.5029 +vt 0.9662 0.0000 +vt 0.9646 0.0067 +vt 0.9568 0.0067 +vt 0.9568 0.0000 +vt 0.9490 0.0067 +vt 0.9474 0.0000 +vt 0.0448 0.5029 +vt 0.0541 0.5029 +vt 0.0543 0.5095 +vt 0.0451 0.5095 +vt 0.0000 0.2563 +vt 0.0000 0.2514 +vt 0.0079 0.2514 +vt 0.0079 0.2563 +vt 0.0000 0.2466 +vt 0.0000 0.2417 +vt 0.0079 0.2417 +vt 0.0079 0.2466 +vt 0.4035 0.2514 +vt 0.4035 0.2563 +vt 0.3957 0.2563 +vt 0.3957 0.2514 +vt 0.4035 0.2466 +vt 0.3957 0.2466 +vt 0.7799 0.0000 +vt 0.7799 1.0000 +vt 0.7250 1.0000 +vt 0.7250 0.0000 +vt 0.7174 1.0000 +vt 0.6624 1.0000 +vt 0.6624 0.0000 +vt 0.7174 0.0000 +vt 0.1844 1.0000 +vt 0.1270 0.9704 +vt 0.2220 0.8967 +vt 0.4857 0.7931 +vt 0.4720 0.8965 +vt 0.3770 0.9704 +vt 0.2162 0.4330 +vt 0.1270 0.2600 +vt 0.0594 0.0000 +vt 0.0020 0.0296 +vt 0.0097 0.0148 +vt 0.2357 0.7933 +vt 0.0132 0.0000 +vt 0.0912 0.5670 +vt 0.0556 0.7283 +vt 0.0020 0.7400 +vt 0.1107 0.2069 +vt 0.1347 0.9852 +vt 0.0970 0.1035 +vt 0.1806 0.2717 +vt 0.1382 1.0000 +vt 0.3412 0.5670 +vt 0.3056 0.7283 +vt 0.2520 0.7400 +vt 0.2520 0.0296 +vt 0.3607 0.2067 +vt 0.3882 1.0000 +vt 0.3847 0.9852 +vt 0.4344 1.0000 +vt 0.3470 0.1033 +vt 0.4662 0.4330 +vt 0.3770 0.2600 +vt 0.3094 0.0000 +vt 0.2597 0.0148 +vt 0.2632 0.0000 +vt 0.4306 0.2717 +vt 0.6368 0.1563 +vt 0.8750 0.1563 +vt 0.8750 0.9843 +vt 0.6368 0.9843 +vt 0.0000 0.1563 +vt 0.1250 0.1563 +vt 0.1250 0.9843 +vt 0.0000 0.9843 +vt 1.0000 0.1563 +vt 1.0000 0.9843 +vt 0.3633 0.1563 +vt 0.4317 0.1563 +vt 0.4317 0.9843 +vt 0.3633 0.9843 +vt 0.5000 0.1563 +vt 0.5684 0.1563 +vt 0.5684 0.9843 +vt 0.5000 0.9843 +vn -0.5773 -0.5773 -0.5773 +vn 0.0000 -0.7071 -0.7071 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 -0.7071 0.7071 +vn -0.5773 -0.5773 0.5773 +vn 0.2807 0.9275 0.2469 +vn 0.1729 0.7321 0.6588 +vn 0.1487 0.6294 0.7627 +vn 0.5773 0.5773 0.5773 +vn 0.2166 -0.7111 -0.6688 +vn 0.4287 -0.9005 -0.0717 +vn -0.1487 0.6294 0.7627 +vn -0.5773 0.5773 0.5773 +vn 0.2166 -0.7111 0.6688 +vn -0.5773 0.5773 -0.5773 +vn -0.1487 0.6294 -0.7627 +vn -0.1729 0.7321 0.6588 +vn -0.2807 0.9275 0.2469 +vn 0.4287 -0.9005 0.0717 +vn -0.2807 0.9275 -0.2469 +vn -0.4288 -0.9005 0.0717 +vn -0.4288 -0.9005 -0.0717 +vn -0.2166 -0.7111 0.6688 +vn 0.5773 0.5773 -0.5773 +vn 0.5773 -0.5773 -0.5773 +vn -0.2166 -0.7111 -0.6688 +vn 0.1487 0.6294 -0.7627 +vn 0.5773 -0.5773 0.5773 +vn 0.1729 0.7321 -0.6588 +vn 0.2807 0.9275 -0.2469 +vn -0.3503 -0.4967 -0.7941 +vn 0.0000 -0.5800 -0.8146 +vn 0.2469 0.6893 -0.6811 +vn 0.0000 0.7509 -0.6604 +vn -0.2468 0.6893 -0.6811 +vn 0.3503 -0.4967 -0.7941 +vn 0.3503 -0.4967 0.7941 +vn 0.0000 -0.5800 0.8146 +vn -0.2468 0.6893 0.6811 +vn 0.0000 0.7509 0.6604 +vn 0.2469 0.6893 0.6811 +vn -0.3503 -0.4967 0.7941 +vn -0.5696 -0.8195 0.0629 +vn 0.0000 -0.9997 0.0237 +vn 0.5696 -0.8195 0.0629 +vn -0.5696 -0.8195 -0.0629 +vn 0.0000 -0.9997 -0.0237 +vn 0.5696 -0.8195 -0.0629 +vn 0.0000 0.6491 -0.7606 +vn 0.2286 0.6383 -0.7350 +vn -0.1729 0.7321 -0.6588 +vn -0.2286 0.6383 -0.7350 +vn 0.2286 0.6383 0.7350 +vn 0.0000 0.6491 0.7606 +vn -0.2286 0.6383 0.7350 +vn -0.5596 0.5679 0.6035 +vn -0.5596 0.5679 -0.6035 +vn 0.5596 0.5679 -0.6035 +vn 0.5596 0.5679 0.6035 +vn 0.0002 0.6143 -0.7890 +vn 0.1666 0.7098 -0.6844 +vn -0.0271 0.7255 0.6876 +vn -0.1664 0.7098 0.6844 +vn -0.0939 0.7178 -0.6898 +vn 0.0271 0.7255 -0.6876 +vn 0.0939 0.7178 -0.6898 +vn -0.0271 0.7255 -0.6876 +vn -0.1664 0.7098 -0.6844 +vn -0.0939 0.7178 0.6898 +vn 0.0271 0.7255 0.6876 +vn 0.0002 0.6143 0.7890 +vn 0.1666 0.7098 0.6844 +vn 0.0939 0.7178 0.6898 g Cube.002_Cube.001_Cube.002_Cube.001_cover s 1 f 18/1/1 20/2/2 13/3/3 12/4/3 14/5/4 19/6/5 @@ -333,86 +341,86 @@ f 3/22/15 16/23/16 17/24/10 20/25/2 18/26/1 f 1/27/12 74/28/17 5/29/18 21/30/13 f 13/3/3 10/12/11 11/31/19 12/4/3 f 21/30/13 5/29/18 8/32/20 3/33/15 -f 29/34/3 30/35/3 31/31/21 32/12/22 -f 31/31/21 30/35/3 39/36/4 40/37/23 -f 37/38/24 43/39/25 45/40/2 42/41/26 41/42/27 -f 43/43/25 37/21/24 46/20/9 44/44/28 -f 38/45/8 40/46/23 39/47/4 44/48/28 46/49/9 -f 29/34/3 32/12/22 42/50/26 45/51/2 -f 41/52/27 71/53/29 35/54/30 37/55/24 -f 35/54/30 36/7/6 46/10/9 37/55/24 -f 43/56/25 44/57/28 39/36/4 30/35/3 29/34/3 45/51/2 -f 15/58/14 14/5/4 12/4/3 11/31/19 -f 42/41/26 64/59/31 41/42/27 -f 41/42/27 64/59/31 2/60/32 67/61/33 -f 67/61/33 2/60/32 34/62/34 -f 34/62/34 2/60/32 59/63/35 -f 2/60/32 62/64/36 16/23/16 59/63/35 -f 16/23/16 62/64/36 17/24/10 -f 15/17/14 63/65/37 1/13/12 -f 23/66/38 58/67/39 1/13/12 63/65/37 -f 58/67/39 23/66/38 33/68/40 -f 68/69/41 33/68/40 23/66/38 -f 38/45/8 68/69/41 23/66/38 57/70/42 -f 57/70/42 40/46/23 38/45/8 -f 40/71/23 57/72/42 66/73/43 31/74/21 -f 57/44/42 23/75/38 47/76/44 66/77/43 -f 47/76/44 23/75/38 63/78/37 60/79/45 -f 15/71/14 11/80/19 60/81/45 63/82/37 -f 32/83/22 65/84/46 64/85/31 42/86/26 -f 64/43/31 65/87/46 48/88/47 2/89/32 -f 48/88/47 61/90/48 62/91/36 2/89/32 -f 17/86/10 62/92/36 61/93/48 10/94/11 -f 67/95/33 34/96/34 70/97/49 73/98/50 -f 59/99/35 16/100/16 69/101/51 72/102/52 -f 41/52/27 67/95/33 73/98/50 71/53/29 -f 34/96/34 59/99/35 72/102/52 70/97/49 -f 33/103/40 68/104/41 78/105/53 75/106/54 -f 1/27/12 58/107/39 77/108/55 74/28/17 -f 68/104/41 38/9/8 76/8/7 78/105/53 -f 58/107/39 33/103/40 75/106/54 77/108/55 -f 8/32/20 69/101/51 16/100/16 3/33/15 -f 10/94/11 61/93/48 60/81/45 11/80/19 -f 47/76/44 60/79/45 61/90/48 48/88/47 -f 65/87/46 66/77/43 47/76/44 48/88/47 -f 31/74/21 66/73/43 65/84/46 32/83/22 +f 29/34/3 30/35/3 31/36/21 32/37/22 +f 31/36/21 30/35/3 39/38/4 40/39/23 +f 37/40/24 43/41/25 45/42/2 42/43/26 41/44/27 +f 43/45/25 37/46/24 46/47/9 44/48/28 +f 38/49/8 40/50/23 39/51/4 44/52/28 46/53/9 +f 29/34/3 32/37/22 42/54/26 45/55/2 +f 41/56/27 71/57/29 35/58/30 37/59/24 +f 35/58/30 36/7/6 46/10/9 37/59/24 +f 43/60/25 44/61/28 39/38/4 30/35/3 29/34/3 45/55/2 +f 15/62/14 14/5/4 12/4/3 11/31/19 +f 42/43/26 64/63/31 41/44/27 +f 41/44/27 64/63/31 2/64/32 67/65/33 +f 67/65/33 2/64/32 34/66/34 +f 34/66/34 2/64/32 59/67/35 +f 2/64/32 62/68/36 16/23/16 59/67/35 +f 16/23/16 62/68/36 17/24/10 +f 15/17/14 63/69/37 1/13/12 +f 23/70/38 58/71/39 1/13/12 63/69/37 +f 58/71/39 23/70/38 33/72/40 +f 68/73/41 33/72/40 23/70/38 +f 38/49/8 68/73/41 23/70/38 57/74/42 +f 57/74/42 40/50/23 38/49/8 +f 40/75/23 57/76/42 66/77/43 31/78/21 +f 57/79/42 23/80/38 47/81/44 66/82/43 +f 47/81/44 23/80/38 63/83/37 60/84/45 +f 15/85/14 11/86/19 60/87/45 63/88/37 +f 32/89/22 65/90/46 64/91/31 42/92/26 +f 64/93/31 65/94/46 48/95/47 2/96/32 +f 48/95/47 61/97/48 62/98/36 2/96/32 +f 17/99/10 62/100/36 61/101/48 10/102/11 +f 67/103/33 34/104/34 70/105/49 73/106/50 +f 59/107/35 16/108/16 69/109/51 72/110/52 +f 41/56/27 67/103/33 73/106/50 71/57/29 +f 34/104/34 59/107/35 72/110/52 70/105/49 +f 33/111/40 68/112/41 78/113/53 75/114/54 +f 1/27/12 58/115/39 77/116/55 74/28/17 +f 68/112/41 38/9/8 76/8/7 78/113/53 +f 58/115/39 33/111/40 75/114/54 77/116/55 +f 8/32/20 69/109/51 16/108/16 3/33/15 +f 10/102/11 61/101/48 60/87/45 11/86/19 +f 47/81/44 60/84/45 61/97/48 48/95/47 +f 65/94/46 66/82/43 47/81/44 48/95/47 +f 31/78/21 66/77/43 65/90/46 32/89/22 g Cube.002_Cube.001_Cube.002_Cube.001_edges -f 8/109/20 5/110/18 6/111/56 7/112/57 -f 35/113/30 26/114/58 25/115/59 36/116/6 -f 9/117/60 69/118/51 53/119/61 -f 50/120/62 56/121/63 76/122/7 -f 24/123/64 69/118/51 8/124/20 -f 9/125/60 71/126/29 73/127/50 -f 51/128/65 53/119/61 69/118/51 -f 9/125/60 73/127/50 70/129/49 -f 28/130/66 26/131/58 35/132/30 -f 71/126/29 49/133/67 28/130/66 -f 72/134/52 69/118/51 9/117/60 -f 71/126/29 55/135/68 49/133/67 -f 28/130/66 35/132/30 71/126/29 -f 24/123/64 8/124/20 7/136/57 -f 69/118/51 24/123/64 51/128/65 -f 9/125/60 55/135/68 71/126/29 -f 70/137/49 72/134/52 9/117/60 -f 22/138/69 6/139/56 5/140/18 -f 74/141/17 52/142/70 22/138/69 -f 75/143/54 78/144/53 4/145/71 -f 74/141/17 54/146/72 52/142/70 -f 22/138/69 5/140/18 74/141/17 -f 27/147/73 76/122/7 36/148/6 -f 4/149/71 74/141/17 77/150/55 -f 27/147/73 50/120/62 76/122/7 -f 4/149/71 77/150/55 75/151/54 -f 4/145/71 78/144/53 76/122/7 -f 4/149/71 54/146/72 74/141/17 -f 27/147/73 36/148/6 25/152/59 -f 56/121/63 4/145/71 76/122/7 +f 8/117/20 5/118/18 6/119/56 7/120/57 +f 35/121/30 26/122/58 25/123/59 36/124/6 +f 9/125/60 69/126/51 53/127/61 +f 50/128/62 56/129/63 76/130/7 +f 24/131/64 69/126/51 8/132/20 +f 9/133/60 71/134/29 73/135/50 +f 51/136/65 53/127/61 69/126/51 +f 9/133/60 73/135/50 70/137/49 +f 28/138/66 26/139/58 35/140/30 +f 71/134/29 49/141/67 28/138/66 +f 72/142/52 69/126/51 9/125/60 +f 71/134/29 55/143/68 49/141/67 +f 28/138/66 35/140/30 71/134/29 +f 24/131/64 8/132/20 7/144/57 +f 69/126/51 24/131/64 51/136/65 +f 9/133/60 55/143/68 71/134/29 +f 70/145/49 72/142/52 9/125/60 +f 22/146/69 6/147/56 5/148/18 +f 74/149/17 52/150/70 22/146/69 +f 75/151/54 78/152/53 4/153/71 +f 74/149/17 54/154/72 52/150/70 +f 22/146/69 5/148/18 74/149/17 +f 27/155/73 76/130/7 36/156/6 +f 4/157/71 74/149/17 77/158/55 +f 27/155/73 50/128/62 76/130/7 +f 4/157/71 77/158/55 75/159/54 +f 4/153/71 78/152/53 76/130/7 +f 4/157/71 54/154/72 74/149/17 +f 27/155/73 36/156/6 25/160/59 +f 56/129/63 4/153/71 76/130/7 g Cube.002_Cube.001_Cube.002_Cube.001_pages -f 50/153/62 27/154/73 28/155/66 49/156/67 -f 6/157/56 22/158/69 24/159/64 7/160/57 -f 27/154/73 25/161/59 26/162/58 28/155/66 -f 52/163/70 54/164/72 53/165/61 51/166/65 -f 22/158/69 52/163/70 51/166/65 24/159/64 -f 4/167/71 56/168/63 55/169/68 9/170/60 -f 54/164/72 4/167/71 9/170/60 53/165/61 -f 56/168/63 50/153/62 49/156/67 55/169/68 +f 50/161/62 27/162/73 28/163/66 49/164/67 +f 6/165/56 22/166/69 24/167/64 7/168/57 +f 27/162/73 25/169/59 26/170/58 28/163/66 +f 52/171/70 54/172/72 53/173/61 51/174/65 +f 22/166/69 52/171/70 51/174/65 24/167/64 +f 4/175/71 56/176/63 55/177/68 9/178/60 +f 54/172/72 4/175/71 9/178/60 53/173/61 +f 56/176/63 50/161/62 49/164/67 55/177/68 diff --git a/homedecor/models/plasma_lamp.obj b/homedecor/models/plasma_lamp.obj new file mode 100644 index 0000000..ffc6d93 --- /dev/null +++ b/homedecor/models/plasma_lamp.obj @@ -0,0 +1,202 @@ +# Blender v2.78 (sub 0) OBJ File: '' +# www.blender.org +o Cube_Cube.001 +v 0.500000 -0.500000 -0.500000 +v 0.500000 0.500000 -0.500000 +v 0.500000 -0.500000 0.500000 +v 0.500000 0.500000 0.500000 +v -0.500000 -0.500000 -0.500000 +v -0.500000 0.500000 -0.500000 +v -0.500000 -0.500000 0.500000 +v -0.500000 0.500000 0.500000 +v 0.437500 -0.437500 -0.437500 +v 0.437500 0.437500 -0.437500 +v 0.437500 -0.437500 0.437500 +v 0.437500 0.437500 0.437500 +v -0.437500 -0.437500 -0.437500 +v -0.437500 0.437500 -0.437500 +v -0.437500 -0.437500 0.437500 +v -0.437500 0.437500 0.437500 +v -0.500000 -0.437500 -0.437500 +v -0.500000 0.437500 -0.437500 +v -0.500000 -0.437500 0.437500 +v -0.500000 0.437500 0.437500 +v 0.500000 -0.437500 -0.437500 +v 0.500000 0.437500 -0.437500 +v 0.500000 -0.437500 0.437500 +v 0.500000 0.437500 0.437500 +v 0.437500 -0.437500 -0.500000 +v 0.437500 0.437500 -0.500000 +v -0.437500 -0.437500 -0.500000 +v -0.437500 0.437500 -0.500000 +v 0.437500 -0.437500 0.500000 +v 0.437500 0.437500 0.500000 +v -0.437500 -0.437500 0.500000 +v -0.437500 0.437500 0.500000 +v 0.437500 0.500000 -0.437500 +v 0.437500 0.500000 0.437500 +v -0.437500 0.500000 -0.437500 +v -0.437500 0.500000 0.437500 +v 0.437500 -0.500000 -0.437500 +v 0.437500 -0.500000 0.437500 +v -0.437500 -0.500000 -0.437500 +v -0.437500 -0.500000 0.437500 +vt 0.0625 0.0000 +vt 0.9375 0.0000 +vt 0.9375 0.0625 +vt 0.0625 0.0625 +vt -0.0000 0.9375 +vt -0.0000 0.0625 +vt 0.0625 0.9375 +vt -0.0000 0.0625 +vt -0.0000 0.9375 +vt -0.0000 0.9375 +vt -0.0000 0.0625 +vt 0.0625 0.0625 +vt 0.0625 0.9375 +vt -0.0000 0.9375 +vt 0.0625 0.9375 +vt 0.0625 0.0625 +vt -0.0000 0.0625 +vt 0.9375 0.0000 +vt 0.0625 0.0000 +vt 0.9375 0.0625 +vt 0.0625 0.9375 +vt 0.0625 0.0625 +vt -0.0000 0.0625 +vt -0.0000 0.9375 +vt 1.0000 0.9375 +vt 1.0000 0.0625 +vt 0.9375 0.9375 +vt 1.0000 0.9375 +vt 0.9375 0.9375 +vt 1.0000 0.9375 +vt 0.9375 0.9375 +vt 0.9375 0.0625 +vt 1.0000 0.0625 +vt 1.0000 0.0625 +vt 1.0000 0.9375 +vt 1.0000 0.0625 +vt 0.9375 1.0000 +vt 0.0625 1.0000 +vt 0.9375 0.9375 +vt 0.9375 0.0625 +vt 1.0000 0.0625 +vt 1.0000 0.9375 +vt 0.0625 1.0000 +vt 0.9375 1.0000 +vt 0.0625 0.0000 +vt 0.9375 0.0000 +vt 0.0625 0.0000 +vt 0.9375 0.0000 +vt 0.0625 0.0000 +vt 0.9375 0.0000 +vt 0.0625 1.0000 +vt 0.9375 1.0000 +vt 0.0625 1.0000 +vt 0.9375 1.0000 +vt 0.0625 1.0000 +vt 0.9375 1.0000 +vt -0.0000 0.0000 +vt 1.0000 0.0000 +vt 0.9375 0.0625 +vt 0.0625 0.0625 +vt -0.0000 1.0000 +vt 0.0625 0.9375 +vt 1.0000 1.0000 +vt 0.9375 0.9375 +vt -0.0000 1.0000 +vt 0.0625 0.9375 +vt 0.9375 0.9375 +vt 1.0000 0.0000 +vt 0.9375 0.0625 +vt 0.0625 0.0625 +vt -0.0000 0.0000 +vt 1.0000 1.0000 +vt 1.0000 0.0000 +vt 0.9375 0.0625 +vt 0.9375 0.9375 +vt -0.0000 0.0000 +vt 0.0625 0.0625 +vt -0.0000 1.0000 +vt 0.0625 0.9375 +vt -0.0000 0.0000 +vt 0.0625 0.9375 +vt 0.0625 0.0625 +vt 0.9375 0.9375 +vt 0.9375 0.0625 +vt 1.0000 0.0000 +vt 0.9375 0.0625 +vt 0.9375 0.9375 +vt 1.0000 1.0000 +vt 0.0625 0.9375 +vt -0.0000 1.0000 +vt 0.0625 0.0625 +vt 0.0625 0.0625 +vt 0.0625 0.9375 +vt 0.9375 0.9375 +vt 1.0000 1.0000 +vt 0.9375 0.0625 +vn 0.0000 1.0000 0.0000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 0.0000 -1.0000 +vn 0.0000 -1.0000 0.0000 +vn 1.0000 0.0000 0.0000 +g Cube_Cube.001_frame +s off +f 25/1/1 27/2/1 13/3/1 9/4/1 +f 26/5/2 25/6/2 9/4/2 10/7/2 +f 21/8/3 22/9/3 10/7/3 9/4/3 +f 24/10/4 23/11/4 11/12/4 12/13/4 +f 23/14/1 21/8/1 9/4/1 11/15/1 +f 12/13/5 10/16/5 22/17/5 24/10/5 +f 28/18/5 26/19/5 10/16/5 14/20/5 +f 14/21/6 13/22/6 27/23/6 28/24/6 +f 18/25/3 17/26/3 13/3/3 14/27/3 +f 17/26/1 19/28/1 15/29/1 13/3/1 +f 20/30/4 16/31/4 15/32/4 19/33/4 +f 20/30/5 18/34/5 14/20/5 16/31/5 +f 16/31/6 32/35/6 31/36/6 15/32/6 +f 31/37/1 29/38/1 11/15/1 15/29/1 +f 12/39/2 11/40/2 29/41/2 30/42/2 +f 30/43/5 32/44/5 16/31/5 12/13/5 +f 15/32/4 11/12/4 38/45/4 40/46/4 +f 13/22/6 15/32/6 40/46/6 39/47/6 +f 9/4/3 13/3/3 39/48/3 37/49/3 +f 11/40/2 9/4/2 37/49/2 38/50/2 +f 16/31/6 14/21/6 35/51/6 36/52/6 +f 12/13/4 16/31/4 36/52/4 34/53/4 +f 10/7/2 12/39/2 34/54/2 33/55/2 +f 14/27/3 10/7/3 33/55/3 35/56/3 +f 2/57/1 6/58/1 35/59/1 33/60/1 +f 4/61/1 2/57/1 33/60/1 34/62/1 +f 8/63/1 4/61/1 34/62/1 36/64/1 +f 6/58/1 8/63/1 36/64/1 35/59/1 +f 6/65/2 18/66/2 20/67/2 8/63/2 +f 7/68/2 8/63/2 20/67/2 19/69/2 +f 7/68/2 19/69/2 17/70/2 5/71/2 +f 5/71/2 17/70/2 18/66/2 6/65/2 +f 7/72/5 5/73/5 39/74/5 40/75/5 +f 5/73/5 1/76/5 37/77/5 39/74/5 +f 1/76/5 3/78/5 38/79/5 37/77/5 +f 3/78/5 7/72/5 40/75/5 38/79/5 +f 3/80/3 4/61/3 30/81/3 29/82/3 +f 8/63/3 32/83/3 30/81/3 4/61/3 +f 7/68/3 31/84/3 32/83/3 8/63/3 +f 3/80/3 29/82/3 31/84/3 7/68/3 +f 3/85/6 23/86/6 24/87/6 4/88/6 +f 4/88/6 24/87/6 22/89/6 2/90/6 +f 2/90/6 22/89/6 21/91/6 1/76/6 +f 1/76/6 21/91/6 23/86/6 3/85/6 +f 2/90/4 1/76/4 25/92/4 26/93/4 +f 2/90/4 26/93/4 28/94/4 6/95/4 +f 5/73/4 6/95/4 28/94/4 27/96/4 +f 5/73/4 27/96/4 25/92/4 1/76/4 +g Cube_Cube.001_glass +f 9/4/6 10/7/6 12/39/6 11/40/6 +f 11/12/3 12/13/3 16/31/3 15/32/3 +f 15/32/2 16/31/2 14/21/2 13/22/2 +f 13/3/4 14/27/4 10/7/4 9/4/4 +f 11/15/5 15/29/5 13/3/5 9/4/5 +f 16/31/1 12/13/1 10/16/1 14/20/1 diff --git a/homedecor/textures/homedecor_bathroom_tiles_bg.png b/homedecor/textures/homedecor_bathroom_tiles_bg.png Binary files differindex b8a3157..4fa963e 100644 --- a/homedecor/textures/homedecor_bathroom_tiles_bg.png +++ b/homedecor/textures/homedecor_bathroom_tiles_bg.png diff --git a/homedecor/textures/homedecor_bathroom_tiles_fg.png b/homedecor/textures/homedecor_bathroom_tiles_fg.png Binary files differindex a00c3a8..bf19c5b 100644 --- a/homedecor/textures/homedecor_bathroom_tiles_fg.png +++ b/homedecor/textures/homedecor_bathroom_tiles_fg.png diff --git a/homedecor/textures/homedecor_glowlight_cube_sides.png b/homedecor/textures/homedecor_glowlight_cube_sides.png Binary files differindex 06182d0..31ba821 100644 --- a/homedecor/textures/homedecor_glowlight_cube_sides.png +++ b/homedecor/textures/homedecor_glowlight_cube_sides.png diff --git a/homedecor/textures/homedecor_glowlight_cube_sides_ceiling.png b/homedecor/textures/homedecor_glowlight_cube_sides_ceiling.png Binary files differindex 0f2fb3d..7960828 100644 --- a/homedecor/textures/homedecor_glowlight_cube_sides_ceiling.png +++ b/homedecor/textures/homedecor_glowlight_cube_sides_ceiling.png diff --git a/homedecor/textures/homedecor_glowlight_cube_sides_ceiling_overlay.png b/homedecor/textures/homedecor_glowlight_cube_sides_ceiling_overlay.png Binary files differnew file mode 100644 index 0000000..b50bec0 --- /dev/null +++ b/homedecor/textures/homedecor_glowlight_cube_sides_ceiling_overlay.png diff --git a/homedecor/textures/homedecor_glowlight_cube_sides_overlay.png b/homedecor/textures/homedecor_glowlight_cube_sides_overlay.png Binary files differnew file mode 100644 index 0000000..4db5867 --- /dev/null +++ b/homedecor/textures/homedecor_glowlight_cube_sides_overlay.png diff --git a/homedecor/textures/homedecor_glowlight_cube_tb.png b/homedecor/textures/homedecor_glowlight_cube_tb.png Binary files differindex d5f0615..c415202 100644 --- a/homedecor/textures/homedecor_glowlight_cube_tb.png +++ b/homedecor/textures/homedecor_glowlight_cube_tb.png diff --git a/homedecor/textures/homedecor_glowlight_cube_tb_overlay.png b/homedecor/textures/homedecor_glowlight_cube_tb_overlay.png Binary files differnew file mode 100644 index 0000000..c5b9d9e --- /dev/null +++ b/homedecor/textures/homedecor_glowlight_cube_tb_overlay.png diff --git a/homedecor/textures/homedecor_glowlight_thick_sides.png b/homedecor/textures/homedecor_glowlight_thick_sides.png Binary files differindex 81a9518..bae0108 100644 --- a/homedecor/textures/homedecor_glowlight_thick_sides.png +++ b/homedecor/textures/homedecor_glowlight_thick_sides.png diff --git a/homedecor/textures/homedecor_glowlight_thick_sides_overlay.png b/homedecor/textures/homedecor_glowlight_thick_sides_overlay.png Binary files differnew file mode 100644 index 0000000..f22551c --- /dev/null +++ b/homedecor/textures/homedecor_glowlight_thick_sides_overlay.png diff --git a/homedecor/textures/homedecor_glowlight_thin_sides.png b/homedecor/textures/homedecor_glowlight_thin_sides.png Binary files differindex 8c1dd69..51832b5 100644 --- a/homedecor/textures/homedecor_glowlight_thin_sides.png +++ b/homedecor/textures/homedecor_glowlight_thin_sides.png diff --git a/homedecor/textures/homedecor_glowlight_thin_sides_overlay.png b/homedecor/textures/homedecor_glowlight_thin_sides_overlay.png Binary files differnew file mode 100644 index 0000000..8fedb2c --- /dev/null +++ b/homedecor/textures/homedecor_glowlight_thin_sides_overlay.png diff --git a/homedecor/textures/homedecor_glowlight_top.png b/homedecor/textures/homedecor_glowlight_top.png Binary files differindex 3a06edb..70518e7 100644 --- a/homedecor/textures/homedecor_glowlight_top.png +++ b/homedecor/textures/homedecor_glowlight_top.png diff --git a/homedecor/textures/homedecor_glowlight_top_overlay.png b/homedecor/textures/homedecor_glowlight_top_overlay.png Binary files differnew file mode 100644 index 0000000..ec27d4a --- /dev/null +++ b/homedecor/textures/homedecor_glowlight_top_overlay.png diff --git a/ilights/init.lua b/ilights/init.lua index eed4b03..aee2a60 100644 --- a/ilights/init.lua +++ b/ilights/init.lua @@ -12,7 +12,7 @@ else S = function(s) return s end end -if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then +if minetest.get_modpath("unified_inventory") or not minetest.settings:get_bool("creative_mode") then ilights.expect_infinite_stacks = false else ilights.expect_infinite_stacks = true diff --git a/inbox/init.lua b/inbox/init.lua index 280edf2..5ee77a8 100644 --- a/inbox/init.lua +++ b/inbox/init.lua @@ -92,6 +92,19 @@ minetest.register_node("inbox:empty", { end end end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local owner = meta:get_string("owner") + if player:get_player_name() == owner or + minetest.check_player_privs(player, "protection_bypass") and + clicker:get_player_control().aux1 then + return stack:get_count() + end + return 0 + end, + allow_metadata_inventory_move = function(pos) + return 0 + end, }) function inbox.get_inbox_formspec(pos) diff --git a/lrfurn/armchairs.lua b/lrfurn/armchairs.lua index 1488c95..ad23014 100644 --- a/lrfurn/armchairs.lua +++ b/lrfurn/armchairs.lua @@ -108,6 +108,6 @@ minetest.register_lbm({ end }) -if minetest.setting_get("log_mods") then +if minetest.settings:get("log_mods") then minetest.log("action", "[lrfurn/armchairs] "..S("Loaded!")) end diff --git a/lrfurn/coffeetable.lua b/lrfurn/coffeetable.lua index d2a920a..f9246b8 100644 --- a/lrfurn/coffeetable.lua +++ b/lrfurn/coffeetable.lua @@ -65,6 +65,6 @@ minetest.register_craft({ } }) -if minetest.setting_get("log_mods") then +if minetest.settings:get("log_mods") then minetest.log("action", "[lrfurn/coffeetable] "..S("Loaded!")) end diff --git a/lrfurn/endtable.lua b/lrfurn/endtable.lua index b94da3b..a318376 100644 --- a/lrfurn/endtable.lua +++ b/lrfurn/endtable.lua @@ -48,6 +48,6 @@ minetest.register_craft({ } }) -if minetest.setting_get("log_mods") then +if minetest.settings:get("log_mods") then minetest.log("action", "[lrfurn/endtable] "..S("Loaded!")) end diff --git a/lrfurn/longsofas.lua b/lrfurn/longsofas.lua index 39a6dc1..05db65d 100644 --- a/lrfurn/longsofas.lua +++ b/lrfurn/longsofas.lua @@ -122,6 +122,6 @@ minetest.register_lbm({ end }) -if minetest.setting_get("log_mods") then +if minetest.settings:get("log_mods") then minetest.log("action", "[lrfurn/longsofas] "..S("Loaded!")) end diff --git a/lrfurn/sofas.lua b/lrfurn/sofas.lua index 0f6a153..de1b784 100644 --- a/lrfurn/sofas.lua +++ b/lrfurn/sofas.lua @@ -122,6 +122,6 @@ minetest.register_lbm({ end }) -if minetest.setting_get("log_mods") then +if minetest.settings:get("log_mods") then minetest.log("action", "[lrfurn/sofas] "..S("Loaded!")) end diff --git a/mesecons/services.lua b/mesecons/services.lua index 1abbc0c..1e12de0 100644 --- a/mesecons/services.lua +++ b/mesecons/services.lua @@ -66,30 +66,63 @@ minetest.register_on_placenode(mesecon.on_placenode) minetest.register_on_dignode(mesecon.on_dignode) -- Overheating service for fast circuits +local OVERHEAT_MAX = mesecon.setting("overheat_max", 20) +local COOLDOWN_TIME = mesecon.setting("cooldown_time", 2.0) +local COOLDOWN_STEP = mesecon.setting("cooldown_granularity", 0.5) +local COOLDOWN_MULTIPLIER = OVERHEAT_MAX / COOLDOWN_TIME +local cooldown_timer = 0.0 +local object_heat = {} -- returns true if heat is too high -mesecon.do_overheat = function(pos) - local meta = minetest.get_meta(pos) - local heat = meta:get_int("heat") or 0 - - heat = heat + 1 - meta:set_int("heat", heat) - - if heat < mesecon.setting("overheat_max", 20) then - mesecon.queue:add_action(pos, "cooldown", {}, 1, nil, 0) - else +function mesecon.do_overheat(pos) + local id = minetest.hash_node_position(pos) + local heat = (object_heat[id] or 0) + 1 + object_heat[id] = heat + if heat >= OVERHEAT_MAX then + minetest.log("action", "Node overheats at " .. minetest.pos_to_string(pos)) + object_heat[id] = nil return true end - return false end +function mesecon.do_cooldown(pos) + local id = minetest.hash_node_position(pos) + object_heat[id] = nil +end -mesecon.queue:add_function("cooldown", function (pos) - local meta = minetest.get_meta(pos) - local heat = meta:get_int("heat") +function mesecon.get_heat(pos) + local id = minetest.hash_node_position(pos) + return object_heat[id] or 0 +end - if (heat > 0) then - meta:set_int("heat", heat - 1) +function mesecon.move_hot_nodes(moved_nodes) + local new_heat = {} + for _, n in ipairs(moved_nodes) do + local old_id = minetest.hash_node_position(n.oldpos) + local new_id = minetest.hash_node_position(n.pos) + new_heat[new_id] = object_heat[old_id] + object_heat[old_id] = nil + end + for id, heat in pairs(new_heat) do + object_heat[id] = heat end -end) +end + +local function global_cooldown(dtime) + cooldown_timer = cooldown_timer + dtime + if cooldown_timer < COOLDOWN_STEP then + return -- don't overload the CPU + end + local cooldown = COOLDOWN_MULTIPLIER * cooldown_timer + cooldown_timer = 0 + for id, heat in pairs(object_heat) do + heat = heat - cooldown + if heat <= 0 then + object_heat[id] = nil -- free some RAM + else + object_heat[id] = heat + end + end +end +minetest.register_globalstep(global_cooldown) diff --git a/mesecons_gates/init.lua b/mesecons_gates/init.lua index 13e583b..3807d6f 100644 --- a/mesecons_gates/init.lua +++ b/mesecons_gates/init.lua @@ -74,7 +74,8 @@ local function register_gate(name, inputnumber, assess, recipe, description) assess = assess, onstate = basename.."_on", offstate = basename.."_off", - inputnumber = inputnumber + inputnumber = inputnumber, + after_dig_node = mesecon.do_cooldown, },{ tiles = {"jeija_microcontroller_bottom.png^".."jeija_gate_off.png^".. "jeija_gate_"..name..".png"}, diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua index c754eda..25273a1 100644 --- a/mesecons_luacontroller/init.lua +++ b/mesecons_luacontroller/init.lua @@ -315,7 +315,7 @@ local function create_environment(pos, mem, event) port = vports_copy, event = event, mem = mem, - heat = minetest.get_meta(pos):get_int("heat"), + heat = mesecon.get_heat(pos), heat_max = mesecon.setting("overheat_max", 20), print = safe_print, interrupt = get_interrupt(pos), @@ -478,14 +478,13 @@ local function reset_meta(pos, code, errmsg) local meta = minetest.get_meta(pos) meta:set_string("code", code) code = minetest.formspec_escape(code or "") - errmsg = minetest.formspec_escape(errmsg or "") - meta:set_string("formspec", "size[10,8]".. - "background[-0.2,-0.25;10.4,8.75;jeija_luac_background.png]".. - "textarea[0.2,0.6;10.2,5;code;;"..code.."]".. - "image_button[3.75,6;2.5,1;jeija_luac_runbutton.png;program;]".. - "image_button_exit[9.72,-0.25;0.425,0.4;jeija_close_window.png;exit;]".. - "label[0.1,5;"..errmsg.."]") - meta:set_int("heat", 0) + errmsg = minetest.formspec_escape(tostring(errmsg or "")) + meta:set_string("formspec", "size[12,10]".. + "background[-0.2,-0.25;12.4,10.75;jeija_luac_background.png]".. + "textarea[0.2,0.2;12.2,9.5;code;;"..code.."]".. + "image_button[4.75,8.75;2.5,1;jeija_luac_runbutton.png;program;]".. + "image_button_exit[11.72,-0.25;0.425,0.4;jeija_close_window.png;exit;]".. + "label[0.1,9;"..errmsg.."]") meta:set_int("luac_id", math.random(1, 65535)) end @@ -626,6 +625,7 @@ for d = 0, 1 do d = d == 1, }, after_dig_node = function (pos, node) + mesecon.do_cooldown(pos) mesecon.receptor_off(pos, output_rules) end, is_luacontroller = true, diff --git a/mesecons_luacontroller/textures/jeija_luac_background.png b/mesecons_luacontroller/textures/jeija_luac_background.png Binary files differindex 40e316c..40b427e 100644 --- a/mesecons_luacontroller/textures/jeija_luac_background.png +++ b/mesecons_luacontroller/textures/jeija_luac_background.png diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua index 2c6161b..252acf7 100644 --- a/mesecons_mvps/init.lua +++ b/mesecons_mvps/init.lua @@ -246,3 +246,4 @@ mesecon.register_mvps_stopper("doors:door_steel_t_1") mesecon.register_mvps_stopper("doors:door_steel_b_2") mesecon.register_mvps_stopper("doors:door_steel_t_2") mesecon.register_mvps_stopper("default:chest_locked") +mesecon.register_on_mvps_move(mesecon.move_hot_nodes) diff --git a/moreores/init.lua b/moreores/init.lua index 34c9a0e..da4409f 100644 --- a/moreores/init.lua +++ b/moreores/init.lua @@ -10,6 +10,11 @@ Licensed under the zlib license. See LICENSE.md for more information. moreores = {} +local default_tin = false +if minetest.registered_items["default:tin_ingot"] then + default_tin = true +end + local S if minetest.get_modpath("intllib") then S = intllib.Getter() @@ -266,17 +271,6 @@ local oredefs = { full_punch_interval = 1.0, damage_groups = {fleshy = 6}, }, - tin = { - description = "Tin", - makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, - oredef = {clust_scarcity = moreores.tin_chunk_size * moreores.tin_chunk_size * moreores.tin_chunk_size, - clust_num_ores = moreores.tin_ore_per_chunk, - clust_size = moreores.tin_chunk_size, - y_min = moreores.tin_min_depth, - y_max = moreores.tin_max_depth - }, - tools = {}, - }, mithril = { description = "Mithril", makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, @@ -311,6 +305,20 @@ local oredefs = { } } +if not default_tin then + oredefs.tin = { + description = "Tin", + makes = {ore = true, block = true, lump = true, ingot = true, chest = false}, + oredef = {clust_scarcity = moreores.tin_chunk_size * moreores.tin_chunk_size * moreores.tin_chunk_size, + clust_num_ores = moreores.tin_ore_per_chunk, + clust_size = moreores.tin_chunk_size, + y_min = moreores.tin_min_depth, + y_max = moreores.tin_max_depth + }, + tools = {}, + } +end + for orename,def in pairs(oredefs) do add_ore(modname, def.description, orename, def) end @@ -325,16 +333,23 @@ minetest.register_craft({ } }) --- Bronze has some special cases, because it is made from copper and tin: -minetest.register_craft( { - type = "shapeless", - output = "default:bronze_ingot 3", - recipe = { - "moreores:tin_ingot", - "default:copper_ingot", - "default:copper_ingot", - } -}) +if default_tin then + minetest.register_alias("moreores:mineral_tin", "default:stone_with_tin") + minetest.register_alias("moreores:tin_lump", "default:tin_lump") + minetest.register_alias("moreores:tin_ingot", "default:tin_ingot") + minetest.register_alias("moreores:tin_block", "default:tinblock") +else + -- Bronze has some special cases, because it is made from copper and tin: + minetest.register_craft( { + type = "shapeless", + output = "default:bronze_ingot 3", + recipe = { + "moreores:tin_ingot", + "default:copper_ingot", + "default:copper_ingot", + } + }) +end -- Unique node: minetest.register_node("moreores:copper_rail", { diff --git a/moreores/mg.lua b/moreores/mg.lua index 8c53456..6551ae5 100644 --- a/moreores/mg.lua +++ b/moreores/mg.lua @@ -5,20 +5,22 @@ Copyright (c) 2011-2017 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] -mg.register_ore({ - name = "moreores:mineral_tin", - wherein = "default:stone", - seeddiff = 8, - maxvdistance = 10.5, - maxheight = 8, - seglenghtn = 15, - seglenghtdev = 6, - segincln = 0, - segincldev = 0.6, - turnangle = 57, - forkturnangle = 57, - numperblock = 2 -}) +if not minetest.registered_items["default:tin_ingot"] then + mg.register_ore({ + name = "moreores:mineral_tin", + wherein = "default:stone", + seeddiff = 8, + maxvdistance = 10.5, + maxheight = 8, + seglenghtn = 15, + seglenghtdev = 6, + segincln = 0, + segincldev = 0.6, + turnangle = 57, + forkturnangle = 57, + numperblock = 2 + }) +end mg.register_ore({ name = "moreores:mineral_silver", diff --git a/pipeworks/default_settings.lua b/pipeworks/default_settings.lua new file mode 100644 index 0000000..99b86fe --- /dev/null +++ b/pipeworks/default_settings.lua @@ -0,0 +1,40 @@ +-- Various settings + +local prefix = "pipeworks_" + +local settings = { + enable_pipes = true, + enable_autocrafter = true, + enable_deployer = true, + enable_dispenser = true, + enable_node_breaker = true, + enable_teleport_tube = true, + enable_pipe_devices = true, + enable_redefines = true, + enable_mese_tube = true, + enable_detector_tube = true, + enable_digiline_detector_tube = true, + enable_conductor_tube = true, + enable_accelerator_tube = true, + enable_crossing_tube = true, + enable_sand_tube = true, + enable_mese_sand_tube = true, + enable_one_way_tube = true, + enable_priority_tube = true, + enable_cyclic_mode = true, + drop_on_routing_fail = false, + + delete_item_on_clearobject = true, +} + +for name, value in pairs(settings) do + local setting_type = type(value) + if setting_type == "boolean" then + pipeworks[name] = minetest.settings:get_bool(prefix..name) + if pipeworks[name] == nil then + pipeworks[name] = value + end + else + pipeworks[name] = value + end +end diff --git a/pipeworks/flowing_logic.lua b/pipeworks/flowing_logic.lua index e1c0bf5..632baa6 100644 --- a/pipeworks/flowing_logic.lua +++ b/pipeworks/flowing_logic.lua @@ -4,7 +4,7 @@ -- Contributed by mauvebic, 2013-01-03, rewritten a bit by Vanessa Ezekowitz -- -local finitewater = minetest.setting_getbool("liquid_finite") +local finitewater = minetest.settings:get_bool("liquid_finite") pipeworks.check_for_liquids = function(pos) local coords = { diff --git a/pipeworks/init.lua b/pipeworks/init.lua index ab5cf3c..a3f31c7 100644 --- a/pipeworks/init.lua +++ b/pipeworks/init.lua @@ -13,7 +13,7 @@ local DEBUG = false pipeworks.worldpath = minetest.get_worldpath() pipeworks.modpath = minetest.get_modpath("pipeworks") -dofile(pipeworks.modpath.."/default_settings.txt") +dofile(pipeworks.modpath.."/default_settings.lua") -- Read the external config file if it exists. local worldsettingspath = pipeworks.worldpath.."/pipeworks_settings.txt" @@ -26,7 +26,7 @@ end -- Random variables pipeworks.expect_infinite_stacks = true -if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then +if minetest.get_modpath("unified_inventory") or not minetest.settings:get_bool("creative_mode") then pipeworks.expect_infinite_stacks = false end diff --git a/pipeworks/item_transport.lua b/pipeworks/item_transport.lua index 43adeea..b2d2aa2 100644 --- a/pipeworks/item_transport.lua +++ b/pipeworks/item_transport.lua @@ -1,6 +1,6 @@ local luaentity = pipeworks.luaentity -local enable_max_limit = minetest.setting_get("pipeworks_enable_items_per_tube_limit") -local max_tube_limit = tonumber(minetest.setting_get("pipeworks_max_items_per_tube")) or 30 +local enable_max_limit = minetest.settings:get("pipeworks_enable_items_per_tube_limit") +local max_tube_limit = tonumber(minetest.settings:get("pipeworks_max_items_per_tube")) or 30 if enable_max_limit == nil then enable_max_limit = true end function pipeworks.tube_item(pos, item) diff --git a/pipeworks/luaentity.lua b/pipeworks/luaentity.lua index ab7280c..382b0c1 100644 --- a/pipeworks/luaentity.lua +++ b/pipeworks/luaentity.lua @@ -71,7 +71,7 @@ end local active_blocks = {} -- These only contain active blocks near players (i.e., not forceloaded ones) local move_entities_globalstep_part1 = function(dtime) - local active_block_range = tonumber(minetest.setting_get("active_block_range")) or 2 + local active_block_range = tonumber(minetest.settings:get("active_block_range")) or 2 local new_active_blocks = {} for _, player in ipairs(minetest.get_connected_players()) do local blockpos = get_blockpos(player:getpos()) diff --git a/pipeworks/settingtypes.txt b/pipeworks/settingtypes.txt new file mode 100644 index 0000000..1d3c10c --- /dev/null +++ b/pipeworks/settingtypes.txt @@ -0,0 +1,70 @@ +#Enable pipes. +pipeworks_enable_pipes (Enable Pipes) bool true + +#Enable autocrafter. +pipeworks_enable_autocrafter (Enable Autocrafter) bool true + +#Enable deployer. +pipeworks_enable_deployer (Enable Deployer) bool true + +#Enable dispenser. +pipeworks_enable_dispenser (Enable Dispenser) bool true + +#Enable node breaker. +pipeworks_enable_node_breaker (Enable Node Breaker) bool true + +#Enable teleport tube. +pipeworks_enable_teleport_tube (Enable Teleport Tube) bool true + +#Enable pipe devices. +pipeworks_enable_pipe_devices (Enable Pipe Devices) bool true + +#Enable redefines. +pipeworks_enable_redefines (Enable Node Redefines) bool true + +#Enable sorting tube. +pipeworks_enable_mese_tube (Enable Sorting Tube) bool true + +#Enable detector tube. +pipeworks_enable_detector_tube (Enable Detector Tube) bool true + +#Enable digiline detector tube. +pipeworks_enable_digiline_detector_tube (Enable Digiline Detector Tube) bool true + +#Enable mesecon signal conducting tube. +pipeworks_enable_conductor_tube (Enable Conductor Tube) bool true + +#Enable accelerator tube. +pipeworks_enable_accelerator_tube (Enable Accelerator Tube) bool true + +#Enable crossing tube. +#It sends all incoming items to the other side, or if there is no other tube, it sends them back. +pipeworks_enable_crossing_tube (Enable Crossing Tube) bool true + +#Enable vacuum tube. +#It picks up all items that lay around next to it. +pipeworks_enable_sand_tube (Enable Vacuum Tube) bool true + +#Enable mese vacuum tube. +#It's like the normal vacuum tube with the +#differance that you can set the radius up to 8 nodes. +pipeworks_enable_mese_sand_tube (Enable Mese Vacuum Tube) bool true + +#Enable one way tube. +#It sends items only in one direction. +#Use it to drop items out of tubes. +pipeworks_enable_one_way_tube (Enable One Way Tube) bool true + +#Enable high priority tube. +#It has a very high priority and so, on crossings, the items will +#always go to it if there are multible ways. +pipeworks_enable_priority_tube (Enable High Priority Tube) bool true + +#Enable cyclic mode. +pipeworks_enable_cyclic_mode (Enable Cyclic Mode) bool true + +#Drop on routing fail. +pipeworks_drop_on_routing_fail (Drop On Routing Fail) bool false + +#Delete item on clearobject. +pipeworks_delete_item_on_clearobject (Delete Item On Clearobject) bool true
\ No newline at end of file diff --git a/pipeworks/signal_tubes.lua b/pipeworks/signal_tubes.lua index 3b2653c..a0a8039 100644 --- a/pipeworks/signal_tubes.lua +++ b/pipeworks/signal_tubes.lua @@ -1,5 +1,5 @@ if pipeworks.enable_detector_tube then - local detector_tube_step = 5 * tonumber(minetest.setting_get("dedicated_server_step")) + local detector_tube_step = 5 * tonumber(minetest.settings:get("dedicated_server_step")) pipeworks.register_tube("pipeworks:detector_tube_on", { description = "Detecting Pneumatic Tube Segment on (you hacker you)", inventory_image = "pipeworks_detector_tube_inv.png", diff --git a/pipeworks/textures/pipeworks_nodebreaker_front_on.png b/pipeworks/textures/pipeworks_nodebreaker_front_on.png Binary files differindex bf7fe70..2b3a4a3 100644 --- a/pipeworks/textures/pipeworks_nodebreaker_front_on.png +++ b/pipeworks/textures/pipeworks_nodebreaker_front_on.png diff --git a/pipeworks/textures/pipeworks_nodebreaker_side1_on.png b/pipeworks/textures/pipeworks_nodebreaker_side1_on.png Binary files differindex ff0a893..96480ef 100644 --- a/pipeworks/textures/pipeworks_nodebreaker_side1_on.png +++ b/pipeworks/textures/pipeworks_nodebreaker_side1_on.png diff --git a/pipeworks/textures/pipeworks_nodebreaker_side2_on.png b/pipeworks/textures/pipeworks_nodebreaker_side2_on.png Binary files differindex ed0e12e..4c8fc40 100644 --- a/pipeworks/textures/pipeworks_nodebreaker_side2_on.png +++ b/pipeworks/textures/pipeworks_nodebreaker_side2_on.png diff --git a/pipeworks/vacuum_tubes.lua b/pipeworks/vacuum_tubes.lua index 51f6f81..211c3ee 100644 --- a/pipeworks/vacuum_tubes.lua +++ b/pipeworks/vacuum_tubes.lua @@ -1,27 +1,27 @@ if pipeworks.enable_sand_tube then pipeworks.register_tube("pipeworks:sand_tube", { - description = "Vacuuming Pneumatic Tube Segment", - inventory_image = "pipeworks_sand_tube_inv.png", - short = "pipeworks_sand_tube_short.png", - noctr = { "pipeworks_sand_tube_noctr.png" }, - plain = { "pipeworks_sand_tube_plain.png" }, - ends = { "pipeworks_sand_tube_end.png" }, - node_def = { groups = {vacuum_tube = 1}}, + description = "Vacuuming Pneumatic Tube Segment", + inventory_image = "pipeworks_sand_tube_inv.png", + short = "pipeworks_sand_tube_short.png", + noctr = {"pipeworks_sand_tube_noctr.png"}, + plain = {"pipeworks_sand_tube_plain.png"}, + ends = {"pipeworks_sand_tube_end.png"}, + node_def = {groups = {vacuum_tube = 1}}, }) minetest.register_craft( { output = "pipeworks:sand_tube_1 2", recipe = { - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, - { "group:sand", "group:sand", "group:sand" }, - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } + {"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"}, + {"group:sand", "group:sand", "group:sand"}, + {"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"} }, }) minetest.register_craft( { output = "pipeworks:sand_tube_1", recipe = { - { "group:sand", "pipeworks:tube_1", "group:sand" }, + {"group:sand", "pipeworks:tube_1", "group:sand"}, }, }) end @@ -31,9 +31,9 @@ if pipeworks.enable_mese_sand_tube then description = "Adjustable Vacuuming Pneumatic Tube Segment", inventory_image = "pipeworks_mese_sand_tube_inv.png", short = "pipeworks_mese_sand_tube_short.png", - noctr = { "pipeworks_mese_sand_tube_noctr.png" }, - plain = { "pipeworks_mese_sand_tube_plain.png" }, - ends = { "pipeworks_mese_sand_tube_end.png" }, + noctr = {"pipeworks_mese_sand_tube_noctr.png"}, + plain = {"pipeworks_mese_sand_tube_plain.png"}, + ends = {"pipeworks_mese_sand_tube_end.png"}, node_def = { groups = {vacuum_tube = 1}, on_construct = function(pos) @@ -63,9 +63,9 @@ if pipeworks.enable_mese_sand_tube then minetest.register_craft( { output = "pipeworks:mese_sand_tube_1 2", recipe = { - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, - { "group:sand", "default:mese_crystal", "group:sand" }, - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } + {"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, + {"group:sand", "default:mese_crystal", "group:sand" }, + {"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } }, }) @@ -82,23 +82,19 @@ if pipeworks.enable_mese_sand_tube then }) end -local sqrt_3 = math.sqrt(3) -local tube_inject_item = pipeworks.tube_inject_item -local get_objects_inside_radius = minetest.get_objects_inside_radius local function vacuum(pos, radius) radius = radius + 0.5 - for _, object in pairs(get_objects_inside_radius(pos, sqrt_3 * radius)) do + for _, object in pairs(minetest.get_objects_inside_radius(pos, math.sqrt(3) * radius)) do local lua_entity = object:get_luaentity() if not object:is_player() and lua_entity and lua_entity.name == "__builtin:item" then local obj_pos = object:getpos() - local x1, y1, z1 = pos.x, pos.y, pos.z - local x2, y2, z2 = obj_pos.x, obj_pos.y, obj_pos.z - - if x1 - radius <= x2 and x2 <= x1 + radius - and y1 - radius <= y2 and y2 <= y1 + radius - and z1 - radius <= z2 and z2 <= z1 + radius then + local minpos = vector.subtract(pos, radius) + local maxpos = vector.add(pos, radius) + if obj_pos.x >= minpos.x and obj_pos.x <= maxpos.x + and obj_pos.y >= minpos.y and obj_pos.y <= maxpos.y + and obj_pos.z >= minpos.z and obj_pos.z <= maxpos.z then if lua_entity.itemstring ~= "" then - tube_inject_item(pos, pos, vector.new(0, 0, 0), lua_entity.itemstring) + pipeworks.tube_inject_item(pos, pos, vector.new(0, 0, 0), lua_entity.itemstring) lua_entity.itemstring = "" end object:remove() @@ -108,15 +104,15 @@ local function vacuum(pos, radius) end minetest.register_abm({nodenames = {"group:vacuum_tube"}, - interval = 1, - chance = 1, - label = "Vacuum tubes", - action = function(pos, node, active_object_count, active_object_count_wider) - if node.name:find("pipeworks:sand_tube") then - vacuum(pos, 2) - else - local radius = minetest.get_meta(pos):get_int("dist") - vacuum(pos, radius) - end - end + interval = 1, + chance = 1, + label = "Vacuum tubes", + action = function(pos, node, active_object_count, active_object_count_wider) + if node.name:find("pipeworks:sand_tube") then + vacuum(pos, 2) + else + local radius = minetest.get_meta(pos):get_int("dist") + vacuum(pos, radius) + end + end }) diff --git a/poisonivy/init.lua b/poisonivy/init.lua index 466b930..8f7f7ba 100644 --- a/poisonivy/init.lua +++ b/poisonivy/init.lua @@ -1,7 +1,12 @@ -- This file supplies poison ivy for the plantlife modpack -- Last revision: 2013-01-24 -local S = biome_lib.intllib +local S +if minetest.get_modpath("intllib") then + S = intllib.Getter() +else + S = function(s) return s end +end local SPAWN_DELAY = 1000 local SPAWN_CHANCE = 200 diff --git a/poisonivy/locale/es.txt b/poisonivy/locale/es.txt new file mode 100644 index 0000000..e9880e4 --- /dev/null +++ b/poisonivy/locale/es.txt @@ -0,0 +1,7 @@ +# Traducido por Carlos Barraza + +Poison ivy (seedling) = Hiedra venenosa (retoño) +Poison ivy (sproutling) = Hiedra venenosa (brotes) +Poison ivy (climbing plant) = Hiedra venenosa (planta trepadora) + +[Poison Ivy] Loaded. = [Hiedra venenosa] Cargado. diff --git a/ropes/crafts.lua b/ropes/crafts.lua index 299c0cc..2c33dd3 100644 --- a/ropes/crafts.lua +++ b/ropes/crafts.lua @@ -3,16 +3,33 @@ 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 +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, diff --git a/ropes/ladder.lua b/ropes/ladder.lua index 5ac872c..7097c72 100644 --- a/ropes/ladder.lua +++ b/ropes/ladder.lua @@ -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} diff --git a/ropes/ropeboxes.lua b/ropes/ropeboxes.lua index 676f1c2..626b158 100644 --- a/ropes/ropeboxes.lua +++ b/ropes/ropeboxes.lua @@ -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} diff --git a/signs_lib/depends.txt b/signs_lib/depends.txt index abb8bd5..7f4e061 100644 --- a/signs_lib/depends.txt +++ b/signs_lib/depends.txt @@ -2,3 +2,4 @@ default intllib? screwdriver? keyword_interact? +craft_guide? diff --git a/signs_lib/init.lua b/signs_lib/init.lua index 536066f..775db95 100644 --- a/signs_lib/init.lua +++ b/signs_lib/init.lua @@ -13,7 +13,7 @@ local enable_colored_metal_signs = true -- CWz's keyword interact mod uses this setting. -local current_keyword = minetest.setting_get("interact_keyword") or "iaccept" +local current_keyword = minetest.settings:get("interact_keyword") or "iaccept" signs_lib = {} screwdriver = screwdriver or {} @@ -165,7 +165,7 @@ end -- infinite stacks -if not minetest.setting_getbool("creative_mode") then +if not minetest.settings:get_bool("creative_mode") then signs_lib.expect_infinite_stacks = false else signs_lib.expect_infinite_stacks = true @@ -793,7 +793,7 @@ minetest.register_node(":locked_sign:sign_wall_locked", { local meta = minetest.get_meta(pos) local owner = meta:get_string("owner") local pname = sender:get_player_name() or "" - if pname ~= owner and pname ~= minetest.setting_get("name") + if pname ~= owner and pname ~= minetest.settings:get("name") and not minetest.check_player_privs(pname, {sign_editor=true}) then return end @@ -806,7 +806,7 @@ minetest.register_node(":locked_sign:sign_wall_locked", { local meta = minetest.get_meta(pos) local owner = meta:get_string("owner") local pname = player:get_player_name() - return pname == owner or pname == minetest.setting_get("name") + return pname == owner or pname == minetest.settings:get("name") or minetest.check_player_privs(pname, {sign_editor=true}) end, on_rotate = signs_lib.wallmounted_rotate @@ -1158,6 +1158,6 @@ if enable_colored_metal_signs then }) end -if minetest.setting_get("log_mods") then +if minetest.settings:get("log_mods") then minetest.log("action", S("signs loaded")) end diff --git a/signs_lib/locale/es.txt b/signs_lib/locale/es.txt new file mode 100644 index 0000000..6741584 --- /dev/null +++ b/signs_lib/locale/es.txt @@ -0,0 +1,9 @@ +#Traducido por Carlos Barraza + +Reading cached character database. = Leyendo la base de datos de caracteres en caché. +Font seems to have changed. Rebuilding cache. = La fuente parece haber cambiado. Reconstruyendo caché. +Could not find font line height in cached DB. Trying brute force. = No se puede encontrar la fuente en la base de datos almacenada en el caché. Tratando fuerza bruta. +Sign = Letrero +%s wrote "%s" to sign at %s = %s escribio "%s" en el cartel en %s +Registered %s and %s = Registrado %s y %s +signs loaded = letreros cargados diff --git a/technic/config.lua b/technic/config.lua index 29321f9..bb748ec 100644 --- a/technic/config.lua +++ b/technic/config.lua @@ -12,6 +12,7 @@ local defaults = { enable_radiation_protection = "true", enable_entity_radiation_damage = "true", enable_longterm_radiation_damage = "true", + enable_nuclear_reactor_digiline_selfdestruct = "false", } for k, v in pairs(defaults) do diff --git a/technic/crafts.lua b/technic/crafts.lua index 9e07978..14bafd3 100644 --- a/technic/crafts.lua +++ b/technic/crafts.lua @@ -9,34 +9,38 @@ minetest.clear_craft({ }) -- Accelerator tube -minetest.clear_craft({ - output = "pipeworks:accelerator_tube_1", -}) +if pipeworks.enable_accelerator_tube then + minetest.clear_craft({ + output = "pipeworks:accelerator_tube_1", + }) + + minetest.register_craft({ + output = 'pipeworks:accelerator_tube_1', + recipe = { + {'technic:copper_coil', 'pipeworks:tube_1', 'technic:copper_coil'}, + } + }) +end -- Teleport tube -minetest.clear_craft({ - output = "pipeworks:teleport_tube_1", -}) +if pipeworks.enable_teleport_tube then + minetest.clear_craft({ + output = "pipeworks:teleport_tube_1", + }) + + minetest.register_craft({ + output = 'pipeworks:teleport_tube_1', + recipe = { + {'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'}, + {'pipeworks:tube_1', 'technic:control_logic_unit', 'pipeworks:tube_1'}, + {'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'}, + } + }) +end -- tubes crafting recipes minetest.register_craft({ - output = 'pipeworks:accelerator_tube_1', - recipe = { - {'technic:copper_coil', 'pipeworks:tube_1', 'technic:copper_coil'}, - } -}) - -minetest.register_craft({ - output = 'pipeworks:teleport_tube_1', - recipe = { - {'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'}, - {'pipeworks:tube_1', 'technic:control_logic_unit', 'pipeworks:tube_1'}, - {'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'}, - } -}) - -minetest.register_craft({ output = 'technic:diamond_drill_head', recipe = { {'technic:stainless_steel_ingot', 'default:diamond', 'technic:stainless_steel_ingot'}, diff --git a/technic/depends.txt b/technic/depends.txt index 777e94f..5bf9f9f 100644 --- a/technic/depends.txt +++ b/technic/depends.txt @@ -2,9 +2,11 @@ default pipeworks technic_worldgen bucket? +screwdriver? mesecons? mesecons_mvps? digilines? +digiline_remote? intllib? unified_inventory? vector_extras? diff --git a/technic/doc/api.md b/technic/doc/api.md new file mode 100644 index 0000000..2e5b6d3 --- /dev/null +++ b/technic/doc/api.md @@ -0,0 +1,130 @@ +This file is fairly incomplete. Help is welcome. + +Tiers +----- +The tier is a string, currently `"LV"`, `"MV"` and `"HV"` are supported. + +Network +------- +The network is the cable with the connected machine nodes. Currently the +switching station handles the network activity. + +Helper functions +---------------- +* `technic.pretty_num(num)` + * Converts the number `num` to a human-readable string. + * Use this function when showing players power values. +* `technic.swap_node(pos, nodename)` + * Same as `mintest.swap_node` but it only changes the nodename. + * It uses `minetest.get_node` before swapping to ensure the new nodename + is not the same as the current one. +* `technic.get_or_load_node(pos)` + * If the mapblock is loaded, it returns the node at pos, + else it loads the chunk and returns `nil`. +* `technic.set_RE_wear(itemstack, item_load, max_charge)` + * If the `wear_represents` field in the item's nodedef is + `"technic_RE_charge"`, this function does nothing. +* `technic.refill_RE_charge(itemstack)` + * This function fully recharges an RE chargeable item. + * If `technic.power_tools[itemstack:get_name()]` is `nil` (or `false`), this + function does nothing, else that value is the maximum charge. + * The itemstack metadata is changed to contain the charge. +* `technic.is_tier_cable(nodename, tier)` + * Tells whether the node `nodename` is the cable of the tier `tier`. +* `technic.get_cable_tier(nodename)` + * Returns the tier of the cable `nodename` or `nil`. +* `technic.trace_node_ray(pos, dir, range)` + * Returns an iteration function (usable in the for loop) to iterate over the + node positions along the specified ray. + * The returned positions will not include the starting position `pos`. +* `technic.trace_node_ray_fat(pos, dir, range)` + * Like `technic.trace_node_ray` but includes extra positions near the ray. + * The node ray functions are used for mining lasers. +* `technic.config:get(name)` + * Some configuration function +* `technic.tube_inject_item(pos, start_pos, velocity, item)` + * Same as `pipeworks.tube_inject_item` + +Registration functions +---------------------- +* `technic.register_power_tool(itemname, max_charge)` + * Same as `technic.power_tools[itemname] = max_charge` + * This function makes the craftitem `itemname` chargeable. +* `technic.register_machine(tier, nodename, machine_type)` + * Same as `technic.machines[tier][nodename] = machine_type` + * Currently this is requisite to make technic recognize your node. + * See also `Machine types` +* `technic.register_tier(tier)` + * Same as `technic.machines[tier] = {}` + * See also `tiers` + +### Specific machines +* `technic.register_solar_array(data)` + * data is a table + +Used itemdef fields +------------------- +* groups: + * `technic_<ltier> = 1` ltier is a tier in small letters; this group makes + the node connect to the cable(s) of the right tier. + * `technic_machine = 1` Currently used for +* `connect_sides` + * In addition to the default use (see lua_api.txt), this tells where the + machine can be connected. +# +# +* `technic_run(pos, node)` + * This function is currently used to update the node. + Modders have to manually change the information about supply etc. in the + node metadata. + +Machine types +------------- +There are currently following types: +* `technic.receiver = "RE"` e.g. grinder +* `technic.producer = "PR"` e.g. solar panel +* `technic.producer_receiver = "PR_RE"` supply converter +* `technic.battery = "BA"` e.g. LV batbox + +Switching Station +----------------- +The switching station is the center of all power distribution on an electric +network. + +The station collects power from sources (PR), distributes it to sinks (RE), +and uses the excess/shortfall to charge and discharge batteries (BA). + +For now, all supply and demand values are expressed in kW. + +It works like this: + All PR,BA,RE nodes are indexed and tagged with the switching station. +The tagging is a workaround to allow more stations to be built without allowing +a cheat with duplicating power. + All the RE nodes are queried for their current EU demand. Those which are off +would require no or a small standby EU demand, while those which are on would +require more. +If the total demand is less than the available power they are all updated with +the demand number. +If any surplus exists from the PR nodes the batteries will be charged evenly +with this. +If the total demand requires draw on the batteries they will be discharged +evenly. + +If the total demand is more than the available power all RE nodes will be shut +down. We have a brown-out situation. + +Hence for now all the power distribution logic resides in this single node. + +### Node meta usage +Nodes connected to the network will have one or more of these parameters as meta +data: + * `<LV|MV|HV>_EU_supply` : Exists for PR and BA node types. + This is the EU value supplied by the node. Output + * `<LV|MV|HV>_EU_demand` : Exists for RE and BA node types. + This is the EU value the node requires to run. Output + * `<LV|MV|HV>_EU_input` : Exists for RE and BA node types. + This is the actual EU value the network can give the node. Input + +The reason the LV|MV|HV type is prepended to meta data is because some machine +could require several supplies to work. +This way the supplies are separated per network. diff --git a/technic/init.lua b/technic/init.lua index 4464082..0d97319 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -5,7 +5,7 @@ local load_start = os.clock() technic = rawget(_G, "technic") or {} -technic.creative_mode = minetest.setting_getbool("creative_mode") +technic.creative_mode = minetest.settings:get_bool("creative_mode") local modpath = minetest.get_modpath("technic") @@ -47,7 +47,7 @@ dofile(modpath.."/tools/init.lua") -- Aliases for legacy node/item names dofile(modpath.."/legacy.lua") -if minetest.setting_getbool("log_mods") then +if minetest.settings:get_bool("log_mods") then print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start)) end diff --git a/technic/machines/HV/forcefield.lua b/technic/machines/HV/forcefield.lua index 3bb8d03..157dc33 100644 --- a/technic/machines/HV/forcefield.lua +++ b/technic/machines/HV/forcefield.lua @@ -17,9 +17,9 @@ local cable_entry = "^technic_cable_connection_overlay.png" minetest.register_craft({ output = "technic:forcefield_emitter_off", recipe = { - {"default:mese", "technic:motor", "default:mese" }, - {"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"}, - {"default:mese", "technic:hv_cable", "default:mese" }, + {"default:mese", "technic:motor", "default:mese" }, + {"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"}, + {"default:mese", "technic:hv_cable", "default:mese" }, } }) @@ -170,44 +170,68 @@ local digiline_def = { if channel ~= meta:get_string("channel") then return end - msg = msg:lower() - if msg == "get" then + local msgt = type(msg) + if msgt == "string" then + local smsg = msg:lower() + msg = {} + if smsg == "get" then + msg.command = "get" + elseif smsg == "off" then + msg.command = "off" + elseif smsg == "on" then + msg.command = "on" + elseif smsg == "toggle" then + msg.command = "toggle" + elseif smsg:sub(1, 5) == "range" then + msg.command = "range" + msg.value = tonumber(smsg:sub(7)) + elseif smsg:sub(1, 5) == "shape" then + msg.command = "shape" + msg.value = smsg:sub(7):lower() + msg.value = tonumber(msg.value) or msg.value + end + elseif msgt ~= "table" then + return + end + if msg.command == "get" then digilines.receptor_send(pos, digilines.rules.default, channel, { enabled = meta:get_int("enabled"), range = meta:get_int("range"), shape = meta:get_int("shape") }) return - elseif msg == "off" then + elseif msg.command == "off" then meta:set_int("enabled", 0) - elseif msg == "on" then + elseif msg.command == "on" then meta:set_int("enabled", 1) - elseif msg == "toggle" then + elseif msg.command == "toggle" then local onn = meta:get_int("enabled") onn = 1-onn -- Mirror onn with pivot 0.5, so switch between 1 and 0. meta:set_int("enabled", onn) - elseif msg:sub(1, 5) == "range" then - local range = tonumber(msg:sub(7)) - if not range then + elseif msg.command == "range" then + if type(msg.value) ~= "number" then return end - range = math.max(range, 5) - range = math.min(range, 20) + msg.value = math.max(msg.value, 5) + msg.value = math.min(msg.value, 20) update_forcefield(pos, meta, false) - meta:set_int("range", range) - elseif msg:sub(1, 5) == "shape" then - local shape = msg:sub(7):lower() - if shape == "sphere" then - shape = 0 - elseif shape == "cube" then - shape = 1 + meta:set_int("range", msg.value) + elseif msg.command == "shape" then + local valuet = type(msg.value) + if valuet == "string" then + if msg.value == "sphere" then + msg.value = 0 + elseif msg.value == "cube" then + msg.value = 1 + end + elseif valuet ~= "number" then + return end - shape = tonumber(shape) - if not shape then + if not msg.value then return end update_forcefield(pos, meta, false) - meta:set_int("shape", shape) + meta:set_int("shape", msg.value) else return end @@ -219,7 +243,8 @@ local digiline_def = { local function run(pos, node) local meta = minetest.get_meta(pos) local eu_input = meta:get_int("HV_EU_input") - local enabled = meta:get_int("enabled") ~= 0 and (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0) + local enabled = meta:get_int("enabled") ~= 0 and + (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0) local machine_name = S("%s Forcefield Emitter"):format("HV") local range = meta:get_int("range") @@ -315,6 +340,10 @@ minetest.register_node("technic:forcefield_emitter_on", { update_forcefield(pos, meta, false) technic.swap_node(pos, "technic:forcefield_emitter_off") end, + on_blast = function(pos, intensity) + minetest.dig_node(pos) + return {"technic:forcefield_emitter_off"} + end, }) minetest.register_node("technic:forcefield", { @@ -323,7 +352,7 @@ minetest.register_node("technic:forcefield", { drawtype = "glasslike", groups = {not_in_creative_inventory=1}, paramtype = "light", - light_source = 15, + light_source = default.LIGHT_MAX, diggable = false, drop = '', tiles = {{ @@ -335,6 +364,8 @@ minetest.register_node("technic:forcefield", { length = 1.0, }, }}, + on_blast = function(pos, intensity) + end, }) diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index 7338d28..3377710 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -12,6 +12,8 @@ intact the reactor will melt down! local burn_ticks = 7 * 24 * 60 * 60 -- Seconds local power_supply = 100000 -- EUs local fuel_type = "technic:uranium_fuel" -- The reactor burns this +local digiline_meltdown = technic.config:get_bool("enable_nuclear_reactor_digiline_selfdestruct") +local digiline_remote_path = minetest.get_modpath("digiline_remote") local S = technic.getter @@ -28,12 +30,26 @@ minetest.register_craft({ } }) -local reactor_formspec = - "invsize[8,9;]".. +local function make_reactor_formspec(meta) + local f = "size[8,9]".. "label[0,0;"..S("Nuclear Reactor Rod Compartment").."]".. "list[current_name;src;2,1;3,2;]".. "list[current_player;main;0,5;8,4;]".. - "listring[]" + "listring[]".. + "button[5.5,1.5;2,1;start;Start]".. + "checkbox[5.5,2.5;autostart;automatic Start;"..meta:get_string("autostart").."]" + if not digiline_remote_path then + return f + end + local digiline_enabled = meta:get_string("enable_digiline") + f = f.."checkbox[0.5,2.8;enable_digiline;Enable Digiline;"..digiline_enabled.."]" + if digiline_enabled ~= "true" then + return f + end + return f.. + "button_exit[4.6,3.69;2,1;save;Save]".. + "field[1,4;4,1;remote_channel;Digiline Remote Channel;${remote_channel}]" +end local SS_OFF = 0 local SS_DANGER = 1 @@ -196,7 +212,37 @@ end local function melt_down_reactor(pos) minetest.log("action", "A reactor melted down at "..minetest.pos_to_string(pos)) - minetest.set_node(pos, {name="technic:corium_source"}) + minetest.set_node(pos, {name = "technic:corium_source"}) +end + + +local function start_reactor(pos, meta) + if minetest.get_node(pos).name ~= "technic:hv_nuclear_reactor_core" then + return false + end + local inv = meta:get_inventory() + if inv:is_empty("src") then + return false + end + local src_list = inv:get_list("src") + local correct_fuel_count = 0 + for _, src_stack in pairs(src_list) do + if src_stack and src_stack:get_name() == fuel_type then + correct_fuel_count = correct_fuel_count + 1 + end + end + -- Check that the reactor is complete and has the correct fuel + if correct_fuel_count ~= 6 or reactor_structure_badness(pos) ~= 0 then + return false + end + meta:set_int("burn_time", 1) + technic.swap_node(pos, "technic:hv_nuclear_reactor_core_active") + meta:set_int("HV_EU_supply", power_supply) + for idx, src_stack in pairs(src_list) do + src_stack:take_item() + inv:set_stack("src", idx, src_stack) + end + return true end @@ -229,27 +275,13 @@ minetest.register_abm({ local function run(pos, node) local meta = minetest.get_meta(pos) local burn_time = meta:get_int("burn_time") or 0 - if burn_time >= burn_ticks or burn_time == 0 then - local inv = meta:get_inventory() - if not inv:is_empty("src") then - local src_list = inv:get_list("src") - local correct_fuel_count = 0 - for _, src_stack in pairs(src_list) do - if src_stack and src_stack:get_name() == fuel_type then - correct_fuel_count = correct_fuel_count + 1 - end - end - -- Check that the reactor is complete and has the correct fuel - if correct_fuel_count == 6 and - reactor_structure_badness(pos) == 0 then - meta:set_int("burn_time", 1) - technic.swap_node(pos, "technic:hv_nuclear_reactor_core_active") - meta:set_int("HV_EU_supply", power_supply) - for idx, src_stack in pairs(src_list) do - src_stack:take_item() - inv:set_stack("src", idx, src_stack) - end + if digiline_remote_path and meta:get_int("HV_EU_supply") == power_supply then + digiline_remote.send_to_node(pos, meta:get_string("remote_channel"), + "fuel used", 6, true) + end + if meta:get_string("autostart") == "true" then + if start_reactor(pos, meta) then return end end @@ -268,6 +300,100 @@ local function run(pos, node) end end +local nuclear_reactor_receive_fields = function(pos, formname, fields, sender) + local player_name = sender:get_player_name() + if minetest.is_protected(pos, player_name) then + minetest.chat_send_player(player_name, "You are not allowed to edit this!") + minetest.record_protection_violation(pos, player_name) + return + end + local meta = minetest.get_meta(pos) + local update_formspec = false + if fields.remote_channel then + meta:set_string("remote_channel", fields.remote_channel) + end + if fields.start then + local b = start_reactor(pos, meta) + if b then + minetest.chat_send_player(player_name, "Start successful") + else + minetest.chat_send_player(player_name, "Error") + end + end + if fields.autostart then + meta:set_string("autostart", fields.autostart) + update_formspec = true + end + if fields.enable_digiline then + meta:set_string("enable_digiline", fields.enable_digiline) + update_formspec = true + end + if update_formspec then + meta:set_string("formspec", make_reactor_formspec(meta)) + end +end + +local digiline_remote_def = function(pos, channel, msg) + local meta = minetest.get_meta(pos) + if meta:get_string("enable_digiline") ~= "true" or + channel ~= meta:get_string("remote_channel") then + return + end + -- Convert string messages to tables: + local msgt = type(msg) + if msgt == "string" then + local smsg = msg:lower() + msg = {} + if smsg == "get" then + msg.command = "get" + elseif smsg:sub(1, 13) == "self_destruct" then + msg.command = "self_destruct" + msg.timer = tonumber(smsg:sub(15)) or 0 + elseif smsg == "start" then + msg.command = "start" + end + elseif msgt ~= "table" then + return + end + + if msg.command == "get" then + local inv = meta:get_inventory() + local invtable = {} + for i = 1, 6 do + local stack = inv:get_stack("src", i) + if stack:is_empty() then + invtable[i] = 0 + elseif stack:get_name() == fuel_type then + invtable[i] = stack:get_count() + else + invtable[i] = -stack:get_count() + end + end + digiline_remote.send_to_node(pos, channel, { + burn_time = meta:get_int("burn_time"), + enabled = meta:get_int("HV_EU_supply") == power_supply, + siren = meta:get_int("siren") == 1, + structure_accumulated_badness = meta:get_int("structure_accumulated_badness"), + rods = invtable + }, 6, true) + elseif digiline_meltdown and msg.command == "self_destruct" and + minetest.get_node(pos).name == "technic:hv_nuclear_reactor_core_active" then + if msg.timer ~= 0 and type(msg.timer) == "number" then + siren_danger(pos, meta) + minetest.after(msg.timer, melt_down_reactor, pos) + else + melt_down_reactor(pos) + end + elseif msg.command == "start" then + local b = start_reactor(pos, meta) + if b then + digiline_remote.send_to_node(pos, channel, "Start successful", 6, true) + else + digiline_remote.send_to_node(pos, channel, "Error", 6, true) + end + end +end + minetest.register_node("technic:hv_nuclear_reactor_core", { description = reactor_desc, tiles = { @@ -276,19 +402,25 @@ minetest.register_node("technic:hv_nuclear_reactor_core", { }, drawtype = "mesh", mesh = "technic_reactor.obj", - groups = {cracky=1, technic_machine=1, technic_hv=1}, + groups = {cracky = 1, technic_machine = 1, technic_hv = 1, digiline_remote_receive = 1}, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), paramtype = "light", paramtype2 = "facedir", stack_max = 1, + on_receive_fields = nuclear_reactor_receive_fields, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", reactor_desc) - meta:set_string("formspec", reactor_formspec) + meta:set_string("formspec", make_reactor_formspec(meta)) + if digiline_remote_path then + meta:set_string("remote_channel", + "nucelear_reactor"..minetest.pos_to_string(pos)) + end local inv = meta:get_inventory() inv:set_size("src", 6) end, + _on_digiline_remote_receive = digiline_remote_def, can_dig = technic.machine_can_dig, on_destruct = function(pos) siren_set_state(pos, SS_OFF) end, allow_metadata_inventory_put = technic.machine_inventory_put, @@ -304,14 +436,16 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", { }, drawtype = "mesh", mesh = "technic_reactor.obj", - groups = {cracky=1, technic_machine=1, technic_hv=1, - radioactive=4, not_in_creative_inventory=1}, + groups = {cracky = 1, technic_machine = 1, technic_hv = 1, radioactive = 4, + not_in_creative_inventory = 1, digiline_remote_receive = 1}, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), drop = "technic:hv_nuclear_reactor_core", light_source = 14, paramtype = "light", paramtype2 = "facedir", + on_receive_fields = nuclear_reactor_receive_fields, + _on_digiline_remote_receive = digiline_remote_def, can_dig = technic.machine_can_dig, after_dig_node = melt_down_reactor, on_destruct = function(pos) siren_set_state(pos, SS_OFF) end, diff --git a/technic/machines/other/frames.lua b/technic/machines/other/frames.lua index 2d630a2..5459289 100644 --- a/technic/machines/other/frames.lua +++ b/technic/machines/other/frames.lua @@ -3,7 +3,7 @@ local S = technic.getter frames = {} -local infinite_stacks = minetest.setting_getbool("creative_mode") and minetest.get_modpath("unified_inventory") == nil +local infinite_stacks = minetest.settings:get_bool("creative_mode") and minetest.get_modpath("unified_inventory") == nil local frames_pos = {} diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index c04875b..84e992c 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -12,12 +12,59 @@ technic.register_power_tool("technic:red_energy_crystal", 50000) technic.register_power_tool("technic:green_energy_crystal", 150000) technic.register_power_tool("technic:blue_energy_crystal", 450000) +-- Battery recipes: +-- Tin-copper recipe: minetest.register_craft({ - output = 'technic:battery', + output = "technic:battery", recipe = { - {'group:wood', 'default:copper_ingot', 'group:wood'}, - {'group:wood', 'moreores:tin_ingot', 'group:wood'}, - {'group:wood', 'default:copper_ingot', 'group:wood'}, + {"group:wood", "default:copper_ingot", "group:wood"}, + {"group:wood", "moreores:tin_ingot", "group:wood"}, + {"group:wood", "default:copper_ingot", "group:wood"}, + } +}) +-- Sulfur-lead-water recipes: +-- With sulfur lumps: +-- With water: +minetest.register_craft({ + output = "technic:battery", + recipe = { + {"group:wood", "technic:sulfur_lump", "group:wood"}, + {"technic:lead_ingot", "bucket:bucket_water", "technic:lead_ingot"}, + {"group:wood", "technic:sulfur_lump", "group:wood"}, + }, + replacements = { + {"bucket:bucket_water", "bucket:bucket_empty"} + } +}) +-- With oil extract: +minetest.register_craft({ + output = "technic:battery", + recipe = { + {"group:wood", "technic:sulfur_lump", "group:wood"}, + {"technic:lead_ingot", "homedecor:oil_extract", "technic:lead_ingot"}, + {"group:wood", "technic:sulfur_lump", "group:wood"}, + } +}) +-- With sulfur dust: +-- With water: +minetest.register_craft({ + output = "technic:battery", + recipe = { + {"group:wood", "technic:sulfur_dust", "group:wood"}, + {"technic:lead_ingot", "bucket:bucket_water", "technic:lead_ingot"}, + {"group:wood", "technic:sulfur_dust", "group:wood"}, + }, + replacements = { + {"bucket:bucket_water", "bucket:bucket_empty"} + } +}) +-- With oil extract: +minetest.register_craft({ + output = "technic:battery", + recipe = { + {"group:wood", "technic:sulfur_dust", "group:wood"}, + {"technic:lead_ingot", "homedecor:oil_extract", "technic:lead_ingot"}, + {"group:wood", "technic:sulfur_dust", "group:wood"}, } }) @@ -35,26 +82,38 @@ minetest.register_tool("technic:battery", { } }) +-- x+2 + (z+2)*2 +local dirtab = { + [4] = 2, + [5] = 3, + [7] = 1, + [8] = 0 +} + local tube = { insert_object = function(pos, node, stack, direction) - if direction.y == 0 then + print(minetest.pos_to_string(direction), dirtab[direction.x+2+(direction.z+2)*2], node.param2) + if direction.y == 1 + or (direction.y == 0 and dirtab[direction.x+2+(direction.z+2)*2] == node.param2) then return stack end local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - if direction.y > 0 then + if direction.y == 0 then return inv:add_item("src", stack) else return inv:add_item("dst", stack) end end, can_insert = function(pos, node, stack, direction) - if direction.y == 0 then + print(minetest.pos_to_string(direction), dirtab[direction.x+2+(direction.z+2)*2], node.param2) + if direction.y == 1 + or (direction.y == 0 and dirtab[direction.x+2+(direction.z+2)*2] == node.param2) then return false end local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - if direction.y > 0 then + if direction.y == 0 then if meta:get_int("split_src_stacks") == 1 then stack = stack:peek_item(1) end @@ -66,7 +125,7 @@ local tube = { return inv:room_for_item("dst", stack) end end, - connect_sides = {left=1, right=1, back=1, top=1, bottom=1}, + connect_sides = {left=1, right=1, back=1, top=1}, } local function add_on_off_buttons(meta, ltier, charge_percent) @@ -219,13 +278,12 @@ function technic.register_battery_box(data) local top_tex = "technic_"..ltier.."_battery_box_top.png"..tube_entry local front_tex = "technic_"..ltier.."_battery_box_front.png^technic_power_meter"..i..".png" local side_tex = "technic_"..ltier.."_battery_box_side.png"..tube_entry - local bottom_tex = "technic_"..ltier.."_battery_box_bottom.png"..tube_entry + local bottom_tex = "technic_"..ltier.."_battery_box_bottom.png"..cable_entry if ltier == "lv" then top_tex = "technic_"..ltier.."_battery_box_top.png" front_tex = "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png" side_tex = "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png" - bottom_tex = "technic_"..ltier.."_battery_box_bottom.png"..cable_entry end minetest.register_node("technic:"..ltier.."_battery_box"..i, { @@ -271,6 +329,7 @@ function technic.register_battery_box(data) allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_move = technic.machine_inventory_move, technic_run = run, + on_rotate = screwdriver.rotate_simple, after_place_node = data.tube and pipeworks.after_place, after_dig_node = technic.machine_after_dig_node, on_receive_fields = function(pos, formname, fields, sender) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index d65c399..1e8cee9 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -203,12 +203,31 @@ function technic.register_cable(tier, size) def.on_place = function(itemstack, placer, pointed_thing) local pointed_thing_diff = vector.subtract(pointed_thing.above, pointed_thing.under) local num + local changed for k, v in pairs(pointed_thing_diff) do if v ~= 0 then + changed = k num = xyz[s(tostring(v):sub(-2, -2)..k)] break end end + local crtl = placer:get_player_control() + if (crtl.aux1 or crtl.sneak) and not (crtl.aux1 and crtl.sneak) then + local fine_pointed = minetest.pointed_thing_to_face_pos(placer, pointed_thing) + fine_pointed = vector.subtract(fine_pointed, pointed_thing.above) + fine_pointed[changed] = nil + local ps = {} + for p, _ in pairs(fine_pointed) do + ps[#ps+1] = p + end + local bigger = (math.abs(fine_pointed[ps[1]]) > math.abs(fine_pointed[ps[2]]) and ps[1]) or ps[2] + if math.abs(fine_pointed[bigger]) < 0.3 then + num = num + 3 + num = (num <= 6 and num) or num - 6 + else + num = xyz[((fine_pointed[bigger] < 0 and "-") or "") .. bigger] + end + end minetest.set_node(pointed_thing.above, {name = "technic:"..ltier.."_cable_plate_"..num}) if not (creative and creative.is_enabled_for(placer)) then itemstack:take_item() @@ -218,6 +237,19 @@ function technic.register_cable(tier, size) else def.groups.not_in_creative_inventory = 1 end + def.on_rotate = function(pos, node, user, mode, new_param2) + local dir = 0 + if mode == screwdriver.ROTATE_FACE then -- left-click + dir = 1 + elseif mode == screwdriver.ROTATE_AXIS then -- right-click + dir = -1 + end + local num = tonumber(node.name:sub(-1)) + num = num + dir + num = (num >= 1 and num) or num + 6 + num = (num <= 6 and num) or num - 6 + minetest.swap_node(pos, {name = "technic:"..ltier.."_cable_plate_"..num}) + end minetest.register_node("technic:"..ltier.."_cable_plate_"..i, def) cable_tier["technic:"..ltier.."_cable_plate_"..i] = tier end diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index 9c6f32c..40b40e7 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -1,35 +1,4 @@ --- SWITCHING STATION --- The switching station is the center of all power distribution on an electric network. --- --- The station collects power from sources (PR), distributes it to sinks (RE), --- and uses the excess/shortfall to charge and discharge batteries (BA). --- --- For now, all supply and demand values are expressed in kW. --- --- It works like this: --- All PR,BA,RE nodes are indexed and tagged with the switching station. --- The tagging is to allow more stations to be built without allowing a cheat --- with duplicating power. --- All the RE nodes are queried for their current EU demand. Those which are off --- would require no or a small standby EU demand, while those which are on would --- require more. --- If the total demand is less than the available power they are all updated with the --- demand number. --- If any surplus exists from the PR nodes the batteries will be charged evenly with this. --- If the total demand requires draw on the batteries they will be discharged evenly. --- --- If the total demand is more than the available power all RE nodes will be shut down. --- We have a brown-out situation. --- --- Hence all the power distribution logic resides in this single node. --- --- Nodes connected to the network will have one or more of these parameters as meta data: --- <LV|MV|HV>_EU_supply : Exists for PR and BA node types. This is the EU value supplied by the node. Output --- <LV|MV|HV>_EU_demand : Exists for RE and BA node types. This is the EU value the node requires to run. Output --- <LV|MV|HV>_EU_input : Exists for RE and BA node types. This is the actual EU value the network can give the node. Input --- --- The reason the LV|MV|HV type is prepended toe meta data is because some machine could require several supplies to work. --- This way the supplies are separated per network. +-- See also technic/doc/api.md technic.networks = {} technic.cables = {} diff --git a/technic/radiation.lua b/technic/radiation.lua index 6a93483..722b0ac 100644 --- a/technic/radiation.lua +++ b/technic/radiation.lua @@ -344,7 +344,7 @@ local function dmg_abm(pos, node) end end -if minetest.setting_getbool("enable_damage") then +if minetest.settings:get_bool("enable_damage") then minetest.register_abm({ label = "Radiation damage", nodenames = {"group:radioactive"}, @@ -384,7 +384,7 @@ for _, state in pairs({"flowing", "source"}) do minetest.register_node("technic:corium_"..state, { description = S(state == "source" and "Corium Source" or "Flowing Corium"), drawtype = (state == "source" and "liquid" or "flowingliquid"), - [state == "source" and "tiles" or "special_tiles"] = {{ + tiles = {{ name = "technic_corium_"..state.."_animated.png", animation = { type = "vertical_frames", @@ -393,6 +393,28 @@ for _, state in pairs({"flowing", "source"}) do length = 3.0, }, }}, + special_tiles = { + { + name = "technic_corium_"..state.."_animated.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.0, + }, + }, + { + name = "technic_corium_"..state.."_animated.png", + backface_culling = true, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.0, + }, + }, + }, paramtype = "light", paramtype2 = (state == "flowing" and "flowingliquid" or nil), light_source = (state == "source" and 8 or 5), diff --git a/technic/tools/vacuum.lua b/technic/tools/vacuum.lua index f5fac9a..037f3bb 100644 --- a/technic/tools/vacuum.lua +++ b/technic/tools/vacuum.lua @@ -26,7 +26,7 @@ minetest.register_tool("technic:vacuum", { end local pos = user:getpos() local inv = user:get_inventory() - for _, object in ipairs(minetest.env:get_objects_inside_radius(pos, vacuum_range)) do + for _, object in ipairs(minetest.get_objects_inside_radius(pos, vacuum_range)) do local luaentity = object:get_luaentity() if not object:is_player() and luaentity and luaentity.name == "__builtin:item" and luaentity.itemstring ~= "" then if inv and inv:room_for_item("main", ItemStack(luaentity.itemstring)) then diff --git a/technic_chests/locale/es.txt b/technic_chests/locale/es.txt new file mode 100644 index 0000000..ec38d3f --- /dev/null +++ b/technic_chests/locale/es.txt @@ -0,0 +1,39 @@ +# technic_chests translation template + +%s Chest = Cofre de %s +%s Locked Chest = Cofre de %s Bloqueado +%s Locked Chest (owned by %s) = Cofre de %s Bloqueado (propiedad de %s) +Color Filter: %s = Filtro por Color: %s +Edit chest description: = Editar la descripción del cofre + +# Colors +Black = Negro +Blue = Azul +Brown = Café +Cyan = Cian +Dark Green = Verde Oscuro +Dark Grey = Gris Oscuro +Green = Verde +Grey = Gris +Magenta = Magenta +Orange = Naranja +Pink = Rosado +Red = Rojo +Violet = Violeta +White = Blanco +Yellow = Amarillo +None = Ninguno + +# Materials +Copper = Cobre +Gold = Oro +Iron = Hierro +Mithril = Mitrilo +Silver = Plata +Wooden = Madera + +# Sorting +Sort = Ordenar +Auto-sort is %s = El orden Automático esta %s +Off = Apagado +On = Encendido diff --git a/technic_worldgen/locale/es.txt b/technic_worldgen/locale/es.txt new file mode 100644 index 0000000..a3920c2 --- /dev/null +++ b/technic_worldgen/locale/es.txt @@ -0,0 +1,36 @@ +# technic_worldgen traducido por Carlos Barraza + +###crafts.lua +Uranium Lump = Pepita de Uranio +Uranium Ingot = Lingote de Uranio +Chromium Lump = Pepita de Cromo +Chromium Ingot = Lingote de Cromo +Zinc Lump = Pepita de Zinc +Zinc Ingot = Lingote de Zinc +Brass Ingot = Lingote de Latón +Wrought Iron Ingot = Lingote de Hierro Forjado +Cast Iron Ingot = Lingote de Hierro Fundido +Carbon Steel Ingot = Lingote de Acero al Carbon +Stainless Steel Ingot = Lingote de Acero inoxidable +Iron = Lingote + +###nodes.lua +Uranium Ore = Mineral de Uranio +Chromium Ore = Mineral de Cromo +Zinc Ore = Mineral de Zinc +Granite = Granito +Marble = Mármol +Marble Bricks = Ladrillos de Mármol +Uranium Block = Bloque de Uranio +Chromium Block = Bloque de Cromo +Zinc Block = Bloque de Zinc +Wrought Iron Block = Bloque de Hierro Forjado +Cast Iron Block = Bloque de Hierro Fundido +Carbon Steel Block = Bloque de Acero al Carbon +Stainless Steel Block = Bloque de Acero Inoxidable +Brass Block = Bloque de Latón +Wrought Iron = Hierro Forjado + +###rubber.lua +Rubber Tree Sapling = Retoño de Árbol de Goma +Rubber Tree = Árbol de Goma diff --git a/technic_worldgen/oregen.lua b/technic_worldgen/oregen.lua index 96a3c19..8e7af91 100644 --- a/technic_worldgen/oregen.lua +++ b/technic_worldgen/oregen.lua @@ -118,7 +118,7 @@ minetest.register_ore({ }) -- Sulfur -local sulfur_buf = nil +local sulfur_buf = {} local sulfur_noise= nil minetest.register_on_generated(function(minp, maxp, seed) diff --git a/technic_worldgen/rubber.lua b/technic_worldgen/rubber.lua index 3307b8b..11da9ca 100644 --- a/technic_worldgen/rubber.lua +++ b/technic_worldgen/rubber.lua @@ -10,7 +10,7 @@ minetest.register_node(":moretrees:rubber_tree_sapling", { wield_image = "technic_rubber_sapling.png", paramtype = "light", walkable = false, - groups = {dig_immediate=3, flammable=2}, + groups = {dig_immediate=3, flammable=2, sapling=1}, sounds = default.node_sound_defaults(), }) @@ -98,4 +98,3 @@ if technic.config:get_bool("enable_rubber_tree_generation") then end end) end - diff --git a/unified_inventory/README.md b/unified_inventory/README.md index 489ebab..d0ca9cf 100644 --- a/unified_inventory/README.md +++ b/unified_inventory/README.md @@ -20,4 +20,4 @@ RealBadAngel: (WTFPL) * Everything else. Tango Project: (WTFPL) - * `ui_reset_icon.png + * `ui_reset_icon.png` diff --git a/unifiedbricks/init.lua b/unifiedbricks/init.lua index 4d1f44c..80eba02 100644 --- a/unifiedbricks/init.lua +++ b/unifiedbricks/init.lua @@ -95,11 +95,12 @@ FORMALDARKNESS = { minetest.register_node("unifiedbricks:brickblock", { description = "Brick Block", tiles = { - "unifiedbricks_brickblock.png", - { name = "unifiedbricks_mortar.png", color = 0xffffffff }, + "unifiedbricks_brickblock.png" }, - drawtype = "mesh", - mesh = "unifiedbricks_brick_block.obj", + overlay_tiles = { + { name = "unifiedbricks_mortar.png", color = "white" } + }, + use_texture_alpha = true, paramtype = "light", paramtype2 = "color", palette = "unifieddyes_palette_extended.png", @@ -150,10 +151,11 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_dark", { description = "Brick block (dark multicolor)", tiles = { "unifiedbricks_brickblock_multicolor_dark.png", - { name = "unifiedbricks_mortar.png", color = 0xffffffff }, }, - drawtype = "mesh", - mesh = "unifiedbricks_brick_block.obj", + overlay_tiles = { + { name = "unifiedbricks_mortar2.png", color = "white" } + }, + use_texture_alpha = true, paramtype = "light", paramtype2 = "color", palette = "unifieddyes_palette_extended.png", @@ -169,11 +171,12 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_dark", { minetest.register_node("unifiedbricks:brickblock_multicolor_medium", { description = "Brick block (medium multicolor)", tiles = { - "unifiedbricks_brickblock_multicolor_medium.png", - { name = "unifiedbricks_mortar.png", color = 0xffffffff }, + "unifiedbricks_brickblock_multicolor_medium.png" }, - drawtype = "mesh", - mesh = "unifiedbricks_brick_block.obj", + overlay_tiles = { + { name = "unifiedbricks_mortar3.png", color = "white" } + }, + use_texture_alpha = true, paramtype = "light", paramtype2 = "color", palette = "unifieddyes_palette_extended.png", @@ -189,11 +192,12 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_medium", { minetest.register_node("unifiedbricks:brickblock_multicolor_light", { description = "Brick block (light multicolor)", tiles = { - "unifiedbricks_brickblock_multicolor_light.png", - { name = "unifiedbricks_mortar.png", color = 0xffffffff }, + "unifiedbricks_brickblock_multicolor_light.png" + }, + overlay_tiles = { + { name = "unifiedbricks_mortar4.png", color = "white" } }, - drawtype = "mesh", - mesh = "unifiedbricks_brick_block.obj", + use_texture_alpha = true, paramtype = "light", paramtype2 = "color", palette = "unifieddyes_palette_extended.png", diff --git a/unifiedbricks/textures/unifiedbricks_mortar2.png b/unifiedbricks/textures/unifiedbricks_mortar2.png Binary files differnew file mode 100644 index 0000000..6d52335 --- /dev/null +++ b/unifiedbricks/textures/unifiedbricks_mortar2.png diff --git a/unifiedbricks/textures/unifiedbricks_mortar3.png b/unifiedbricks/textures/unifiedbricks_mortar3.png Binary files differnew file mode 100644 index 0000000..6d52335 --- /dev/null +++ b/unifiedbricks/textures/unifiedbricks_mortar3.png diff --git a/unifiedbricks/textures/unifiedbricks_mortar4.png b/unifiedbricks/textures/unifiedbricks_mortar4.png Binary files differnew file mode 100644 index 0000000..6d52335 --- /dev/null +++ b/unifiedbricks/textures/unifiedbricks_mortar4.png diff --git a/unifieddyes/init.lua b/unifieddyes/init.lua index 9b85903..35b2e72 100644 --- a/unifieddyes/init.lua +++ b/unifieddyes/init.lua @@ -33,7 +33,7 @@ unifieddyes = {} unifieddyes.last_used_dye = {} unifieddyes.last_dyed_node = {} -local creative_mode = minetest.setting_getbool("creative_mode") +local creative_mode = minetest.settings:get_bool("creative_mode") -- Boilerplate to support localized strings if intllib mod is installed. local S @@ -207,8 +207,8 @@ end) function unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) local node = minetest.get_node(pos) - local yaw = placer:get_look_yaw() - local dir = minetest.yaw_to_dir(yaw-1.5) + local yaw = placer:get_look_horizontal() + local dir = minetest.yaw_to_dir(yaw) -- -1.5) local pitch = placer:get_look_vertical() local fdir = minetest.dir_to_wallmounted(dir) @@ -226,8 +226,8 @@ end function unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) local node = minetest.get_node(pos) - local yaw = placer:get_look_yaw() - local dir = minetest.yaw_to_dir(yaw) + local yaw = placer:get_look_horizontal() + local dir = minetest.yaw_to_dir(yaw+1.5) local fdir = minetest.dir_to_wallmounted(dir) minetest.swap_node(pos, { name = node.name, param2 = fdir }) end diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 12c296c..325a31c 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -1123,16 +1123,13 @@ minetest.register_chatcommand("/lua", { description = "Executes <code> as a Lua chunk in the global namespace",
privs = {worldedit=true, server=true},
func = function(name, param)
- local admin = minetest.setting_get("name")
- if not admin or not name == admin then
- worldedit.player_notify(name, "this command can only be run by the server administrator")
- return
- end
local err = worldedit.lua(param)
if err then
worldedit.player_notify(name, "code error: " .. err)
+ minetest.log("action", name.." tried to execute "..param)
else
worldedit.player_notify(name, "code successfully executed", false)
+ minetest.log("action", name.." executed "..param)
end
end,
})
@@ -1142,17 +1139,13 @@ minetest.register_chatcommand("/luatransform", { description = "Executes <code> as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region",
privs = {worldedit=true, server=true},
func = safe_region(function(name, param)
- local admin = minetest.setting_get("name")
- if not admin or not name == admin then
- worldedit.player_notify(name, "this command can only be run by the server administrator")
- return
- end
-
local err = worldedit.luatransform(worldedit.pos1[name], worldedit.pos2[name], param)
if err then
worldedit.player_notify(name, "code error: " .. err, false)
+ minetest.log("action", name.." tried to execute luatransform "..param)
else
worldedit.player_notify(name, "code successfully executed", false)
+ minetest.log("action", name.." executed luatransform "..param)
end
end),
})
diff --git a/worldedit_gui/functionality.lua b/worldedit_gui/functionality.lua index 5cbf8fa..17a8a79 100644 --- a/worldedit_gui/functionality.lua +++ b/worldedit_gui/functionality.lua @@ -46,7 +46,7 @@ local combine_privs = function(...) for i, privs in ipairs({...}) do
for name, value in pairs(privs) do
if result[name] ~= nil and result[name] ~= value then --the priv must be both true and false, which can never happen
- return {__fake_priv_that_nobody_has__=true} --priviledge table that can never be satisfied
+ return {__fake_priv_that_nobody_has__=true} --privilege table that can never be satisfied
end
result[name] = value
end
@@ -60,22 +60,38 @@ local formspec_node = function(pos, nodename) or string.format("image[%s;1,1;worldedit_gui_unknown.png]", pos)
end
+-- two further priv helpers
+local function we_privs(command)
+ return minetest.chatcommands["/" .. command].privs
+end
+
+local function combine_we_privs(list)
+ local args = {}
+ for _, t in ipairs(list) do
+ table.insert(args, we_privs(t))
+ end
+ return combine_privs(unpack(args))
+end
+
worldedit.register_gui_function("worldedit_gui_about", {
- name = "About", privs = minetest.chatcommands["/about"].privs,
+ name = "About",
+ privs = {interact=true},
on_select = function(name)
minetest.chatcommands["/about"].func(name, "")
end,
})
worldedit.register_gui_function("worldedit_gui_inspect", {
- name = "Toggle Inspect", privs = minetest.chatcommands["/inspect"].privs,
+ name = "Toggle Inspect",
+ privs = we_privs("inspect"),
on_select = function(name)
minetest.chatcommands["/inspect"].func(name, worldedit.inspect[name] and "disable" or "enable")
end,
})
worldedit.register_gui_function("worldedit_gui_region", {
- name = "Get/Set Region", privs = combine_privs(minetest.chatcommands["/p"].privs, minetest.chatcommands["/pos1"].privs, minetest.chatcommands["/pos2"].privs, minetest.chatcommands["/reset"].privs, minetest.chatcommands["/mark"].privs, minetest.chatcommands["/unmark"].privs, minetest.chatcommands["/volume"].privs, minetest.chatcommands["/fixedpos"].privs),
+ name = "Get/Set Region",
+ privs = combine_we_privs({"p", "pos1", "pos2", "reset", "mark", "unmark", "volume", "fixedpos"}),
get_formspec = function(name)
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
return "size[9,7]" .. worldedit.get_formspec_header("worldedit_gui_region") ..
@@ -154,7 +170,8 @@ worldedit.register_gui_handler("worldedit_gui_region", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_set", {
- name = "Set Nodes", privs = minetest.chatcommands["/set"].privs,
+ name = "Set Nodes",
+ privs = we_privs("set"),
get_formspec = function(name)
local node = gui_nodename1[name]
local nodename = worldedit.normalize_nodename(node)
@@ -182,7 +199,8 @@ worldedit.register_gui_handler("worldedit_gui_set", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_replace", {
- name = "Replace Nodes", privs = combine_privs(minetest.chatcommands["/replace"].privs, minetest.chatcommands["/replaceinverse"].privs),
+ name = "Replace Nodes",
+ privs = combine_we_privs({"replace", "replaceinverse"}),
get_formspec = function(name)
local search, replace = gui_nodename1[name], gui_nodename2[name]
local search_nodename, replace_nodename = worldedit.normalize_nodename(search), worldedit.normalize_nodename(replace)
@@ -224,7 +242,8 @@ worldedit.register_gui_handler("worldedit_gui_replace", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_sphere_dome", {
- name = "Sphere/Dome", privs = combine_privs(minetest.chatcommands["/hollowsphere"].privs, minetest.chatcommands["/sphere"].privs, minetest.chatcommands["/hollowdome"].privs, minetest.chatcommands["/dome"].privs),
+ name = "Sphere/Dome",
+ privs = combine_we_privs({"hollowsphere", "sphere", "hollowdome", "dome"}),
get_formspec = function(name)
local node, radius = gui_nodename1[name], gui_distance2[name]
local nodename = worldedit.normalize_nodename(node)
@@ -270,7 +289,8 @@ worldedit.register_gui_handler("worldedit_gui_sphere_dome", function(name, field end)
worldedit.register_gui_function("worldedit_gui_cylinder", {
- name = "Cylinder", privs = combine_privs(minetest.chatcommands["/hollowcylinder"].privs, minetest.chatcommands["/cylinder"].privs),
+ name = "Cylinder",
+ privs = combine_we_privs({"hollowcylinder", "cylinder"}),
get_formspec = function(name)
local node, axis, length, radius = gui_nodename1[name], gui_axis1[name], gui_distance1[name], gui_distance2[name]
local nodename = worldedit.normalize_nodename(node)
@@ -318,7 +338,8 @@ worldedit.register_gui_handler("worldedit_gui_cylinder", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_pyramid", {
- name = "Pyramid", privs = minetest.chatcommands["/pyramid"].privs,
+ name = "Pyramid",
+ privs = we_privs("pyramid"),
get_formspec = function(name)
local node, axis, length = gui_nodename1[name], gui_axis1[name], gui_distance1[name]
local nodename = worldedit.normalize_nodename(node)
@@ -363,7 +384,8 @@ worldedit.register_gui_handler("worldedit_gui_pyramid", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_spiral", {
- name = "Spiral", privs = minetest.chatcommands["/spiral"].privs,
+ name = "Spiral",
+ privs = we_privs("spiral"),
get_formspec = function(name)
local node, length, height, space = gui_nodename1[name], gui_distance1[name], gui_distance2[name], gui_distance3[name]
local nodename = worldedit.normalize_nodename(node)
@@ -397,7 +419,8 @@ worldedit.register_gui_handler("worldedit_gui_spiral", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_copy_move", {
- name = "Copy/Move", privs = combine_privs(minetest.chatcommands["/copy"].privs, minetest.chatcommands["/move"].privs),
+ name = "Copy/Move",
+ privs = combine_we_privs({"copy", "move"}),
get_formspec = function(name)
local axis = gui_axis1[name] or 4
local amount = gui_distance1[name] or "10"
@@ -430,7 +453,8 @@ worldedit.register_gui_handler("worldedit_gui_copy_move", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_stack", {
- name = "Stack", privs = minetest.chatcommands["/stack"].privs,
+ name = "Stack",
+ privs = we_privs("stack"),
get_formspec = function(name)
local axis, count = gui_axis1[name], gui_count1[name]
return "size[6.5,3]" .. worldedit.get_formspec_header("worldedit_gui_stack") ..
@@ -457,7 +481,8 @@ worldedit.register_gui_handler("worldedit_gui_stack", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_stretch", {
- name = "Stretch", privs = minetest.chatcommands["/stretch"].privs,
+ name = "Stretch",
+ privs = we_privs("stretch"),
get_formspec = function(name)
local stretchx, stretchy, stretchz = gui_count1[name], gui_count2[name], gui_count3[name]
return "size[5,5]" .. worldedit.get_formspec_header("worldedit_gui_stretch") ..
@@ -481,7 +506,8 @@ worldedit.register_gui_handler("worldedit_gui_stretch", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_transpose", {
- name = "Transpose", privs = minetest.chatcommands["/transpose"].privs,
+ name = "Transpose",
+ privs = we_privs("transpose"),
get_formspec = function(name)
local axis1, axis2 = gui_axis1[name], gui_axis2[name]
return "size[5.5,3]" .. worldedit.get_formspec_header("worldedit_gui_transpose") ..
@@ -512,7 +538,8 @@ worldedit.register_gui_handler("worldedit_gui_transpose", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_flip", {
- name = "Flip", privs = minetest.chatcommands["/flip"].privs,
+ name = "Flip",
+ privs = we_privs("flip"),
get_formspec = function(name)
local axis = gui_axis1[name]
return "size[5,3]" .. worldedit.get_formspec_header("worldedit_gui_flip") ..
@@ -537,7 +564,8 @@ worldedit.register_gui_handler("worldedit_gui_flip", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_rotate", {
- name = "Rotate", privs = minetest.chatcommands["/rotate"].privs,
+ name = "Rotate",
+ privs = we_privs("rotate"),
get_formspec = function(name)
local axis, angle = gui_axis1[name], gui_angle[name]
return "size[5.5,3]" .. worldedit.get_formspec_header("worldedit_gui_rotate") ..
@@ -569,7 +597,8 @@ worldedit.register_gui_handler("worldedit_gui_rotate", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_orient", {
- name = "Orient", privs = minetest.chatcommands["/orient"].privs,
+ name = "Orient",
+ privs = we_privs("orient"),
get_formspec = function(name)
local angle = gui_angle[name]
return "size[5,3]" .. worldedit.get_formspec_header("worldedit_gui_orient") ..
@@ -594,21 +623,24 @@ worldedit.register_gui_handler("worldedit_gui_orient", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_fixlight", {
- name = "Fix Lighting", privs = minetest.chatcommands["/fixlight"].privs,
+ name = "Fix Lighting",
+ privs = we_privs("fixlight"),
on_select = function(name)
minetest.chatcommands["/fixlight"].func(name, "")
end,
})
worldedit.register_gui_function("worldedit_gui_hide", {
- name = "Hide Region", privs = minetest.chatcommands["/hide"].privs,
+ name = "Hide Region",
+ privs = we_privs("hide"),
on_select = function(name)
minetest.chatcommands["/hide"].func(name, "")
end,
})
worldedit.register_gui_function("worldedit_gui_suppress", {
- name = "Suppress Nodes", privs = minetest.chatcommands["/suppress"].privs,
+ name = "Suppress Nodes",
+ privs = we_privs("suppress"),
get_formspec = function(name)
local node = gui_nodename1[name]
local nodename = worldedit.normalize_nodename(node)
@@ -636,7 +668,8 @@ worldedit.register_gui_handler("worldedit_gui_suppress", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_highlight", {
- name = "Highlight Nodes", privs = minetest.chatcommands["/highlight"].privs,
+ name = "Highlight Nodes",
+ privs = we_privs("highlight"),
get_formspec = function(name)
local node = gui_nodename1[name]
local nodename = worldedit.normalize_nodename(node)
@@ -664,14 +697,16 @@ worldedit.register_gui_handler("worldedit_gui_highlight", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_restore", {
- name = "Restore Region", privs = minetest.chatcommands["/restore"].privs,
+ name = "Restore Region",
+ privs = we_privs("restore"),
on_select = function(name)
minetest.chatcommands["/restore"].func(name, "")
end,
})
worldedit.register_gui_function("worldedit_gui_save_load", {
- name = "Save/Load", privs = combine_privs(minetest.chatcommands["/save"].privs, minetest.chatcommands["/allocate"].privs, minetest.chatcommands["/load"].privs),
+ name = "Save/Load",
+ privs = combine_we_privs({"save", "allocate", "load"}),
get_formspec = function(name)
local filename = gui_filename[name]
return "size[6,4]" .. worldedit.get_formspec_header("worldedit_gui_save_load") ..
@@ -700,6 +735,7 @@ end) worldedit.register_gui_function("worldedit_gui_lua", {
name = "Run Lua",
+ privs = we_privs("lua"),
get_formspec = function(name)
local code = gui_code[name]
return "size[8,6.5]" .. worldedit.get_formspec_header("worldedit_gui_lua") ..
@@ -724,28 +760,9 @@ worldedit.register_gui_handler("worldedit_gui_lua", function(name, fields) end)
worldedit.register_gui_function("worldedit_gui_clearobjects", {
- name = "Clear Objects", privs = minetest.chatcommands["/clearobjects"].privs,
+ name = "Clear Objects",
+ privs = we_privs("clearobjects"),
on_select = function(name)
minetest.chatcommands["/clearobjects"].func(name, "")
end,
})
-
-worldedit.register_gui_function("worldedit_gui_formspec_tester", {
- name = "Formspec Tester",
- get_formspec = function(name)
- local value = gui_formspec[name]
- return "size[8,6.5]" .. worldedit.get_formspec_header("worldedit_gui_formspec_tester") ..
- string.format("textarea[0.5,1;7.5,5.5;worldedit_gui_formspec_tester_value;Formspec Code;%s]", minetest.formspec_escape(value)) ..
- "button_exit[0,6;3,0.8;worldedit_gui_formspec_tester_show;Show Formspec]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_formspec_tester", function(name, fields)
- if fields.worldedit_gui_formspec_tester_show then
- gui_formspec[name] = fields.worldedit_gui_formspec_tester_value or ""
- worldedit.show_page(name, "worldedit_gui_formspec_tester")
- minetest.show_formspec(name, "worldedit:formspec_tester", gui_formspec[name])
- return true
- end
- return false
-end)
diff --git a/worldedit_gui/init.lua b/worldedit_gui/init.lua index 0a770c6..dafd7c2 100644 --- a/worldedit_gui/init.lua +++ b/worldedit_gui/init.lua @@ -14,7 +14,7 @@ Use `nil` for the `options` parameter to unregister the function associated with Use `nil` for the `get_formspec` field to denote that the function does not have its own screen. -Use `nil` for the `privs` field to denote that no special privileges are required to use the function. +The `privs` field may not be `nil`. If the identifier is already registered to another function, it will be replaced by the new one. @@ -24,6 +24,9 @@ The `on_select` function must not call `worldedit.show_page` worldedit.pages = {} --mapping of identifiers to options local identifiers = {} --ordered list of identifiers worldedit.register_gui_function = function(identifier, options) + if options.privs == nil or next(options.privs) == nil then + error("privs unset") + end worldedit.pages[identifier] = options table.insert(identifiers, identifier) end @@ -46,7 +49,7 @@ worldedit.register_gui_handler = function(identifier, handler) --ensure the player has permission to perform the action local entry = worldedit.pages[identifier] - if entry and minetest.check_player_privs(name, entry.privs or {}) then + if entry and minetest.check_player_privs(name, entry.privs) then return handler(name, fields) end return false @@ -240,6 +243,7 @@ end worldedit.register_gui_function("worldedit_gui", { name = "WorldEdit GUI", + privs = {interact=true}, get_formspec = function(name) --create a form with all the buttons arranged in a grid local buttons, x, y, index = {}, 0, 1, 0 @@ -272,7 +276,7 @@ worldedit.register_gui_handler("worldedit_gui", function(name, fields) for identifier, entry in pairs(worldedit.pages) do --check for WorldEdit GUI main formspec button selection if fields[identifier] and identifier ~= "worldedit_gui" then --ensure player has permission to perform action - local has_privs, missing_privs = minetest.check_player_privs(name, entry.privs or {}) + local has_privs, missing_privs = minetest.check_player_privs(name, entry.privs) if not has_privs then worldedit.player_notify(name, "you are not allowed to use this function (missing privileges: " .. table.concat(missing_privs, ", ") .. ")") return false diff --git a/wrench/init.lua b/wrench/init.lua index 76605c4..f99fd14 100644 --- a/wrench/init.lua +++ b/wrench/init.lua @@ -39,9 +39,10 @@ local function restore(pos, placer, itemstack) local node = minetest.get_node(pos) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - local data = minetest.deserialize(itemstack:get_metadata()) + local data = itemstack:get_meta():get_string("data") + data = (data ~= "" and data) or itemstack:get_metadata() + data = minetest.deserialize(data) minetest.set_node(pos, {name = data.name, param2 = node.param2}) - local lists = data.lists for name, value in pairs(data.metas) do local meta_type = get_meta_type(data.name, name) if meta_type == wrench.META_TYPE_INT then @@ -52,6 +53,7 @@ local function restore(pos, placer, itemstack) meta:set_string(name, value) end end + local lists = data.lists for listname, list in pairs(lists) do inv:set_list(listname, list) end @@ -96,8 +98,9 @@ minetest.register_tool("wrench:wrench", { if not placer or not pos then return end - if minetest.is_protected(pos, placer:get_player_name()) then - minetest.record_protection_violation(pos, placer:get_player_name()) + local player_name = placer:get_player_name() + if minetest.is_protected(pos, player_name) then + minetest.record_protection_violation(pos, player_name) return end local name = minetest.get_node(pos).name @@ -114,9 +117,9 @@ minetest.register_tool("wrench:wrench", { local meta = minetest.get_meta(pos) if def.owned then local owner = meta:get_string("owner") - if owner and owner ~= placer:get_player_name() then - minetest.log("action", placer:get_player_name().. - " tried to pick up a owned node belonging to ".. + if owner and owner ~= player_name then + minetest.log("action", player_name.. + " tried to pick up an owned node belonging to ".. owner.." at ".. minetest.pos_to_string(pos)) return @@ -130,9 +133,6 @@ minetest.register_tool("wrench:wrench", { local inv = meta:get_inventory() local lists = {} for _, listname in pairs(def.lists or {}) do - if not inv:is_empty(listname) then - empty = false - end local list = inv:get_list(listname) for i, stack in pairs(list) do list[i] = stack:to_string() @@ -140,20 +140,20 @@ minetest.register_tool("wrench:wrench", { lists[listname] = list end metadata.lists = lists - - local metas = {} + + local item_meta = stack:get_meta() + metadata.metas = {} for name, meta_type in pairs(def.metas or {}) do if meta_type == wrench.META_TYPE_INT then - metas[name] = meta:get_int(name) + metadata.metas[name] = meta:get_int(name) elseif meta_type == wrench.META_TYPE_FLOAT then - metas[name] = meta:get_float(name) + metadata.metas[name] = meta:get_float(name) elseif meta_type == wrench.META_TYPE_STRING then - metas[name] = meta:get_string(name) + metadata.metas[name] = meta:get_string(name) end end - metadata.metas = metas - - stack:set_metadata(minetest.serialize(metadata)) + + item_meta:set_string("data", minetest.serialize(metadata)) minetest.remove_node(pos) itemstack:add_wear(65535 / 20) player_inv:add_item("main", stack) diff --git a/wrench/locale/es.txt b/wrench/locale/es.txt new file mode 100644 index 0000000..1d79a96 --- /dev/null +++ b/wrench/locale/es.txt @@ -0,0 +1,5 @@ +# technic_wrench traducido por Carlos Barraza + +Wrench = Llave Inglesa +%s with items = %s con elementos + diff --git a/xban2/README.md b/xban2/README.md new file mode 100644 index 0000000..90eed0d --- /dev/null +++ b/xban2/README.md @@ -0,0 +1,106 @@ + +# Extended Ban Mod for Minetest + +This mod attempts to be an improvement to Minetest's ban system. + +* It supports normal bans and temporary bans (from 60 seconds up to the end of + time, with 1 second granularity). +* Records and joins all accounts using the same IP address and several IP + addresses using the same name into a single record, and can ban/unban them as + a single user. +* Can ban offline players if you know their IP or username. +* Holds a record of bans for each user, so moderators and administrators can + consult it to know if a player is a repeat offender. +* Does not modify the default ban database in any way (`ipban.txt'). +* Has an API to ban and check the ban database to allows other mods to manage + users (for example, anticheat mods). + +## Chat commands + +The mod provides the following chat commands. All commands require the `ban` +privilege. + +### `xban` + +Bans a player permanently. + +**Usage:** `/xban <player_or_ip> <reason>` + +**Example:** `/xban 127.0.0.1 Some reason.` + +### `xtempban` + +Bans a player temporarily. + +**Usage:** `/xtempban <player_or_ip> <time> <reason>` + +The `time` parameter is a string in the format `<count><unit>` where `<unit>` +is one of `s` for seconds, `m` for minutes, `h` for hours, `D` for days, `W` +for weeks, `M` for months, or `Y` for years. If the unit is omitted, it is +assumed to mean seconds. For example, `42s` means 42 seconds, `1337m` 1337 +minutes, and so on. You can chain more than one such group and they will add +up. For example, `1Y3M3D7h` will ban for 1 year, 3 months, 3 days and 7 hours. + +**Example:** `/xtempban Joe 3600 Some reason.` + +### `xunban` + +Unbans a player. + +**Usage:** `/xunban <player_or_ip>` + +**Example:** `/xunban Joe` + +### `xban_record` + +Shows the ban record on chat. + +**Usage:** `/xban_record <player_or_ip>` + +This prints one ban entry per line, with the time the ban came into effect, +the expiration time (if applicable), the reason, and the source of the ban. +The record is printed to chat with one entry per line. + +**Example:** `/xban_record Joe` + +### `xban_wl` + +Manages the whitelist. + +**Usage:** `/xban_wl (add|del|get) <player_or_ip>` + +Whitelisted players are allowed on the server even if it's otherwise marked +as banned. This is useful to only allow certain users from shared computers, +for example. + +The `add` subcommand adds the player to the whitelist. The `del` subcommand +removes the player from the whitelist. The `get` subcommand checks if the +player is in the whitelist, and prints the status to chat. + +**Example:** `/xban_record add Jane` + +### `xban_gui` + +Shows a form to consult the database interactively. + +**Usage:** `/xban_gui` + +## Administrator commands + +The following commands require the `server` privilege, so they are only +available to server administrators. + +### `xban_dbi` + +Imports ban entries from other database formats. + +**Usage:** `/xban_dbi <importer>` + +The `importer` argument specifies from which database to import. These are +the supported import plugins at the time of writing: + +* `minetest`: Import entries from Minetest's ban list (`ipban.txt`). +* `v1`: Old format used by xban (`players.iplist`). +* `v2`: Old format used by xban (`players.iplist.v2`). + +**Example:** `/xban_dbi minetest` |