From bb73e5f1cd4e381d3062540bbf58c639b8398182 Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 25 Nov 2022 04:18:58 +0100 Subject: [PATCH] Make it possible to pick up fish with river water bucket --- mods/ENTITIES/mobs_mc/axolotl.lua | 3 ++- mods/ENTITIES/mobs_mc/cod.lua | 3 ++- mods/ENTITIES/mobs_mc/salmon.lua | 3 ++- mods/ENTITIES/mobs_mc/tropical_fish.lua | 3 ++- mods/ITEMS/mcl_buckets/fishbuckets.lua | 6 +++++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/axolotl.lua b/mods/ENTITIES/mobs_mc/axolotl.lua index f3bf9802d..ead5ae453 100644 --- a/mods/ENTITIES/mobs_mc/axolotl.lua +++ b/mods/ENTITIES/mobs_mc/axolotl.lua @@ -53,7 +53,8 @@ local axolotl = { fear_height = 4, on_rightclick = function(self, clicker) - if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then + local bn = clicker:get_wielded_item():get_name() + if bn == "mcl_buckets:bucket_water" or bn == "mcl_buckets:bucket_river_water" then if clicker:set_wielded_item("mcl_buckets:bucket_axolotl") then local it = clicker:get_wielded_item() local m = it:get_meta() diff --git a/mods/ENTITIES/mobs_mc/cod.lua b/mods/ENTITIES/mobs_mc/cod.lua index d22334bf8..e3529b3ee 100644 --- a/mods/ENTITIES/mobs_mc/cod.lua +++ b/mods/ENTITIES/mobs_mc/cod.lua @@ -102,7 +102,8 @@ local cod = { end end, on_rightclick = function(self, clicker) - if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then + local bn = clicker:get_wielded_item():get_name() + if bn == "mcl_buckets:bucket_water" or bn == "mcl_buckets:bucket_river_water" then self.object:remove() clicker:set_wielded_item("mcl_buckets:bucket_cod") awards.unlock(clicker:get_player_name(), "mcl:tacticalFishing") diff --git a/mods/ENTITIES/mobs_mc/salmon.lua b/mods/ENTITIES/mobs_mc/salmon.lua index 954d9d390..d187e72ae 100644 --- a/mods/ENTITIES/mobs_mc/salmon.lua +++ b/mods/ENTITIES/mobs_mc/salmon.lua @@ -58,7 +58,8 @@ local salmon = { runaway = true, fear_height = 4, on_rightclick = function(self, clicker) - if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then + local bn = clicker:get_wielded_item():get_name() + if bn == "mcl_buckets:bucket_water" or bn == "mcl_buckets:bucket_river_water" then self.object:remove() clicker:set_wielded_item("mcl_buckets:bucket_salmon") awards.unlock(clicker:get_player_name(), "mcl:tacticalFishing") diff --git a/mods/ENTITIES/mobs_mc/tropical_fish.lua b/mods/ENTITIES/mobs_mc/tropical_fish.lua index f35aff4cf..113f2d401 100644 --- a/mods/ENTITIES/mobs_mc/tropical_fish.lua +++ b/mods/ENTITIES/mobs_mc/tropical_fish.lua @@ -103,7 +103,8 @@ local tropical_fish = { runaway = true, fear_height = 4, on_rightclick = function(self, clicker) - if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then + local bn = clicker:get_wielded_item():get_name() + if bn == "mcl_buckets:bucket_water" or bn == "mcl_buckets:bucket_river_water" then if clicker:set_wielded_item("mcl_buckets:bucket_tropical_fish") then local it = clicker:get_wielded_item() local m = it:get_meta() diff --git a/mods/ITEMS/mcl_buckets/fishbuckets.lua b/mods/ITEMS/mcl_buckets/fishbuckets.lua index 51bdc99b7..b1de5e13e 100644 --- a/mods/ITEMS/mcl_buckets/fishbuckets.lua +++ b/mods/ITEMS/mcl_buckets/fishbuckets.lua @@ -23,7 +23,11 @@ local function on_place_fish(itemstack, placer, pointed_thing) if props ~= "" then o:set_properties(minetest.deserialize(props)) end - minetest.set_node(pos,{name = "mcl_core:water_source"}) + local water = "mcl_core:water_source" + if n.name == "mclx_core:river_water_source" then + water = n.name + end + minetest.set_node(pos,{name = water}) if not minetest.is_creative_enabled(placer:get_player_name()) then itemstack:set_name("mcl_buckets:bucket_empty") end