From 1fcf7afb82157cd8021fb9cd54033bd6aaaeba45 Mon Sep 17 00:00:00 2001 From: GuyLiner Date: Wed, 8 Feb 2023 11:21:35 -0500 Subject: [PATCH] Moved mob attributes into a local table for every mob, added light spawning levels for everyone mob, and added those light level values to spawn_specific() when the function is present --- mods/ENTITIES/mobs_mc/axolotl.lua | 15 ++++-- mods/ENTITIES/mobs_mc/bat.lua | 45 ++++++++++------ mods/ENTITIES/mobs_mc/blaze.lua | 24 ++++++--- mods/ENTITIES/mobs_mc/chicken.lua | 21 +++++--- mods/ENTITIES/mobs_mc/cod.lua | 14 ++++- mods/ENTITIES/mobs_mc/cow+mooshroom.lua | 18 +++++-- mods/ENTITIES/mobs_mc/creeper.lua | 27 +++++++--- mods/ENTITIES/mobs_mc/dolphin.lua | 14 ++++- mods/ENTITIES/mobs_mc/ender_dragon.lua | 15 +++++- mods/ENTITIES/mobs_mc/enderman.lua | 31 +++++++---- mods/ENTITIES/mobs_mc/endermite.lua | 17 ++++-- mods/ENTITIES/mobs_mc/ghast.lua | 20 +++++-- mods/ENTITIES/mobs_mc/glow_squid.lua | 19 +++++-- mods/ENTITIES/mobs_mc/guardian.lua | 16 ++++-- mods/ENTITIES/mobs_mc/guardian_elder.lua | 15 +++++- mods/ENTITIES/mobs_mc/hoglin+zoglin.lua | 14 ++++- mods/ENTITIES/mobs_mc/horse.lua | 18 +++++-- mods/ENTITIES/mobs_mc/iron_golem.lua | 16 ++++-- mods/ENTITIES/mobs_mc/llama.lua | 20 +++++-- mods/ENTITIES/mobs_mc/ocelot.lua | 14 ++++- mods/ENTITIES/mobs_mc/parrot.lua | 21 ++++++-- mods/ENTITIES/mobs_mc/pig.lua | 20 +++++-- mods/ENTITIES/mobs_mc/piglin.lua | 18 +++++-- mods/ENTITIES/mobs_mc/pillager.lua | 10 ++++ mods/ENTITIES/mobs_mc/polar_bear.lua | 22 +++++--- mods/ENTITIES/mobs_mc/rabbit.lua | 14 ++++- mods/ENTITIES/mobs_mc/salmon.lua | 14 ++++- mods/ENTITIES/mobs_mc/sheep.lua | 21 ++++++-- mods/ENTITIES/mobs_mc/shulker.lua | 17 ++++-- mods/ENTITIES/mobs_mc/silverfish.lua | 10 ++++ mods/ENTITIES/mobs_mc/skeleton+stray.lua | 22 +++++--- mods/ENTITIES/mobs_mc/skeleton_wither.lua | 15 +++++- mods/ENTITIES/mobs_mc/slime+magma_cube.lua | 53 +++++++++++++------ mods/ENTITIES/mobs_mc/snowman.lua | 6 ++- mods/ENTITIES/mobs_mc/spider.lua | 14 ++++- mods/ENTITIES/mobs_mc/squid.lua | 20 +++++-- mods/ENTITIES/mobs_mc/strider.lua | 10 ++++ mods/ENTITIES/mobs_mc/tropical_fish.lua | 14 ++++- mods/ENTITIES/mobs_mc/vex.lua | 6 +-- mods/ENTITIES/mobs_mc/villager.lua | 16 +++++- mods/ENTITIES/mobs_mc/villager_evoker.lua | 15 +++++- mods/ENTITIES/mobs_mc/villager_illusioner.lua | 15 +++++- mods/ENTITIES/mobs_mc/villager_vindicator.lua | 17 ++++-- mods/ENTITIES/mobs_mc/villager_zombie.lua | 19 +++++-- mods/ENTITIES/mobs_mc/witch.lua | 10 ++++ mods/ENTITIES/mobs_mc/wither.lua | 10 ++++ mods/ENTITIES/mobs_mc/wolf.lua | 14 ++++- mods/ENTITIES/mobs_mc/zombie.lua | 26 ++++++--- mods/ENTITIES/mobs_mc/zombiepig.lua | 10 ++++ 49 files changed, 686 insertions(+), 186 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/axolotl.lua b/mods/ENTITIES/mobs_mc/axolotl.lua index 124f6bd3a1..6a2bd4f502 100644 --- a/mods/ENTITIES/mobs_mc/axolotl.lua +++ b/mods/ENTITIES/mobs_mc/axolotl.lua @@ -9,7 +9,16 @@ local axolotl = { hp_max = 14, xp_min = 1, xp_max = 7, - + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, head_swivel = "head.control", bone_eye_height = -1, head_eye_height = -0.5, @@ -169,8 +178,8 @@ mcl_mobs:spawn_specific( "JungleEdgeM_underground", "LushCaves", }, -0, -minetest.LIGHT_MAX+1, +axolotl.light_min.overworld, +axolotl.light_max.overworld, 30, 4000, 3, diff --git a/mods/ENTITIES/mobs_mc/bat.lua b/mods/ENTITIES/mobs_mc/bat.lua index b5532e2eed..f0b15f9cc9 100644 --- a/mods/ENTITIES/mobs_mc/bat.lua +++ b/mods/ENTITIES/mobs_mc/bat.lua @@ -2,7 +2,19 @@ local S = minetest.get_translator("mobs_mc") -mcl_mobs.register_mob("mobs_mc:bat", { +-- Spawning + +--[[ If the game has been launched between the 20th of October and the 3rd of November system time, +-- the maximum spawn light level is increased. ]] +local date = os.date("*t") +local maxlight +if (date.month == 10 and date.day >= 20) or (date.month == 11 and date.day <= 3) then + maxlight = 6 +else + maxlight = 3 +end + +local bat = { description = S("Bat"), type = "animal", spawn_class = "ambient", @@ -11,6 +23,17 @@ mcl_mobs.register_mob("mobs_mc:bat", { passive = true, hp_min = 6, hp_max = 6, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = maxlight, + nether = maxlight, + the_end = maxlight + }, + collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25}, visual = "mesh", mesh = "mobs_mc_bat.b3d", @@ -50,20 +73,8 @@ mcl_mobs.register_mob("mobs_mc:bat", { jump = false, fly = true, makes_footstep_sound = false, -}) - - --- Spawning - ---[[ If the game has been launched between the 20th of October and the 3rd of November system time, --- the maximum spawn light level is increased. ]] -local date = os.date("*t") -local maxlight -if (date.month == 10 and date.day >= 20) or (date.month == 11 and date.day <= 3) then - maxlight = 6 -else - maxlight = 3 -end +} +mcl_mobs.register_mob("mobs_mc:bat", bat) -- Spawn on solid blocks at or below Sea level and the selected light level mcl_mobs:spawn_specific( @@ -134,8 +145,8 @@ mcl_mobs:spawn_specific( "JungleEdge", "SavannaM", }, -0, -maxlight, +bat.light_min.overworld, +bat.light_max.overworld, 20, 5000, 2, diff --git a/mods/ENTITIES/mobs_mc/blaze.lua b/mods/ENTITIES/mobs_mc/blaze.lua index 18b7ea676f..cdcff0d5c4 100644 --- a/mods/ENTITIES/mobs_mc/blaze.lua +++ b/mods/ENTITIES/mobs_mc/blaze.lua @@ -11,8 +11,7 @@ local mod_target = minetest.get_modpath("mcl_target") --################### BLAZE --################### - -mcl_mobs.register_mob("mobs_mc:blaze", { +local blaze = { description = S("Blaze"), type = "monster", spawn_class = "hostile", @@ -22,6 +21,16 @@ mcl_mobs.register_mob("mobs_mc:blaze", { hp_max = 20, xp_min = 10, xp_max = 10, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.79, 0.3}, rotate = -180, visual = "mesh", @@ -58,8 +67,8 @@ mcl_mobs.register_mob("mobs_mc:blaze", { animation = { stand_speed = 25, stand_start = 0, - stand_end = 100, - walk_speed = 25, + stand_end = 100, + walk_speed = 25, walk_start = 0, walk_end = 100, run_speed = 50, @@ -137,15 +146,16 @@ mcl_mobs.register_mob("mobs_mc:blaze", { }, }) end, -}) +} +mcl_mobs.register_mob("mobs_mc:blaze", blaze) mcl_mobs:spawn_specific( "mobs_mc:blaze", "nether", "ground", {"Nether"}, -0, -minetest.LIGHT_MAX+1, +blaze.light_min.nether, +blaze.light_max.nether, 30, 5000, 3, diff --git a/mods/ENTITIES/mobs_mc/chicken.lua b/mods/ENTITIES/mobs_mc/chicken.lua index ca942d355b..b452b9986d 100644 --- a/mods/ENTITIES/mobs_mc/chicken.lua +++ b/mods/ENTITIES/mobs_mc/chicken.lua @@ -6,9 +6,7 @@ local S = minetest.get_translator("mobs_mc") --################### CHICKEN --################### - - -mcl_mobs.register_mob("mobs_mc:chicken", { +local chicken = { description = S("Chicken"), type = "animal", spawn_class = "passive", @@ -18,6 +16,16 @@ mcl_mobs.register_mob("mobs_mc:chicken", { hp_max = 4, xp_min = 1, xp_max = 3, + light_min = { + overworld = 9, + nether = 9, + the_end = 9 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.69, 0.2}, floats = 1, head_swivel = "head.control", @@ -111,8 +119,9 @@ mcl_mobs.register_mob("mobs_mc:chicken", { max_hear_distance = 16, }, true) end, +} -}) +mcl_mobs.register_mob("mobs_mc:chicken", chicken) --spawn mcl_mobs:spawn_specific( @@ -155,8 +164,8 @@ mcl_mobs:spawn_specific( "Swampland", "Swampland_shore" }, -9, -minetest.LIGHT_MAX+1, +chicken.light_min.overworld, +chicken.light_max.overworld, 30, 17000, 3, mobs_mc.water_level, diff --git a/mods/ENTITIES/mobs_mc/cod.lua b/mods/ENTITIES/mobs_mc/cod.lua index bc65faebed..dacdf1dfb8 100644 --- a/mods/ENTITIES/mobs_mc/cod.lua +++ b/mods/ENTITIES/mobs_mc/cod.lua @@ -38,6 +38,16 @@ local cod = { hp_max = 3, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, armor = 100, rotate = 180, spawn_in_group_min = 3, @@ -263,8 +273,8 @@ mcl_mobs:spawn_specific( "ExtremeHillsM_underground", "JungleEdgeM_underground", }, -0, -minetest.LIGHT_MAX+1, +cod.light_min.overworld, +cod.light_max.overworld, 30, 4000, 3, diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index 1ec06b44b1..224218ddd6 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -12,6 +12,16 @@ local cow_def = { hp_max = 10, xp_min = 1, xp_max = 3, + light_min = { + overworld = 9, + nether = 9, + the_end = 9 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.39, 0.45}, spawn_in_group = 4, spawn_in_group_min = 3, @@ -204,8 +214,8 @@ mcl_mobs:spawn_specific( "Swampland", "Swampland_shore" }, -9, -minetest.LIGHT_MAX+1, +cow_def.light_min.overworld, +cow_def.light_max.overworld, 30, 17000, 10, @@ -222,8 +232,8 @@ mcl_mobs:spawn_specific( "MushroomIslandShore", "MushroomIsland" }, -9, -minetest.LIGHT_MAX+1, +cow_def.light_min, +cow_def.light_max, 30, 17000, 5, diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 6bbb37d5a5..a2eba1ae1b 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -7,9 +7,7 @@ local S = minetest.get_translator("mobs_mc") --################### - - -mcl_mobs.register_mob("mobs_mc:creeper", { +local creeper = { type = "monster", spawn_class = "hostile", spawn_in_group = 1, @@ -17,6 +15,16 @@ mcl_mobs.register_mob("mobs_mc:creeper", { hp_max = 20, xp_min = 5, xp_max = 5, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7 + }, collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.69, 0.3}, pathfinding = 1, visual = "mesh", @@ -131,9 +139,11 @@ mcl_mobs.register_mob("mobs_mc:creeper", { floats = 1, fear_height = 4, view_range = 16, -}) +} -mcl_mobs.register_mob("mobs_mc:creeper_charged", { +mcl_mobs.register_mob("mobs_mc:creeper", creeper) + +local creeper_charged = { description = S("Creeper"), type = "monster", spawn_class = "hostile", @@ -260,7 +270,8 @@ mcl_mobs.register_mob("mobs_mc:creeper_charged", { --Having trouble when fire is placed with lightning fire_resistant = true, glow = 3, -}) +} +mcl_mobs.register_mob("mobs_mc:creeper_charged", creeper_charged) mcl_mobs:spawn_specific( "mobs_mc:creeper", @@ -402,8 +413,8 @@ mcl_mobs:spawn_specific( "ExtremeHillsM_underground", "JungleEdgeM_underground", }, -0, -7, +creeper.light_min.overworld, +creeper.light_max.overworld, 20, 16500, 2, diff --git a/mods/ENTITIES/mobs_mc/dolphin.lua b/mods/ENTITIES/mobs_mc/dolphin.lua index 0e5c8e7eea..76b84df098 100644 --- a/mods/ENTITIES/mobs_mc/dolphin.lua +++ b/mods/ENTITIES/mobs_mc/dolphin.lua @@ -38,6 +38,16 @@ local dolphin = { hp_max = 10, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, armor = 100, walk_chance = 100, breath_max = 120, @@ -241,8 +251,8 @@ mcl_mobs:spawn_specific( "ExtremeHillsM_underground", "JungleEdgeM_underground", }, -0, -minetest.LIGHT_MAX+1, +dolphin.light_min.overworld, +dolphin.light_max.overworld, 30, 4000, 3, diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index ef4c8f8118..f31c939d0c 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -48,7 +48,7 @@ local function check_pos(self) end end -mcl_mobs.register_mob("mobs_mc:enderdragon", { +local enderdragon = { description = S("Ender Dragon"), type = "monster", spawn_class = "hostile", @@ -59,6 +59,16 @@ mcl_mobs.register_mob("mobs_mc:enderdragon", { hp_min = 200, xp_min = 500, xp_max = 500, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, collisionbox = {-2, 3, -2, 2, 5, 2}, physical = false, visual = "mesh", @@ -136,7 +146,8 @@ mcl_mobs.register_mob("mobs_mc:enderdragon", { end end, fire_resistant = true, -}) +} +mcl_mobs.register_mob("mobs_mc:enderdragon", enderdragon) local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index 873255862b..999b8d332e 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -255,7 +255,7 @@ local psdefs = {{ texture = "mcl_portals_particle"..math.random(1, 5)..".png", }} -mcl_mobs.register_mob("mobs_mc:enderman", { +local enderman = { description = S("Enderman"), type = "monster", spawn_class = "passive", @@ -266,6 +266,16 @@ mcl_mobs.register_mob("mobs_mc:enderman", { hp_max = 40, xp_min = 5, xp_max = 5, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 11, + the_end = minetest.LIGHT_MAX+1, + }, collisionbox = {-0.3, -0.01, -0.3, 0.3, 2.89, 0.3}, visual = "mesh", mesh = "mobs_mc_enderman.b3d", @@ -631,7 +641,8 @@ mcl_mobs.register_mob("mobs_mc:enderman", { view_range = 64, fear_height = 4, attack_type = "dogfight", -}) +} +mcl_mobs.register_mob("mobs_mc:enderman", enderman) -- End spawn mcl_mobs:spawn_specific( @@ -646,8 +657,8 @@ mcl_mobs:spawn_specific( "EndBorder", "EndSmallIslands" }, -0, -minetest.LIGHT_MAX+1, +enderman.light_min.the_end, +enderman.light_max.the_end, 30, 3000, 12, @@ -794,8 +805,8 @@ mcl_mobs:spawn_specific( "ExtremeHillsM_underground", "JungleEdgeM_underground", }, -0, -7, +enderman.light_min.overworld, +enderman.light_max.overworld, 30, 19000, 2, @@ -811,8 +822,8 @@ mcl_mobs:spawn_specific( "Nether", "SoulsandValley", }, -0, -11, +enderman.light_min.nether, +enderman.light_max.nether, 30, 27500, 4, @@ -827,8 +838,8 @@ mcl_mobs:spawn_specific( { "WarpedForest" }, -0, -11, +enderman.light_min.nether, +enderman.light_max.nether, 30, 5000, 4, diff --git a/mods/ENTITIES/mobs_mc/endermite.lua b/mods/ENTITIES/mobs_mc/endermite.lua index 612054be84..e48a7466e3 100644 --- a/mods/ENTITIES/mobs_mc/endermite.lua +++ b/mods/ENTITIES/mobs_mc/endermite.lua @@ -3,8 +3,7 @@ --################### local S = minetest.get_translator("mobs_mc") - -mcl_mobs.register_mob("mobs_mc:endermite", { +local endermite = { description = S("Endermite"), type = "monster", spawn_class = "hostile", @@ -13,6 +12,16 @@ mcl_mobs.register_mob("mobs_mc:endermite", { hp_max = 8, xp_min = 3, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7 + }, armor = {fleshy = 100, arthropod = 100}, group_attack = true, collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.29, 0.2}, @@ -36,6 +45,8 @@ mcl_mobs.register_mob("mobs_mc:endermite", { view_range = 16, damage = 2, reach = 1, -}) +} + +mcl_mobs.register_mob("mobs_mc:endermite", endermite) mcl_mobs.register_egg("mobs_mc:endermite", S("Endermite"), "#161616", "#6d6d6d", 0) diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua index 0f7e73344c..75bbdb7aee 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -9,8 +9,7 @@ local S = minetest.get_translator("mobs_mc") --################### GHAST --################### - -mcl_mobs.register_mob("mobs_mc:ghast", { +local ghast = { description = S("Ghast"), type = "monster", spawn_class = "hostile", @@ -20,6 +19,16 @@ mcl_mobs.register_mob("mobs_mc:ghast", { hp_max = 10, xp_min = 5, xp_max = 5, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7 + }, collisionbox = {-2, 5, -2, 2, 9, 2}, visual = "mesh", mesh = "mobs_mc_ghast.b3d", @@ -82,7 +91,8 @@ mcl_mobs.register_mob("mobs_mc:ghast", { self.object:set_properties({textures=self.base_texture}) end end, -}) +} +mcl_mobs.register_mob("mobs_mc:ghast", ghast) mcl_mobs:spawn_specific( @@ -94,8 +104,8 @@ mcl_mobs:spawn_specific( "SoulsandValley", "BasaltDelta", }, -0, -7, +ghast.light_min.nether, +ghast.light_max.nether, 30, 72000, 2, diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index 9f3a45e342..05bf1756fe 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -29,7 +29,7 @@ for i=1,4 do table.insert(psdefs,p) end -mcl_mobs.register_mob("mobs_mc:glow_squid", { +local glow_squid = { type = "animal", spawn_class = "water", can_despawn = true, @@ -38,6 +38,16 @@ mcl_mobs.register_mob("mobs_mc:glow_squid", { hp_max = 10, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX + 1, + nether = minetest.LIGHT_MAX + 1, + the_end = minetest.LIGHT_MAX + 1 + }, armor = 100, rotate = 0, -- tilt_swim breaks the animations. @@ -84,7 +94,8 @@ mcl_mobs.register_mob("mobs_mc:glow_squid", { glow = minetest.LIGHT_MAX, particlespawners = psdefs, -}) +} +mcl_mobs.register_mob("mobs_mc:glow_squid", glow_squid) -- spawning local water = mobs_mc.water_level - 1 @@ -234,8 +245,8 @@ mcl_mobs:spawn_specific( "ExtremeHillsM_underground", "JungleEdgeM_underground", }, - 0, - minetest.LIGHT_MAX + 1, + glow_squid.light_min.overworld, + glow_squid.light_max.overworld, 30, 10000, 3, diff --git a/mods/ENTITIES/mobs_mc/guardian.lua b/mods/ENTITIES/mobs_mc/guardian.lua index e9a15264be..1cc6c80c04 100644 --- a/mods/ENTITIES/mobs_mc/guardian.lua +++ b/mods/ENTITIES/mobs_mc/guardian.lua @@ -3,8 +3,7 @@ --################### local S = minetest.get_translator("mobs_mc") - -mcl_mobs.register_mob("mobs_mc:guardian", { +local guardian = { description = S("Guardian"), type = "monster", spawn_class = "hostile", @@ -14,6 +13,16 @@ mcl_mobs.register_mob("mobs_mc:guardian", { hp_max = 30, xp_min = 10, xp_max = 10, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = minetest.LIGHT_MAX+1, + the_end = 7, + }, breath_max = -1, passive = false, attack_type = "dogfight", @@ -97,7 +106,8 @@ mcl_mobs.register_mob("mobs_mc:guardian", { fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, jump = false, view_range = 16, -}) +} +mcl_mobs.register_mob("mobs_mc:guardian", guardian) -- Spawning disabled due to size issues -- TODO: Re-enable spawning diff --git a/mods/ENTITIES/mobs_mc/guardian_elder.lua b/mods/ENTITIES/mobs_mc/guardian_elder.lua index d08cc1846d..e441385da5 100644 --- a/mods/ENTITIES/mobs_mc/guardian_elder.lua +++ b/mods/ENTITIES/mobs_mc/guardian_elder.lua @@ -6,7 +6,7 @@ local S = minetest.get_translator("mobs_mc") -mcl_mobs.register_mob("mobs_mc:guardian_elder", { +local guardian_elder = { description = S("Elder Guardian"), type = "monster", spawn_class = "hostile", @@ -14,6 +14,16 @@ mcl_mobs.register_mob("mobs_mc:guardian_elder", { hp_max = 80, xp_min = 10, xp_max = 10, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = minetest.LIGHT_MAX+1, + the_end = 7, + }, breath_max = -1, passive = false, attack_type = "dogfight", @@ -105,7 +115,8 @@ mcl_mobs.register_mob("mobs_mc:guardian_elder", { fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, jump = false, view_range = 16, -}) +} +mcl_mobs.register_mob("mobs_mc:guardian_elder", guardian_elder) -- Spawning disabled due to size issues <- what do you mean? -j4i -- TODO: Re-enable spawning diff --git a/mods/ENTITIES/mobs_mc/hoglin+zoglin.lua b/mods/ENTITIES/mobs_mc/hoglin+zoglin.lua index e5cdcc8a85..03ecd5a5c2 100644 --- a/mods/ENTITIES/mobs_mc/hoglin+zoglin.lua +++ b/mods/ENTITIES/mobs_mc/hoglin+zoglin.lua @@ -17,6 +17,16 @@ local hoglin = { hp_max = 40, xp_min = 9, xp_max = 9, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, armor = {fleshy = 90}, attack_type = "dogfight", damage = 4, @@ -123,8 +133,8 @@ mcl_mobs:spawn_specific( "Nether", "CrimsonForest" }, -0, -minetest.LIGHT_MAX+1, +hoglin.light_min.nether, +hoglin.light_max.nether, 30, 6000, 3, diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index 7f61627bc9..aebdc075a7 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -167,6 +167,16 @@ local horse = { hp_max = 30, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, floats = 1, makes_footstep_sound = true, jump = true, @@ -609,8 +619,8 @@ mcl_mobs:spawn_specific( "Savanna_beach", "Plains_beach", }, -0, -minetest.LIGHT_MAX+1, +horse.light_min.overworld, +horse.light_max.overworld, 30, 15000, 4, @@ -632,8 +642,8 @@ mcl_mobs:spawn_specific( "Savanna_beach", "Plains_beach", }, -9, -minetest.LIGHT_MAX+1, +donkey.light_min.overworld, +donkey.light_max.overworld, 30, 15000, 4, diff --git a/mods/ENTITIES/mobs_mc/iron_golem.lua b/mods/ENTITIES/mobs_mc/iron_golem.lua index 34a7a511c4..e51df1ccd1 100644 --- a/mods/ENTITIES/mobs_mc/iron_golem.lua +++ b/mods/ENTITIES/mobs_mc/iron_golem.lua @@ -10,14 +10,23 @@ local S = minetest.get_translator("mobs_mc") --################### local etime = 0 - -mcl_mobs.register_mob("mobs_mc:iron_golem", { +local iron_golem = { description = S("Iron Golem"), type = "npc", spawn_class = "passive", passive = false, hp_min = 100, hp_max = 100, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, breath_max = -1, collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.69, 0.7}, visual = "mesh", @@ -93,7 +102,8 @@ mcl_mobs.register_mob("mobs_mc:iron_golem", { end end end, -}) +} +mcl_mobs.register_mob("mobs_mc:iron_golem", iron_golem) -- spawn eggs diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 503f4207ba..ca2fca2fff 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -46,8 +46,7 @@ local function get_drops(self) max = 1,}) end end - -mcl_mobs.register_mob("mobs_mc:llama", { +local llama = { description = S("Llama"), type = "animal", spawn_class = "passive", @@ -70,6 +69,16 @@ mcl_mobs.register_mob("mobs_mc:llama", { hp_max = 30, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.86, 0.45}, visual = "mesh", mesh = "mobs_mc_llama.b3d", @@ -249,7 +258,8 @@ mcl_mobs.register_mob("mobs_mc:llama", { end end end, -}) +} +mcl_mobs.register_mob("mobs_mc:llama", llama) mcl_entity_invs.register_inv("mobs_mc:llama","Llama",nil,true) @@ -288,8 +298,8 @@ mcl_mobs:spawn_specific( "ExtremeHills_beach", "ExtremeHillsM", }, --FIXME: Needs Windswept Forest when that is added. -0, -minetest.LIGHT_MAX+1, +llama.light_min.overworld, +llama.light_max.overworld, 30, 15000, 5, diff --git a/mods/ENTITIES/mobs_mc/ocelot.lua b/mods/ENTITIES/mobs_mc/ocelot.lua index 65181a5810..59beaf05b0 100644 --- a/mods/ENTITIES/mobs_mc/ocelot.lua +++ b/mods/ENTITIES/mobs_mc/ocelot.lua @@ -36,6 +36,16 @@ local ocelot = { hp_max = 10, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, head_swivel = "head.control", bone_eye_height = 6.2, head_eye_height = 0.4, @@ -183,8 +193,8 @@ mcl_mobs:spawn_specific( "JungleM", "JungleEdge", }, -0, -minetest.LIGHT_MAX+1, +ocelot.light_min.overworld, +ocelot.light_max.overworld, 30, 15000, 5, diff --git a/mods/ENTITIES/mobs_mc/parrot.lua b/mods/ENTITIES/mobs_mc/parrot.lua index ed2892aca5..2cfe009f9c 100644 --- a/mods/ENTITIES/mobs_mc/parrot.lua +++ b/mods/ENTITIES/mobs_mc/parrot.lua @@ -124,8 +124,7 @@ local function check_perch(self,dtime) end end end - -mcl_mobs.register_mob("mobs_mc:parrot", { +local parrot = { description = S("Parrot"), type = "animal", spawn_class = "passive", @@ -135,6 +134,16 @@ mcl_mobs.register_mob("mobs_mc:parrot", { hp_max = 6, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, head_swivel = "head.control", bone_eye_height = 1.1, horrizonatal_head_height=0, @@ -219,7 +228,9 @@ mcl_mobs.register_mob("mobs_mc:parrot", { return false --return false explicitly here. mcl_mobs checks for that end end, -}) +} + +mcl_mobs.register_mob("mobs_mc:parrot", parrot) -- Parrots spawn rarely in jungles. TODO: Also check for jungle *biome* <- I'll get to this eventually -j4i mcl_mobs:spawn_specific( @@ -232,8 +243,8 @@ mcl_mobs:spawn_specific( "JungleM", "JungleEdge", }, -0, -minetest.LIGHT_MAX+1, +parrot.light_min.overworld, +parrot.light_max.overworld, 7, 30000, 1, diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index 7f2ebc88d1..1c5a4d7bcb 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -1,8 +1,7 @@ --License for code WTFPL and otherwise stated in readmes local S = minetest.get_translator("mobs_mc") - -mcl_mobs.register_mob("mobs_mc:pig", { +local pig = { description = S("Pig"), type = "animal", spawn_class = "passive", @@ -12,6 +11,16 @@ mcl_mobs.register_mob("mobs_mc:pig", { hp_max = 10, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, collisionbox = {-0.45, -0.01, -0.45, 0.45, 0.865, 0.45}, visual = "mesh", mesh = "mobs_mc_pig.b3d", @@ -195,7 +204,8 @@ mcl_mobs.register_mob("mobs_mc:pig", { return false end end, -}) +} +mcl_mobs.register_mob("mobs_mc:pig", pig) mcl_mobs:spawn_specific( "mobs_mc:pig", @@ -234,8 +244,8 @@ mcl_mobs:spawn_specific( "Swampland", "Swampland_shore" }, -9, -minetest.LIGHT_MAX+1, +pig.light_min.overworld, +pig.light_max.overworld, 30, 15000, 8, diff --git a/mods/ENTITIES/mobs_mc/piglin.lua b/mods/ENTITIES/mobs_mc/piglin.lua index 90e19ef023..520a17b376 100644 --- a/mods/ENTITIES/mobs_mc/piglin.lua +++ b/mods/ENTITIES/mobs_mc/piglin.lua @@ -42,6 +42,16 @@ local piglin = { hp_max = 16, xp_min = 9, xp_max = 9, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = minetest.LIGHT_MAX+1, + the_end = 7 + }, armor = {fleshy = 90}, damage = 4, reach = 3, @@ -292,8 +302,8 @@ mcl_mobs:spawn_specific( "Nether", "CrimsonForest" }, -0, -minetest.LIGHT_MAX+1, +piglin.light_min.nether, +piglin.light_max.nether, 30, 6000, 3, @@ -308,8 +318,8 @@ mcl_mobs:spawn_specific( "Nether", "CrimsonForest" }, -0, -minetest.LIGHT_MAX+1, +sword_piglin.light_min.nether, +sword_piglin.light_max.nether, 30, 6000, 3, diff --git a/mods/ENTITIES/mobs_mc/pillager.lua b/mods/ENTITIES/mobs_mc/pillager.lua index 0b6b036f77..a24c1add97 100644 --- a/mods/ENTITIES/mobs_mc/pillager.lua +++ b/mods/ENTITIES/mobs_mc/pillager.lua @@ -23,6 +23,16 @@ pillager = { hp_max = 24, xp_min = 6, xp_max = 6, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7, + }, breath_max = -1, eye_height = 1.5, shoot_interval = 3, diff --git a/mods/ENTITIES/mobs_mc/polar_bear.lua b/mods/ENTITIES/mobs_mc/polar_bear.lua index d6667a256c..f346f5e887 100644 --- a/mods/ENTITIES/mobs_mc/polar_bear.lua +++ b/mods/ENTITIES/mobs_mc/polar_bear.lua @@ -6,8 +6,7 @@ local S = minetest.get_translator("mobs_mc") --################### POLARBEAR --################### - -mcl_mobs.register_mob("mobs_mc:polar_bear", { +local polar_bear = { description = S("Polar Bear"), type = "animal", spawn_class = "passive", @@ -17,7 +16,17 @@ mcl_mobs.register_mob("mobs_mc:polar_bear", { hp_max = 30, xp_min = 1, xp_max = 3, - breath_max = -1, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, + breath_max = -1, collisionbox = {-0.7, -0.01, -0.7, 0.7, 1.39, 0.7}, visual = "mesh", mesh = "mobs_mc_polarbear.b3d", @@ -71,7 +80,8 @@ mcl_mobs.register_mob("mobs_mc:polar_bear", { }, view_range = 16, -}) +} +mcl_mobs.register_mob("mobs_mc:polar_bear", polar_bear) mcl_mobs:spawn_specific( @@ -83,8 +93,8 @@ mcl_mobs:spawn_specific( "IcePlainsSpikes", "IcePlains", }, -0, -minetest.LIGHT_MAX+1, +polar_bear.light_min.overworld, +polar_bear.light_max.overworld, 30, 7000, 3, diff --git a/mods/ENTITIES/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index 6d13fbe22a..e8a5d1f43b 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -14,6 +14,16 @@ local rabbit = { hp_max = 3, xp_min = 1, xp_max = 3, + light_min = { + overworld = 9, + nether = 9, + the_end = 9 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2}, head_swivel = "head.control", bone_eye_height = 2, @@ -145,8 +155,8 @@ mcl_mobs:spawn_specific( "MegaTaiga", "ColdTaiga", }, -9, -minetest.LIGHT_MAX+1, +rabbit.light_min.overworld, +rabbit.light_max.overworld, 30, 15000, 8, diff --git a/mods/ENTITIES/mobs_mc/salmon.lua b/mods/ENTITIES/mobs_mc/salmon.lua index 873d4bb74f..fc32ecda0d 100644 --- a/mods/ENTITIES/mobs_mc/salmon.lua +++ b/mods/ENTITIES/mobs_mc/salmon.lua @@ -18,6 +18,16 @@ local salmon = { hp_max = 3, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1, + }, armor = 100, spawn_in_group = 5, tilt_swim = true, @@ -217,8 +227,8 @@ mcl_mobs:spawn_specific( "ExtremeHillsM_underground", "JungleEdgeM_underground", }, -0, -minetest.LIGHT_MAX+1, +salmon.light_min.overworld, +salmon.light_max.overworld, 30, 4000, 3, diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index c71fa9b547..50a6589b4b 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -51,8 +51,7 @@ end local gotten_texture = { "blank.png", "mobs_mc_sheep.png" } ---mcsheep -mcl_mobs.register_mob("mobs_mc:sheep", { +local sheep = { description = S("Sheep"), type = "animal", spawn_class = "passive", @@ -61,6 +60,16 @@ mcl_mobs.register_mob("mobs_mc:sheep", { hp_max = 8, xp_min = 1, xp_max = 3, + light_min = { + overworld = 9, + nether = 9, + the_end = 9 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1, + }, collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.29, 0.45}, head_swivel = "head.control", bone_eye_height = 3.3, @@ -314,7 +323,9 @@ mcl_mobs.register_mob("mobs_mc:sheep", { return false end end, -}) +} +--mcsheep +mcl_mobs.register_mob("mobs_mc:sheep", sheep) mcl_mobs:spawn_specific( "mobs_mc:sheep", "overworld", @@ -357,8 +368,8 @@ mcl_mobs:spawn_specific( "Swampland", "Swampland_shore" }, -9, -minetest.LIGHT_MAX+1, +sheep.light_min.overworld, +sheep.light_max.overworld, 30, 15000, 3, diff --git a/mods/ENTITIES/mobs_mc/shulker.lua b/mods/ENTITIES/mobs_mc/shulker.lua index 46737e90fd..e19080d276 100644 --- a/mods/ENTITIES/mobs_mc/shulker.lua +++ b/mods/ENTITIES/mobs_mc/shulker.lua @@ -29,8 +29,7 @@ local function check_spot(pos) return false end local pr = PseudoRandom(os.time()*(-334)) --- animation 45-80 is transition between passive and attack stance -mcl_mobs.register_mob("mobs_mc:shulker", { +local shulker = { description = S("Shulker"), type = "monster", spawn_class = "hostile", @@ -43,6 +42,16 @@ mcl_mobs.register_mob("mobs_mc:shulker", { hp_max = 30, xp_min = 5, xp_max = 5, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1, + }, armor = 150, collisionbox = {-0.5, -0.01, -0.5, 0.5, 0.99, 0.5}, visual = "mesh", @@ -149,7 +158,9 @@ mcl_mobs.register_mob("mobs_mc:shulker", { end end end, -}) +} +-- animation 45-80 is transition between passive and attack stance +mcl_mobs.register_mob("mobs_mc:shulker", shulker) -- bullet arrow (weapon) mcl_mobs.register_arrow("mobs_mc:shulkerbullet", { diff --git a/mods/ENTITIES/mobs_mc/silverfish.lua b/mods/ENTITIES/mobs_mc/silverfish.lua index e0bcc23aa7..be22a05879 100644 --- a/mods/ENTITIES/mobs_mc/silverfish.lua +++ b/mods/ENTITIES/mobs_mc/silverfish.lua @@ -15,6 +15,16 @@ mcl_mobs.register_mob("mobs_mc:silverfish", { hp_max = 8, xp_min = 5, xp_max = 5, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 11, + nether = 11, + the_end = 11, + }, armor = {fleshy = 100, arthropod = 100}, collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.44, 0.4}, visual = "mesh", diff --git a/mods/ENTITIES/mobs_mc/skeleton+stray.lua b/mods/ENTITIES/mobs_mc/skeleton+stray.lua index ca2fe25fa9..c6ba7615c8 100644 --- a/mods/ENTITIES/mobs_mc/skeleton+stray.lua +++ b/mods/ENTITIES/mobs_mc/skeleton+stray.lua @@ -20,6 +20,16 @@ local skeleton = { hp_max = 20, xp_min = 6, xp_max = 6, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = minetest.LIGHT_MAX+1, + the_end = 7, + }, breath_max = -1, armor = {undead = 100, fleshy = 100}, collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3}, @@ -309,8 +319,8 @@ mcl_mobs:spawn_specific( "ExtremeHillsM_underground", "JungleEdgeM_underground", }, -0, -7, +skeleton.light_min.overworld, +skeleton.light_max.overworld, 20, 17000, 2, @@ -326,8 +336,8 @@ mcl_mobs:spawn_specific( { "SoulsandValley", }, -0, -minetest.LIGHT_MAX+1, +skeleton.light_min.nether, +skeleton.light_max.nether, 30, 10000, 3, @@ -346,8 +356,8 @@ mcl_mobs:spawn_specific( "IcePlains", "ExtremeHills+_snowtop", }, -0, -7, +stray.light_min.overworld, +stray.light_max.overworld, 20, 19000, 2, diff --git a/mods/ENTITIES/mobs_mc/skeleton_wither.lua b/mods/ENTITIES/mobs_mc/skeleton_wither.lua index 94fa78120b..8a88e43e9e 100644 --- a/mods/ENTITIES/mobs_mc/skeleton_wither.lua +++ b/mods/ENTITIES/mobs_mc/skeleton_wither.lua @@ -9,7 +9,7 @@ local S = minetest.get_translator("mobs_mc") --################### WITHER SKELETON --################### -mcl_mobs.register_mob("mobs_mc:witherskeleton", { +local witherskeleton = { description = S("Wither Skeleton"), type = "monster", spawn_class = "hostile", @@ -17,6 +17,16 @@ mcl_mobs.register_mob("mobs_mc:witherskeleton", { hp_max = 20, xp_min = 6, xp_max = 6, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7, + }, breath_max = -1, armor = {undead = 100, fleshy = 100}, pathfinding = 1, @@ -96,7 +106,8 @@ mcl_mobs.register_mob("mobs_mc:witherskeleton", { fear_height = 4, harmed_by_heal = true, fire_resistant = true, -}) +} +mcl_mobs.register_mob("mobs_mc:witherskeleton", witherskeleton) --spawn --[[] diff --git a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua index 31ecad1879..36a836c276 100644 --- a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua +++ b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua @@ -70,6 +70,17 @@ local slime_big = { hp_max = 16, xp_min = 4, xp_max = 4, + swamp_light_max = 7, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, collisionbox = {-1.02, -0.01, -1.02, 1.02, 2.03, 1.02}, visual_size = {x=12.5, y=12.5}, textures = {{"mobs_mc_slime.png", "mobs_mc_slime.png"}}, @@ -197,7 +208,7 @@ local cave_min = mcl_vars.mg_overworld_min local cave_max = water_level - 23 local swampy_biomes = {"Swampland", "MangroveSwamp"} -local swamp_light_max = 7 + local swamp_min = water_level local swamp_max = water_level + 27 @@ -206,8 +217,8 @@ mcl_mobs:spawn_specific( "overworld", "ground", cave_biomes, -0, -minetest.LIGHT_MAX+1, +slime_tiny.light_min.overworld, +slime_tiny.light_max.overworld, 30, 12000, 4, @@ -220,7 +231,7 @@ mcl_mobs:spawn_specific( "ground", swampy_biomes, 0, -swamp_light_max, +slime_tiny.swamp_light_max, 30, 12000, 4, @@ -232,8 +243,8 @@ mcl_mobs:spawn_specific( "overworld", "ground", cave_biomes, -0, -minetest.LIGHT_MAX+1, +slime_small.light_min.overworld, +slime_small.light_max.overworld, 30, 8500, 4, @@ -246,7 +257,7 @@ mcl_mobs:spawn_specific( "ground", swampy_biomes, 0, -swamp_light_max, +slime_small.swamp_light_max, 30, 8500, 4, @@ -258,8 +269,8 @@ mcl_mobs:spawn_specific( "overworld", "ground", cave_biomes, -0, -minetest.LIGHT_MAX+1, +slime_big.light_min.overworld, +slime_big.light_max.overworld, 30, 10000, 4, @@ -272,7 +283,7 @@ mcl_mobs:spawn_specific( "ground", swampy_biomes, 0, -swamp_light_max, +slime_big.swamp_light_max, 30, 10000, 4, @@ -288,6 +299,16 @@ local magma_cube_big = { hp_max = 16, xp_min = 4, xp_max = 4, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1 + }, collisionbox = {-1.02, -0.01, -1.02, 1.02, 2.03, 1.02}, visual_size = {x=12.5, y=12.5}, textures = {{ "mobs_mc_magmacube.png", "mobs_mc_magmacube.png" }}, @@ -394,8 +415,8 @@ mcl_mobs:spawn_specific( "nether", "ground", magma_cube_biomes, -0, -minetest.LIGHT_MAX+1, +magma_cube_tiny.light_min.nether, +magma_cube_tiny.light_max.nether, 30, 15000, 4, @@ -407,8 +428,8 @@ mcl_mobs:spawn_specific( "nether", "ground", magma_cube_biomes, -0, -minetest.LIGHT_MAX+1, +magma_cube_small.light_min.nether, +magma_cube_small.light_max.nether, 30, 15500, 4, @@ -419,8 +440,8 @@ mcl_mobs:spawn_specific( "mobs_mc:magma_cube_big", "nether", "ground", -magma_cube_biomes, -0, +magma_cube_big.light_min.nether, +magma_cube_big.light_max.nether, minetest.LIGHT_MAX+1, 30, 16000, diff --git a/mods/ENTITIES/mobs_mc/snowman.lua b/mods/ENTITIES/mobs_mc/snowman.lua index f9f0043c2f..c2236616d9 100644 --- a/mods/ENTITIES/mobs_mc/snowman.lua +++ b/mods/ENTITIES/mobs_mc/snowman.lua @@ -20,7 +20,7 @@ local gotten_texture = { "blank.png", } -mcl_mobs.register_mob("mobs_mc:snowman", { +local snowman = { description = S("Snow Golem"), type = "npc", spawn_class = "passive", @@ -135,7 +135,9 @@ mcl_mobs.register_mob("mobs_mc:snowman", { end end end, -}) +} + +mcl_mobs.register_mob("mobs_mc:snowman", snowman) local summon_particles = function(obj) local lua = obj:get_luaentity() diff --git a/mods/ENTITIES/mobs_mc/spider.lua b/mods/ENTITIES/mobs_mc/spider.lua index 403edba6da..2a5a57f68f 100644 --- a/mods/ENTITIES/mobs_mc/spider.lua +++ b/mods/ENTITIES/mobs_mc/spider.lua @@ -43,6 +43,16 @@ local spider = { hp_max = 16, xp_min = 5, xp_max = 5, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7, + }, armor = {fleshy = 100, arthropod = 100}, on_spawn = function(self) self.object:set_properties({visual_size={x=1,y=1}}) @@ -284,8 +294,8 @@ mcl_mobs:spawn_specific( "ExtremeHillsM_underground", "JungleEdgeM_underground", }, -0, -7, +spider.light_min.overworld, +spider.light_max.overworld, 30, 17000, 2, diff --git a/mods/ENTITIES/mobs_mc/squid.lua b/mods/ENTITIES/mobs_mc/squid.lua index a692fd8d47..0a161837a6 100644 --- a/mods/ENTITIES/mobs_mc/squid.lua +++ b/mods/ENTITIES/mobs_mc/squid.lua @@ -6,7 +6,7 @@ local S = minetest.get_translator("mobs_mc") -mcl_mobs.register_mob("mobs_mc:squid", { +local squid = { description = S("Squid"), type = "animal", spawn_class = "water", @@ -16,6 +16,16 @@ mcl_mobs.register_mob("mobs_mc:squid", { hp_max = 10, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1, + }, armor = 100, -- FIXME: If the squid is near the floor, it turns black collisionbox = {-0.4, 0.0, -0.4, 0.4, 0.9, 0.4}, @@ -55,7 +65,9 @@ mcl_mobs.register_mob("mobs_mc:squid", { view_range = 16, runaway = true, fear_height = 4, -}) +} + +mcl_mobs.register_mob("mobs_mc:squid", squid) -- TODO: Behaviour: squirt @@ -208,8 +220,8 @@ mcl_mobs:spawn_specific( "ExtremeHillsM_underground", "JungleEdgeM_underground", }, -0, -minetest.LIGHT_MAX+1, +squid.light_min.overworld, +squid.light_max.overworld, 30, 5500, 3, diff --git a/mods/ENTITIES/mobs_mc/strider.lua b/mods/ENTITIES/mobs_mc/strider.lua index a49845f7ee..7f75a248e9 100644 --- a/mods/ENTITIES/mobs_mc/strider.lua +++ b/mods/ENTITIES/mobs_mc/strider.lua @@ -18,6 +18,16 @@ local strider = { hp_max = 20, xp_min = 9, xp_max = 9, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1, + }, armor = {fleshy = 90}, attack_type = "dogfight", damage = 2, diff --git a/mods/ENTITIES/mobs_mc/tropical_fish.lua b/mods/ENTITIES/mobs_mc/tropical_fish.lua index bb9b63f64d..a219a83147 100644 --- a/mods/ENTITIES/mobs_mc/tropical_fish.lua +++ b/mods/ENTITIES/mobs_mc/tropical_fish.lua @@ -66,6 +66,16 @@ local tropical_fish = { hp_max = 3, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1, + }, armor = 100, spawn_in_group = 9, tilt_swim = true, @@ -180,8 +190,8 @@ mcl_mobs:spawn_specific( "JungleM_underground", "JungleEdgeM_underground", }, -0, -minetest.LIGHT_MAX+1, +tropical_fish.light_min.overworld, +tropical_fish.light_max.overworld, 30, 4000, 3, diff --git a/mods/ENTITIES/mobs_mc/vex.lua b/mods/ENTITIES/mobs_mc/vex.lua index f2cd6f14bc..df0d02debe 100644 --- a/mods/ENTITIES/mobs_mc/vex.lua +++ b/mods/ENTITIES/mobs_mc/vex.lua @@ -8,8 +8,7 @@ local S = minetest.get_translator("mobs_mc") --################### --################### VEX --################### - -mcl_mobs.register_mob("mobs_mc:vex", { +local vex = { description = S("Vex"), type = "monster", spawn_class = "hostile", @@ -90,7 +89,8 @@ mcl_mobs.register_mob("mobs_mc:vex", { end, fly = true, makes_footstep_sound = false, -}) +} +mcl_mobs.register_mob("mobs_mc:vex", vex) -- spawn eggs diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index dc43c647ee..88f669a0b5 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -1931,13 +1931,23 @@ end) --[=======[ MOB REGISTRATION AND SPAWNING ]=======] -mcl_mobs.register_mob("mobs_mc:villager", { +local villager = { description = S("Villager"), type = "npc", spawn_class = "passive", passive = true, hp_min = 20, hp_max = 20, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1, + }, head_swivel = "head.control", bone_eye_height = 6.3, head_eye_height = 2.2, @@ -2155,7 +2165,9 @@ mcl_mobs.register_mob("mobs_mc:villager", { mcl_util.replace_mob(self.object, "mobs_mc:witch") return true end, -}) +} + +mcl_mobs.register_mob("mobs_mc:villager", villager) --[[ diff --git a/mods/ENTITIES/mobs_mc/villager_evoker.lua b/mods/ENTITIES/mobs_mc/villager_evoker.lua index 4d46a72600..663517b89a 100644 --- a/mods/ENTITIES/mobs_mc/villager_evoker.lua +++ b/mods/ENTITIES/mobs_mc/villager_evoker.lua @@ -13,7 +13,7 @@ local pr = PseudoRandom(os.time()*666) local spawned_vexes = {} --this is stored locally so the mobs engine doesn't try to store it in staticdata -mcl_mobs.register_mob("mobs_mc:evoker", { +local evoker = { description = S("Evoker"), type = "monster", spawn_class = "hostile", @@ -24,6 +24,16 @@ mcl_mobs.register_mob("mobs_mc:evoker", { hp_max = 24, xp_min = 10, xp_max = 10, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7, + }, head_swivel = "head.control", bone_eye_height = 6.3, head_eye_height = 2.2, @@ -86,7 +96,8 @@ mcl_mobs.register_mob("mobs_mc:evoker", { }, view_range = 16, fear_height = 4, -}) +} +mcl_mobs.register_mob("mobs_mc:evoker", evoker) -- spawn eggs mcl_mobs.register_egg("mobs_mc:evoker", S("Evoker"), "#959b9b", "#1e1c1a", 0) diff --git a/mods/ENTITIES/mobs_mc/villager_illusioner.lua b/mods/ENTITIES/mobs_mc/villager_illusioner.lua index f7c034eb0a..5a9a5684bb 100644 --- a/mods/ENTITIES/mobs_mc/villager_illusioner.lua +++ b/mods/ENTITIES/mobs_mc/villager_illusioner.lua @@ -6,7 +6,7 @@ local S = minetest.get_translator("mobs_mc") local mod_bows = minetest.get_modpath("mcl_bows") ~= nil -mcl_mobs.register_mob("mobs_mc:illusioner", { +local illusioner = { description = S("Illusioner"), type = "monster", spawn_class = "hostile", @@ -25,6 +25,16 @@ mcl_mobs.register_mob("mobs_mc:illusioner", { hp_max = 32, xp_min = 6, xp_max = 6, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7, + }, collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3}, visual = "mesh", mesh = "mobs_mc_illusioner.b3d", @@ -63,6 +73,7 @@ mcl_mobs.register_mob("mobs_mc:illusioner", { }, view_range = 16, fear_height = 4, -}) +} +mcl_mobs.register_mob("mobs_mc:illusioner", illusioner) mcl_mobs.register_egg("mobs_mc:illusioner", S("Illusioner"), "#3f5cbb", "#8a8686", 0) diff --git a/mods/ENTITIES/mobs_mc/villager_vindicator.lua b/mods/ENTITIES/mobs_mc/villager_vindicator.lua index b2dcb827a8..eb3cebbb75 100644 --- a/mods/ENTITIES/mobs_mc/villager_vindicator.lua +++ b/mods/ENTITIES/mobs_mc/villager_vindicator.lua @@ -9,8 +9,7 @@ local S = minetest.get_translator("mobs_mc") --################### VINDICATOR --################### - -mcl_mobs.register_mob("mobs_mc:vindicator", { +local vindicator = { description = S("Vindicator"), type = "monster", spawn_class = "hostile", @@ -20,6 +19,16 @@ mcl_mobs.register_mob("mobs_mc:vindicator", { hp_max = 24, xp_min = 6, xp_max = 6, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7, + }, collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3}, visual = "mesh", mesh = "mobs_mc_vindicator.b3d", @@ -74,7 +83,9 @@ mcl_mobs.register_mob("mobs_mc:vindicator", { }, view_range = 16, fear_height = 4, -}) +} + +mcl_mobs.register_mob("mobs_mc:vindicator", vindicator) -- spawn eggs mcl_mobs.register_egg("mobs_mc:vindicator", S("Vindicator"), "#959b9b", "#275e61", 0) diff --git a/mods/ENTITIES/mobs_mc/villager_zombie.lua b/mods/ENTITIES/mobs_mc/villager_zombie.lua index 8571d52a3d..dfc00c7b24 100644 --- a/mods/ENTITIES/mobs_mc/villager_zombie.lua +++ b/mods/ENTITIES/mobs_mc/villager_zombie.lua @@ -25,7 +25,7 @@ local professions = { nitwit = "mobs_mc_villager.png", } -mcl_mobs.register_mob("mobs_mc:villager_zombie", { +local villager_zombie = { description = S("Zombie Villager"), type = "monster", spawn_class = "hostile", @@ -34,6 +34,16 @@ mcl_mobs.register_mob("mobs_mc:villager_zombie", { hp_max = 20, xp_min = 5, xp_max = 5, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7, + }, breath_max = -1, armor = {undead = 90, fleshy = 90}, collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3}, @@ -138,7 +148,8 @@ mcl_mobs.register_mob("mobs_mc:villager_zombie", { fear_height = 4, harmed_by_heal = true, attack_npcs = true, -}) +} +mcl_mobs.register_mob("mobs_mc:villager_zombie", villager_zombie) mcl_mobs:spawn_specific( "mobs_mc:villager_zombie", @@ -222,8 +233,8 @@ mcl_mobs:spawn_specific( "MesaBryce_sandlevel", "Mesa_sandlevel", }, -0, -7, +villager_zombie.light_min.overworld, +villager_zombie.light_max.overworld, 30, 4090, 4, diff --git a/mods/ENTITIES/mobs_mc/witch.lua b/mods/ENTITIES/mobs_mc/witch.lua index 266d5b0c35..72e49e7bb4 100644 --- a/mods/ENTITIES/mobs_mc/witch.lua +++ b/mods/ENTITIES/mobs_mc/witch.lua @@ -21,6 +21,16 @@ mcl_mobs.register_mob("mobs_mc:witch", { hp_max = 26, xp_min = 5, xp_max = 5, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7, + }, collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3}, visual = "mesh", mesh = "mobs_mc_witch.b3d", diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index dda2beafa5..29d321a4b7 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -17,6 +17,16 @@ mcl_mobs.register_mob("mobs_mc:wither", { hp_min = 300, xp_min = 50, xp_max = 50, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7 + }, armor = {undead = 80, fleshy = 100}, -- This deviates from MC Wiki's size, which makes no sense collisionbox = {-0.9, 0.4, -0.9, 0.9, 2.45, 0.9}, diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index 9220695084..aecae6870c 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -16,6 +16,16 @@ local wolf = { hp_max = 8, xp_min = 1, xp_max = 3, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = minetest.LIGHT_MAX+1, + nether = minetest.LIGHT_MAX+1, + the_end = minetest.LIGHT_MAX+1, + }, passive = false, group_attack = true, spawn_in_group = 8, @@ -226,8 +236,8 @@ mcl_mobs:spawn_specific( minetest.LIGHT_MAX+1, 30, 9000, -7, -mobs_mc.water_level+3, +wolf.light_min.overworld, +wolf.light_max.overworld, mcl_vars.mg_overworld_max) mcl_mobs.register_egg("mobs_mc:wolf", S("Wolf"), "#d7d3d3", "#ceaf96", 0) diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index a54f51dec3..53234c780f 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -53,6 +53,16 @@ local zombie = { hp_max = 20, xp_min = 5, xp_max = 5, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = 7, + the_end = 7 + }, head_swivel = "head.control", bone_eye_height = 6.3, head_eye_height = 2.2, @@ -240,8 +250,8 @@ mcl_mobs:spawn_specific( "MesaBryce_sandlevel", "Mesa_sandlevel", }, -0, -7, +zombie.light_min.overworld, +zombie.light_max.overworld, 30, 6000, 4, @@ -329,8 +339,8 @@ mcl_mobs:spawn_specific( "MesaBryce_sandlevel", "Mesa_sandlevel", }, -0, -7, +baby_zombie.light_min.overworld, +baby_zombie.light_max.overworld, 30, 60000, 4, @@ -345,8 +355,8 @@ mcl_mobs:spawn_specific( { "Desert", }, -0, -7, +husk.light_min.overworld, +husk.light_max.overworld, 30, 6500, 4, @@ -359,8 +369,8 @@ mcl_mobs:spawn_specific( { "Desert", }, -0, -7, +baby_husk.light_min.overworld, +baby_husk.light_max.overworld, 30, 65000, 4, diff --git a/mods/ENTITIES/mobs_mc/zombiepig.lua b/mods/ENTITIES/mobs_mc/zombiepig.lua index 4e89db4f67..1ec8afa107 100644 --- a/mods/ENTITIES/mobs_mc/zombiepig.lua +++ b/mods/ENTITIES/mobs_mc/zombiepig.lua @@ -20,6 +20,16 @@ local pigman = { hp_max = 20, xp_min = 6, xp_max = 6, + light_min = { + overworld = 0, + nether = 0, + the_end = 0 + }, + light_max = { + overworld = 7, + nether = minetest.LIGHT_MAX+1, + the_end = 7 + }, armor = {undead = 90, fleshy = 90}, attack_type = "dogfight", group_attack = { "mobs_mc:pigman", "mobs_mc:baby_pigman" },