summaryrefslogtreecommitdiff
path: root/anvil
diff options
context:
space:
mode:
Diffstat (limited to 'anvil')
-rw-r--r--anvil/init.lua16
-rw-r--r--anvil/locale/es.po65
2 files changed, 74 insertions, 7 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."