auto detect lassos

This commit is contained in:
berengma 2020-05-18 18:48:34 +02:00
parent 4f1364964c
commit 02bfcb5d56
2 changed files with 19 additions and 5 deletions

View File

@ -23,6 +23,7 @@ minetest.register_craft({
cooktime = 5
})
if not water_life.petz and not water_life.mobsredo then
-- lasso
minetest.register_tool("water_life:lasso", {
@ -41,11 +42,9 @@ minetest.register_craft({
}
})
end
end
minetest.register_alias("mobs:magic_lasso", "water_life:lasso")
--minetest.register_alias("petz:lasso", "water_life:lasso")
-- revive corals if a living one is around
@ -175,7 +174,7 @@ if not water_life.apionly then
minetest.register_craftitem("water_life:jellyfish_item", {
description = ("Sea urchin"),
description = ("Jellyfish"),
inventory_image = "water_life_jellyfish_item.png",
wield_scale = {x = 0.4, y = 0.4, z = 0.4},
stack_max = 10,

View File

@ -1,7 +1,8 @@
water_life = {}
water_life.version = "030520"
water_life.version = "180520"
water_life.shark_food = {}
water_life.petz = minetest.get_modpath("petz")
water_life.mobsredo = minetest.get_modpath("mobs")
water_life.abr = tonumber(minetest.settings:get('active_block_range')) or 2
water_life.abo = tonumber(minetest.settings:get('active_object_send_range_blocks')) or 3
water_life.whale_spawn_rate = tonumber(minetest.settings:get("water_life_whale_spawn_rate")) or 100
@ -37,6 +38,20 @@ if not water_life.apionly then
end
--check which lasso to use
if water_life.mobsredo then
water_life.catchBA = "mobe_redo:lasso"
if water_life.petz then minetest.unregister_item("petz:lasso") end
elseif water_life.petz then
water_life.catchBA = "petz:lasso"
else
water_life.catchBA = "water_life:lasso"
end
math.randomseed(os.time()) --init random seed