1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 00:20:17 +01:00

Fixed bucket overwrite inhibiting its role

- Buckets couldn't be used to take default:water_source nor default:lava_source
   because the overwrite made in homdecor/exterior.lua replaced that way of
   working. This patch makes both well and sources work.
This commit is contained in:
LeMagnesium 2015-05-16 13:47:46 +02:00
parent 3b2dc854c9
commit 17e066b9b1

View File

@ -328,6 +328,7 @@ homedecor.register("well", {
}) })
if minetest.get_modpath("bucket") then if minetest.get_modpath("bucket") then
local original_bucket_on_use = minetest.registered_items["bucket:bucket_empty"].on_use
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 wielditem = user:get_wielded_item() local wielditem = user:get_wielded_item()
@ -342,8 +343,10 @@ if minetest.get_modpath("bucket") then
else else
minetest.chat_send_player(user:get_player_name(), "No room in your inventory to add a filled bucket!") minetest.chat_send_player(user:get_player_name(), "No room in your inventory to add a filled bucket!")
end end
end
return wielditem return wielditem
else
return original_bucket_on_use(itemstack, user, pointed_thing)
end
end end
}) })
end end