fix bonemeal take item on every use

This commit is contained in:
tenplus1 2022-11-30 15:24:50 +00:00
parent b07c76c407
commit 30bd1d708c
1 changed files with 12 additions and 6 deletions

View File

@ -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)
-- call global on_use function with strength of 1
if node and bonemeal:on_use(pointed_thing.under, 1, node) then
if node then
-- call global on_use function with strength of 1
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)
-- call global on_use function with strength of 2
if node and bonemeal:on_use(pointed_thing.under, 2, node) then
if node then
-- call global on_use function with strength of 2
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)
-- call global on_use function with strength of 3
if node and bonemeal:on_use(pointed_thing.under, 3, node) then
if node then
-- call global on_use function with strength of 3
bonemeal:on_use(pointed_thing.under, 3, node)
-- take item if not in creative
if not bonemeal.is_creative(user:get_player_name()) then