summaryrefslogtreecommitdiff
path: root/farming/hoes.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-10-27 15:13:31 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-10-27 15:13:31 -0400
commit6281dc744dc3951234931a9f44c3bdd353f79df7 (patch)
tree0ead0d0d18be58bed7480cb9a5ea1495230c568f /farming/hoes.lua
parent2e6082ccdbd121cd5fc0f82a931ac01ac00dcb76 (diff)
downloaddreambuilder_modpack-6281dc744dc3951234931a9f44c3bdd353f79df7.tar
dreambuilder_modpack-6281dc744dc3951234931a9f44c3bdd353f79df7.tar.gz
dreambuilder_modpack-6281dc744dc3951234931a9f44c3bdd353f79df7.tar.bz2
dreambuilder_modpack-6281dc744dc3951234931a9f44c3bdd353f79df7.tar.xz
dreambuilder_modpack-6281dc744dc3951234931a9f44c3bdd353f79df7.zip
updated boost cart, homedecor modpack, castles modpack, currency, farming-redo,
maptools, mesecons, moreblocks, moreores, pipeworks, quartz
Diffstat (limited to 'farming/hoes.lua')
-rw-r--r--farming/hoes.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/farming/hoes.lua b/farming/hoes.lua
index c883e22..aee967c 100644
--- a/farming/hoes.lua
+++ b/farming/hoes.lua
@@ -69,7 +69,7 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
if not pt or pt.type ~= "node" then
return
end
-
+
local under = minetest.get_node(pt.under)
local upos = pointed_thing.under
@@ -80,23 +80,23 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
local p = {x = pt.under.x, y = pt.under.y + 1, z = pt.under.z}
local above = minetest.get_node(p)
-
+
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name]
or not minetest.registered_nodes[above.name] then
return
end
-
+
-- check if the node above the pointed thing is air
if above.name ~= "air" then
return
end
-
+
-- check if pointing at dirt
if minetest.get_item_group(under.name, "soil") ~= 1 then
return
end
-
+
-- turn the node into soil, wear out item and play sound
minetest.set_node(pt.under, {name = "farming:soil"})
@@ -104,7 +104,7 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
local wear = 65535 / (uses -1)
- if minetest.setting_getbool("creative_mode") then
+ if farming.is_creative(user:get_player_name()) then
if tr then
wear = 1
else