forked from mtcontrib/bonemeal
fix bonemeal take item on every use
This commit is contained in:
parent
b07c76c407
commit
30bd1d708c
12
init.lua
12
init.lua
@ -569,8 +569,10 @@ minetest.register_craftitem("bonemeal:mulch", {
|
||||
-- use helper function to do checks and return position and node
|
||||
local node = use_checks(user, pointed_thing)
|
||||
|
||||
if node then
|
||||
|
||||
-- call global on_use function with strength of 1
|
||||
if node and bonemeal:on_use(pointed_thing.under, 1, node) then
|
||||
bonemeal:on_use(pointed_thing.under, 1, node)
|
||||
|
||||
-- take item if not in creative
|
||||
if not bonemeal.is_creative(user:get_player_name()) then
|
||||
@ -593,8 +595,10 @@ minetest.register_craftitem("bonemeal:bonemeal", {
|
||||
-- use helper function to do checks and return position and node
|
||||
local node = use_checks(user, pointed_thing)
|
||||
|
||||
if node then
|
||||
|
||||
-- call global on_use function with strength of 2
|
||||
if node and bonemeal:on_use(pointed_thing.under, 2, node) then
|
||||
bonemeal:on_use(pointed_thing.under, 2, node)
|
||||
|
||||
-- take item if not in creative
|
||||
if not bonemeal.is_creative(user:get_player_name()) then
|
||||
@ -617,8 +621,10 @@ minetest.register_craftitem("bonemeal:fertiliser", {
|
||||
-- use helper function to do checks and return position and node
|
||||
local node = use_checks(user, pointed_thing)
|
||||
|
||||
if node then
|
||||
|
||||
-- call global on_use function with strength of 3
|
||||
if node and bonemeal:on_use(pointed_thing.under, 3, node) then
|
||||
bonemeal:on_use(pointed_thing.under, 3, node)
|
||||
|
||||
-- take item if not in creative
|
||||
if not bonemeal.is_creative(user:get_player_name()) then
|
||||
|
Loading…
Reference in New Issue
Block a user