Make it possible to pick up fish with river water bucket

This commit is contained in:
cora 2022-11-25 04:18:58 +01:00
parent d4c2501d62
commit bb73e5f1cd
5 changed files with 13 additions and 5 deletions

View file

@ -53,7 +53,8 @@ local axolotl = {
fear_height = 4, fear_height = 4,
on_rightclick = function(self, clicker) 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 if clicker:set_wielded_item("mcl_buckets:bucket_axolotl") then
local it = clicker:get_wielded_item() local it = clicker:get_wielded_item()
local m = it:get_meta() local m = it:get_meta()

View file

@ -102,7 +102,8 @@ local cod = {
end end
end, end,
on_rightclick = function(self, clicker) 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() self.object:remove()
clicker:set_wielded_item("mcl_buckets:bucket_cod") clicker:set_wielded_item("mcl_buckets:bucket_cod")
awards.unlock(clicker:get_player_name(), "mcl:tacticalFishing") awards.unlock(clicker:get_player_name(), "mcl:tacticalFishing")

View file

@ -58,7 +58,8 @@ local salmon = {
runaway = true, runaway = true,
fear_height = 4, fear_height = 4,
on_rightclick = function(self, clicker) 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() self.object:remove()
clicker:set_wielded_item("mcl_buckets:bucket_salmon") clicker:set_wielded_item("mcl_buckets:bucket_salmon")
awards.unlock(clicker:get_player_name(), "mcl:tacticalFishing") awards.unlock(clicker:get_player_name(), "mcl:tacticalFishing")

View file

@ -103,7 +103,8 @@ local tropical_fish = {
runaway = true, runaway = true,
fear_height = 4, fear_height = 4,
on_rightclick = function(self, clicker) 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 if clicker:set_wielded_item("mcl_buckets:bucket_tropical_fish") then
local it = clicker:get_wielded_item() local it = clicker:get_wielded_item()
local m = it:get_meta() local m = it:get_meta()

View file

@ -23,7 +23,11 @@ local function on_place_fish(itemstack, placer, pointed_thing)
if props ~= "" then if props ~= "" then
o:set_properties(minetest.deserialize(props)) o:set_properties(minetest.deserialize(props))
end 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 if not minetest.is_creative_enabled(placer:get_player_name()) then
itemstack:set_name("mcl_buckets:bucket_empty") itemstack:set_name("mcl_buckets:bucket_empty")
end end