Change hoe_on_use to farming.hoe_on_use, for use and override by mods.

This commit is contained in:
Novatux 2013-08-30 10:10:30 +02:00
parent cf6f458906
commit 066d23cdfd

@ -1,6 +1,8 @@
-- Minetest 0.4 mod: farming -- Minetest 0.4 mod: farming
-- See README.txt for licensing and other information. -- See README.txt for licensing and other information.
farming = {}
-- --
-- Soil -- Soil
-- --
@ -62,7 +64,7 @@ minetest.register_abm({
-- Hoes -- Hoes
-- --
-- turns nodes with group soil=1 into soil -- turns nodes with group soil=1 into soil
local function hoe_on_use(itemstack, user, pointed_thing, uses) function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
local pt = pointed_thing local pt = pointed_thing
-- check if pointing at a node -- check if pointing at a node
if not pt then if not pt then
@ -109,7 +111,7 @@ minetest.register_tool("farming:hoe_wood", {
inventory_image = "farming_tool_woodhoe.png", inventory_image = "farming_tool_woodhoe.png",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
return hoe_on_use(itemstack, user, pointed_thing, 30) return farming.hoe_on_use(itemstack, user, pointed_thing, 30)
end, end,
}) })
@ -118,7 +120,7 @@ minetest.register_tool("farming:hoe_stone", {
inventory_image = "farming_tool_stonehoe.png", inventory_image = "farming_tool_stonehoe.png",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
return hoe_on_use(itemstack, user, pointed_thing, 90) return farming.hoe_on_use(itemstack, user, pointed_thing, 90)
end, end,
}) })
@ -127,7 +129,7 @@ minetest.register_tool("farming:hoe_steel", {
inventory_image = "farming_tool_steelhoe.png", inventory_image = "farming_tool_steelhoe.png",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
return hoe_on_use(itemstack, user, pointed_thing, 200) return farming.hoe_on_use(itemstack, user, pointed_thing, 200)
end, end,
}) })
@ -136,7 +138,7 @@ minetest.register_tool("farming:hoe_bronze", {
inventory_image = "farming_tool_bronzehoe.png", inventory_image = "farming_tool_bronzehoe.png",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
return hoe_on_use(itemstack, user, pointed_thing, 220) return farming.hoe_on_use(itemstack, user, pointed_thing, 220)
end, end,
}) })