1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2025-06-29 23:01:00 +02:00

Code tidy and tweak

This commit is contained in:
TenPlus1
2015-07-05 10:54:18 +01:00
parent 6e4fa56475
commit 16cc62a1d4
23 changed files with 622 additions and 352 deletions

View File

@ -55,7 +55,7 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
return
end
local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
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
@ -75,9 +75,9 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
end
-- turn the node into soil, wear out item and play sound
minetest.set_node(pt.under, {name="farming:soil"})
minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5,})
itemstack:add_wear(65535/(uses-1))
minetest.set_node(pt.under, {name = "farming:soil"})
minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5})
itemstack:add_wear(65535/(uses - 1))
return itemstack
end
@ -147,4 +147,4 @@ farming.register_hoe(":farming:hoe_diamond", {
{"", "group:stick"},
{"", "group:stick"},
}
})
})