From 88ce1e36629a51e3d8bd04a52fdb0e22b55c45d9 Mon Sep 17 00:00:00 2001 From: kabou Date: Sun, 20 Feb 2022 18:15:56 +0100 Subject: [PATCH] Remove redundant logic. The function on_place_bucket contains the following logic: if not a and not b then return x end if a then foo(a) elseif b then foo(b) else return x end The "if not a and not b then .." is removed because the case is handled by the else case later on. This will allow some further simplifications. --- mods/ITEMS/mcl_buckets/init.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index 3bbae54878..ba2ece4f83 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -170,8 +170,6 @@ local function on_place_bucket(itemstack, user, pointed_thing, def) local buildable1 = regnode1 and (regnode1.buildable_to or get_item_group(name1, "cauldron") == 1) local buildable2 = regnode2 and (regnode2.buildable_to or get_item_group(name2, "cauldron") == 1) - if not buildable1 and not buildable2 then return itemstack end --if both nodes aren't buildable_to, skip - if buildable1 then local result, take_bucket = get_extra_check(def.extra_check, pointed_thing.under, user) if result then