mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-11-14 14:30:19 +01:00
add fallback node for when [game] doesn't have dirt alias defined
This commit is contained in:
parent
e11f383589
commit
91be60be9b
17
api.lua
17
api.lua
|
@ -11,16 +11,23 @@ local use_mc2 = minetest.get_modpath("mcl_core")
|
||||||
-- Visual Harm 1ndicator check
|
-- Visual Harm 1ndicator check
|
||||||
local use_vh1 = minetest.get_modpath("visual_harm_1ndicators")
|
local use_vh1 = minetest.get_modpath("visual_harm_1ndicators")
|
||||||
|
|
||||||
|
-- Node check helper
|
||||||
|
local function has(nodename)
|
||||||
|
if nodename and minetest.registered_nodes[nodename] then
|
||||||
|
return nodename
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Global
|
-- Global
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20240620",
|
version = "20240629",
|
||||||
translate = S,
|
translate = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {},
|
invis = minetest.global_exists("invisibility") and invisibility or {},
|
||||||
node_snow = minetest.registered_aliases["mapgen_snow"]
|
node_snow = has(minetest.registered_aliases["mapgen_snow"])
|
||||||
or (use_mc2 and "mcl_core:snow") or "default:snow",
|
or has("mcl_core:snow") or has("default:snow") or "air",
|
||||||
node_dirt = minetest.registered_aliases["mapgen_dirt"]
|
node_dirt = has(minetest.registered_aliases["mapgen_dirt"])
|
||||||
or (use_mc2 and "mcl_core:dirt") or "default:dirt"
|
or has("mcl_core:dirt") or has("default:dirt") or "mobs:fallback_node"
|
||||||
}
|
}
|
||||||
mobs.fallback_node = mobs.node_dirt
|
mobs.fallback_node = mobs.node_dirt
|
||||||
|
|
||||||
|
|
8
init.lua
8
init.lua
|
@ -7,6 +7,14 @@ minetest.register_privilege("peaceful_player", {
|
||||||
give_to_singleplayer = false
|
give_to_singleplayer = false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Fallback node
|
||||||
|
minetest.register_node("mobs:fallback_node", {
|
||||||
|
description = "Fallback Node",
|
||||||
|
tiles = {"mobs_fallback.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {handy = 1, crumbly = 3},
|
||||||
|
drop = ""
|
||||||
|
})
|
||||||
|
|
||||||
-- Mob API
|
-- Mob API
|
||||||
dofile(path .. "/api.lua")
|
dofile(path .. "/api.lua")
|
||||||
|
|
|
@ -23,6 +23,8 @@ THE SOFTWARE.
|
||||||
|
|
||||||
Textures under CC0 license by TenPlus1
|
Textures under CC0 license by TenPlus1
|
||||||
|
|
||||||
|
mobs_fallback.png is dirt texture from original Minetest (CC-BY SA 3.0)
|
||||||
|
|
||||||
|
|
||||||
ShadowNinja (CC BY-SA 3.0):
|
ShadowNinja (CC BY-SA 3.0):
|
||||||
tnt_smoke.png
|
tnt_smoke.png
|
||||||
|
|
|
@ -33,6 +33,7 @@ https://forum.minetest.net/viewtopic.php?f=11&t=9917
|
||||||
* Added support for Visual Harm 1ndicators mod to show health bars
|
* Added support for Visual Harm 1ndicators mod to show health bars
|
||||||
* Added self.node_damage flag which is true by default to enable damage_per_second node damage
|
* Added self.node_damage flag which is true by default to enable damage_per_second node damage
|
||||||
* Added check for on_death() function before using mob api's own on_die() one
|
* Added check for on_death() function before using mob api's own on_die() one
|
||||||
|
* Added mobs:fallback_node for when current [game] hasn't defined mapgen_dirt node
|
||||||
|
|
||||||
### Version 1.60
|
### Version 1.60
|
||||||
|
|
||||||
|
|
BIN
textures/mobs_fallback.png
Normal file
BIN
textures/mobs_fallback.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in New Issue
Block a user