Fix crash when bucket used pointing air
This commit is contained in:
parent
ed0fef5548
commit
007700a6e8
@ -111,14 +111,12 @@ if minetest.get_modpath("bucket") then
|
|||||||
minetest.override_item("bucket:bucket_empty", {
|
minetest.override_item("bucket:bucket_empty", {
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
local inv = user:get_inventory()
|
local inv = user:get_inventory()
|
||||||
local player = user:get_player_name()
|
if pointed_thing.type == "node" and minetest.get_node(pointed_thing.under).name == "xdecor:cauldron" then
|
||||||
|
|
||||||
if minetest.get_node(pointed_thing.under).name == "xdecor:cauldron" then
|
|
||||||
if inv:room_for_item("main", "bucket:bucket_water 1") then
|
if inv:room_for_item("main", "bucket:bucket_water 1") then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
inv:add_item("main", "bucket:bucket_water 1")
|
inv:add_item("main", "bucket:bucket_water 1")
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(player, "No enough room in your inventory.")
|
minetest.chat_send_player(user:get_player_name(), "No room in your inventory to add a filled bucket!")
|
||||||
end
|
end
|
||||||
return itemstack
|
return itemstack
|
||||||
else if original_bucket_on_use then
|
else if original_bucket_on_use then
|
||||||
|
Loading…
Reference in New Issue
Block a user