From 17e066b9b19715593e860828377efc4423d01569 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Sat, 16 May 2015 13:47:46 +0200 Subject: [PATCH] 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. --- homedecor/exterior.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/homedecor/exterior.lua b/homedecor/exterior.lua index 6a7656bc..d66edaaf 100644 --- a/homedecor/exterior.lua +++ b/homedecor/exterior.lua @@ -37,7 +37,7 @@ local bl1_sbox = { local bl1_cbox = { type = "fixed", - fixed = { + fixed = { {-0.5, -0.5, -0.25, 1.5, 0, 0.5 }, {-0.5, -0.5, 0.45, 1.5, 0.5, 0.5 }, } @@ -69,7 +69,7 @@ local bl2_sbox = { local bl2_cbox = { type = "fixed", - fixed = { + fixed = { {-0.5, -0.5, -0.25, 1.5, 0, 0.5 }, {-0.5, -0.5, 0.45, 1.5, 0.5, 0.5 }, } @@ -328,12 +328,13 @@ homedecor.register("well", { }) 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", { 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() @@ -342,9 +343,11 @@ if minetest.get_modpath("bucket") then else minetest.chat_send_player(user:get_player_name(), "No room in your inventory to add a filled bucket!") end + return wielditem + else + return original_bucket_on_use(itemstack, user, pointed_thing) end - return wielditem - end + end }) end