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:
10
hoes.lua
10
hoes.lua
@ -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"},
|
||||
}
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user