add mineclone support

This commit is contained in:
tenplus1 2024-08-15 10:45:15 +01:00
parent 73491efaca
commit 528cd204b3
6 changed files with 56 additions and 71 deletions

View File

@ -1,18 +1,14 @@
if minetest.get_modpath("mobs") and not mobs.mod and mobs.mod ~= "redo" then
minetest.log("error", "[mobs_bat] mobs redo API not found!")
return
end
-- local variables
local l_spawnnear = {"default:stone"}
local l_spawnchance = 30000
local l_spawnnear = {"default:stone"}
local l_spawnchance = 30000
local l_skins = {
{"animal_bat.png"},
{"animal_bat.png^[colorize:black:150"}
}
-- spawn definition
mobs:register_mob("mobs_bat:bat", {
type = "animal",
@ -44,18 +40,12 @@ mobs:register_mob("mobs_bat:bat", {
light_damage = 0,
view_range = 10,
animation = {
speed_normal = 24,
speed_run = 24,
stand_start = 30,
stand_end = 59,
fly_start = 30,
fly_end = 59,
walk_start = 30,
walk_end = 59,
run_start = 30,
run_end = 59,
punch_start = 60,
punch_end = 89
speed_normal = 24, speed_run = 24,
stand_start = 30, stand_end = 59,
fly_start = 30, fly_end = 59,
walk_start = 30, walk_end = 59,
run_start = 30, run_end = 59,
punch_start = 60, punch_end = 89
},
on_rightclick = function(self, clicker)
@ -63,6 +53,7 @@ mobs:register_mob("mobs_bat:bat", {
end
})
-- spawn in world
mobs:spawn({
name = "mobs_bat:bat",
@ -76,6 +67,7 @@ mobs:spawn({
max_height = 150
})
-- mob egg
mobs:register_egg("mobs_bat:bat", "Bat", "animal_bat_inv.png", 0)

View File

@ -1,4 +1,4 @@
name = mobs_bat
depends = default, mobs
optional_depends =
description = Adds bats into your world.
depends = mobs
min_minetest_version = 5.0

View File

@ -1,9 +1,11 @@
-- local variables
local l_spawn_chance_gull = 24000
local l_spawn_chance_bird = 36000
-- load settings
dofile(minetest.get_modpath("mobs_birds") .. "/SETTINGS.txt")
if not ENABLE_LARGE_BIRDS then
@ -14,8 +16,12 @@ if not ENABLE_SMALL_BIRDS then
l_spawn_chance_bird = l_spawn_chance_bird - 18000
end
-- Mineclone check
local mod_mcl = minetest.get_modpath("mcl_core")
-- gulls
if ENABLE_GULLS then
mobs:register_mob("mobs_birds:gull", {
@ -45,16 +51,11 @@ if ENABLE_GULLS then
light_damage = 0,
view_range = 14,
animation = {
speed_normal = 24,
speed_run = 24,
stand_start = 1,
stand_end = 95,
walk_start = 1,
walk_end = 95,
fly_start = 1,
fly_end = 95,
run_start = 1,
run_end = 95
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 95,
walk_start = 1, walk_end = 95,
fly_start = 1, fly_end = 95,
run_start = 1, run_end = 95
},
on_rightclick = function(self, clicker)
@ -65,7 +66,7 @@ if ENABLE_GULLS then
mobs:spawn({
name = "mobs_birds:gull",
nodes = {"air"},
neighbors = {"default:water_source", "default:water_flowing"},
neighbors = {"group:water"},
max_light = 5,
interval = 30,
chance = l_spawn_chance_gull,
@ -76,8 +77,8 @@ if ENABLE_GULLS then
mobs:register_egg("mobs_birds:gull", "Gull", "default_cloud.png", 1)
end
-- large birds
if ENABLE_LARGE_BIRDS then
mobs:register_mob("mobs_birds:bird_lg", {
@ -110,14 +111,10 @@ if ENABLE_LARGE_BIRDS then
light_damage = 0,
view_range = 12,
animation = {
speed_normal = 24,
speed_run = 24,
stand_start = 1,
stand_end = 95,
walk_start = 1,
walk_end = 95,
run_start = 1,
run_end = 95
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 95,
walk_start = 1, walk_end = 95,
run_start = 1, run_end = 95
},
on_rightclick = function(self, clicker)
@ -129,8 +126,7 @@ if ENABLE_LARGE_BIRDS then
name = "mobs_birds:bird_lg",
nodes = {"air"},
neighbors = {
"default:leaves", "default:pine_needles",
"default:jungleleaves", "default:cactus"
"group:leaves" , (mod_mcl and "mcl_core:cactus" or "default:cactus")
},
max_light = 5,
interval = 30,
@ -142,8 +138,8 @@ if ENABLE_LARGE_BIRDS then
mobs:register_egg("mobs_birds:bird_lg", "Large bird", "default_cloud.png", 1)
end
-- small birds
if ENABLE_SMALL_BIRDS then
mobs:register_mob("mobs_birds:bird_sm", {
@ -176,14 +172,10 @@ if ENABLE_SMALL_BIRDS then
light_damage = 0,
view_range = 10,
animation = {
speed_normal = 24,
speed_run = 24,
stand_start = 1,
stand_end = 95,
walk_start = 1,
walk_end = 95,
run_start = 1,
run_end = 95
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 95,
walk_start = 1, walk_end = 95,
run_start = 1, run_end = 95
},
on_rightclick = function(self, clicker)
@ -195,8 +187,7 @@ if ENABLE_SMALL_BIRDS then
name = "mobs_birds:bird_sm",
nodes = {"air"},
neighbors = {
"default:leaves", "default:pine_needles",
"default:jungleleaves", "default:cactus"
"group:leaves" , (mod_mcl and "mcl_core:cactus" or "default:cactus")
},
max_light = 5,
interval = 30,
@ -208,5 +199,4 @@ if ENABLE_SMALL_BIRDS then
mobs:register_egg("mobs_birds:bird_sm", "Small bird", "default_cloud.png", 1)
end
print("[MOD] Mobs Redo Birds loaded")

View File

@ -1,4 +1,4 @@
name = mobs_birds
depends = default, mobs
optional_depends =
description = Adds birds into your world.
depends = mobs
min_minetest_version = 5.0

View File

@ -1,3 +1,6 @@
-- mod check and settings
local butterfly_mod = minetest.get_modpath("butterflies")
local l_skins = {
@ -35,7 +38,8 @@ local l_skins = {
local l_spawnnear = {"group:flower"}
local l_spawnchance = 20000
-- Butterfly
-- Butterfly definition
mobs:register_mob("mobs_butterfly:butterfly", {
type = "animal",
passive = true,
@ -56,14 +60,10 @@ mobs:register_mob("mobs_butterfly:butterfly", {
fall_damage = 0,
view_range = 10,
animation = {
speed_normal = 15,
speed_run = 30,
stand_start = 0,
stand_end = 90,
walk_start = 0,
walk_end = 90,
fly_start = 0,
fly_end = 90
speed_normal = 15, speed_run = 30,
stand_start = 0, stand_end = 90,
walk_start = 0, walk_end = 90,
fly_start = 0, fly_end = 90
},
after_activate = function(self, staticdata, def, dtime)
@ -72,7 +72,7 @@ mobs:register_mob("mobs_butterfly:butterfly", {
local pos = self.object:get_pos()
local butter = {"white", "red", "violet"}
local replace = "butterflies:butterfly_" .. butter[math.random(1, #butter)]
local replace = "butterflies:butterfly_" .. butter[math.random(#butter)]
minetest.set_node(pos, {name = replace})
@ -90,11 +90,14 @@ mobs:register_mob("mobs_butterfly:butterfly", {
if not butterfly_mod then
-- spawn in world
mobs:spawn_specific("mobs_butterfly:butterfly", {"air"},
l_spawnnear, 5, 20, 30, l_spawnchance, 1, 0, 31000)
-- spawn egg
mobs:register_egg("mobs_butterfly:butterfly", "Butterfly", "default_cloud.png", 1)
end
print("[MOD] Mobs Redo Butterfly loaded")

View File

@ -1,4 +1,4 @@
name = mobs_butterfly
depends = default, mobs
optional_depends =
description = Adds butterflies into your world.
depends = mobs
min_minetest_version = 5.0