1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-22 16:10:18 +01:00

Allow water to be picked up from well

This commit is contained in:
kilbith 2015-05-13 23:59:10 +02:00
parent e0fe854c5d
commit 246a38832a
2 changed files with 23 additions and 0 deletions

View File

@ -6,3 +6,5 @@ technic?
dye?
bees?
intllib?
bucket?
beds?

View File

@ -320,5 +320,26 @@ homedecor.register("well", {
sounds = default.node_sound_stone_defaults(),
})
if minetest.get_modpath("bucket") then
minetest.override_item("bucket:bucket_empty", {
on_use = function(itemstack, user, pointed_thing)
local wielditem = user:get_wielded_item()
local wieldname = itemstack:get_name()
local inv = user:get_inventory()
if pointed_thing.type == "node" and minetest.get_node(pointed_thing.under).name == "homedecor:well" then
if inv:room_for_item("main", "bucket:bucket_water 1") then
wielditem:take_item()
user:set_wielded_item(wielditem)
inv:add_item("main", "bucket:bucket_water 1")
else
minetest.chat_send_player(user:get_player_name(), "No room in your inventory to add a filled bucket!")
end
end
return wielditem
end
})
end
minetest.register_alias("homedecor:well_top", "air")
minetest.register_alias("homedecor:well_base", "homedecor:well")