From 57b5d13edf7c417ea216db24ea02a2b2d1d7c460 Mon Sep 17 00:00:00 2001 From: cora Date: Tue, 4 Oct 2022 12:22:24 +0200 Subject: [PATCH] Add setting to optionally bring back spawn icons --- mods/ENTITIES/mcl_mobs/api.lua | 7 +++++-- settingtypes.txt | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index d09a9adfed..b76a9620ba 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -71,7 +71,7 @@ local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= fa local remove_far = true local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0 local show_health = false - +local old_spawn_icons = minetest.settings:get_bool("mcl_old_spawn_icons",false) -- Shows helpful debug info above each mob local mobs_debug = minetest.settings:get_bool("mobs_debug", false) local spawn_logging = minetest.settings:get_bool("mcl_logging_mobs_spawn",true) @@ -4442,7 +4442,10 @@ function mcl_mobs:register_egg(mob, desc, background_color, overlay_color, addeg end local invimg = "(spawn_egg.png^[multiply:" .. background_color ..")^(spawn_egg_overlay.png^[multiply:" .. overlay_color .. ")" - + if old_spawn_icons then + local mobname = mob:gsub("mobs_mc:","") + invimg = "mobs_mc_spawn_icon_"..mobname..".png" + end if addegg == 1 then invimg = "mobs_chicken_egg.png^(" .. invimg .. "^[mask:mobs_chicken_egg_overlay.png)" diff --git a/settingtypes.txt b/settingtypes.txt index 7ab47e36da..0265778b6d 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -108,6 +108,9 @@ mcl_mob_cap_animal (Mob cap animals) int 10 0 1024 #Maximum amount of ambient mobs that will spawn near a player (default:15) mcl_mob_cap_ambient (Mob cap ambient mobs) int 15 0 1024 +#Display mob icons in inventory instead of mc-like spawn eggs +mcl_old_spawn_icons (Old spawn icons instead of eggs) bool false + [Audio] # Enable flame sound. flame_sound (Flame sound) bool true