correct lower nether border, allow custom spawning, correct descriptions, add russian translation

This commit is contained in:
adikalon 2024-12-30 17:03:09 +03:00 committed by GitHub
parent 354636a35e
commit 5b18335cdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 205 additions and 56 deletions

View File

@ -18,7 +18,7 @@ local S = minetest.get_translator("nether_mobs")
-- Dragon Scale
minetest.register_node("nether_mobs:dragon_scale_block", {
description = "nether dragon scale block",
description = S("Nether Dragon Scale Block"),
tiles = {"nether_dragon_scale_block_top.png", "nether_dragon_scale_block_top.png", "nether_dragon_scale_block.png"},
paramtype = "facedir",
is_ground_content = false,
@ -33,9 +33,12 @@ stairs.register_stair_and_slab(
"nether_mobs:dragon_scale_block",
{cracky = 1, level = 3},
{"nether_dragon_scale_block.png"},
"nether dragon scale stair",
"nether dragon scale slab",
default.node_sound_stone_defaults()
S("Nether Dragon Scale Stair"),
S("Nether Dragon Scale Slab"),
default.node_sound_stone_defaults(),
true,
S("Inner Nether Dragon Scale Stair"),
S("Outer Nether Dragon Scale Stair")
)
minetest.register_craft({
@ -54,7 +57,7 @@ minetest.register_craft({
})
minetest.register_craftitem("nether_mobs:dragon_scale", {
description = "nether dragon scale",
description = S("Nether Dragon Scale"),
inventory_image = "nether_dragon_scale.png",
})
@ -77,7 +80,7 @@ minetest.register_craft({
if minetest.get_modpath("3d_armor") then
armor:register_armor("nether_mobs:dragon_helmet", {
description = S("dragon scales helmet"),
description = S("Dragon Scales Helmet"),
inventory_image = "nether_dragon_inv_helmet.png",
groups = {armor_head=1, armor_heal=15, armor_use=100, armor_fire=1},
armor_groups = {fleshy=15},
@ -86,7 +89,7 @@ if minetest.get_modpath("3d_armor") then
})
armor:register_armor("nether_mobs:dragon_chestplate", {
description = S("dragon scales chestplate"),
description = S("Dragon Scales Chestplate"),
inventory_image = "nether_dragon_inv_chestplate.png",
groups = {armor_torso=1, armor_heal=15, armor_use=100, armor_fire=1},
armor_groups = {fleshy=20},
@ -95,7 +98,7 @@ if minetest.get_modpath("3d_armor") then
})
armor:register_armor("nether_mobs:dragon_leggings", {
description = S("dragon scales leggings"),
description = S("Dragon Scales Leggings"),
inventory_image = "nether_dragon_inv_leggings.png",
groups = {armor_legs=1, armor_heal=15, armor_use=100, armor_fire=1},
armor_groups = {fleshy=20},
@ -104,7 +107,7 @@ if minetest.get_modpath("3d_armor") then
})
armor:register_armor("nether_mobs:dragon_boots", {
description = S("dragon scales boots"),
description = S("Dragon Scales Boots"),
inventory_image = "nether_dragon_inv_boots.png",
groups = {armor_feet=1, armor_heal=15, armor_use=100, armor_fire=1, physics_jump=0.5, physics_speed = 1},
armor_groups = {fleshy=15},
@ -113,7 +116,7 @@ if minetest.get_modpath("3d_armor") then
})
armor:register_armor("nether_mobs:dragon_shield", {
description = S("dragon scales shield"),
description = S("Dragon Scales Shield"),
inventory_image = "nether_dragon_inven_shield.png",
groups = {armor_shield=1, armor_heal=15, armor_use=100, armor_fire=2},
armor_groups = {fleshy=20},
@ -172,7 +175,7 @@ end
-- Dragon Fire
minetest.register_node("nether_mobs:dragon_fire", {
description = "nether dragon fire",
description = S("Nether Dragon Fire"),
drawtype = "firelike",
tiles = {{
name = "nether_dragon_fire_animated.png",
@ -200,7 +203,7 @@ minetest.register_node("nether_mobs:dragon_fire", {
})
minetest.register_node(":nether_mobs:permanent_dragon_fire", { --only avaible in creative mode
description = "Permanent nether dragon fire",
description = S("Permanent Nether Dragon Fire"),
drawtype = "firelike",
tiles = {{
name = "nether_dragon_fire_animated.png",
@ -577,34 +580,35 @@ self.saddle = true
})
if not nethermobs.custom_spawn then
mobs:spawn({
name = "nether_mobs:dragon",
nodes = {"nether:rack","nether:rack_deep"},
neighbours = "air",
max_light = 14, --not in bright daylight
max_height = nethermobs.MAX_HEIGHT_DRAGON,
min_height = nethermobs.MIN_HEIGHT_DRAGON,
interval = 100,
chance = 64000,
day_toggle = nil,
active_object_count = 2,
on_spawn = function(self, pos)
pos.y = pos.y + 0.5
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
pos.y = pos.y + 0.25
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
end,
})
end
mobs:spawn({
name = "nether_mobs:dragon",
nodes = {"nether:rack","nether:rack_deep"},
neighbours = "air",
max_light = 14, --not in bright daylight
max_height = nethermobs.MAX_HEIGHT_DRAGON,
min_height = nethermobs.MIN_HEIGHT_DRAGON,
interval = 100,
chance = 64000,
day_toggle = nil,
active_object_count = 2,
on_spawn = function(self, pos)
pos.y = pos.y + 0.5
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
pos.y = pos.y + 0.25
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
end,
})
mobs:register_egg("nether_mobs:tamed_dragon", S("nether dragon"), "mobs_chicken_egg.png^(nether_sand.png^fire_basic_flame.png^[mask:mobs_chicken_egg_overlay.png)", 1)
mobs:register_egg("nether_mobs:dragon", S("nether dragon"), "nether_sand.png^nether_dragon_fire.png", 1)
mobs:register_egg("nether_mobs:tamed_dragon", S("Nether Tamed Dragon"), "mobs_chicken_egg.png^(nether_sand.png^fire_basic_flame.png^[mask:mobs_chicken_egg_overlay.png)", 1)
mobs:register_egg("nether_mobs:dragon", S("Nether Dragon"), "nether_sand.png^nether_dragon_fire.png", 1)
-- to spawn childs from eggs
minetest.register_craftitem("nether_mobs:dragon_egg", {
description = S("@1 (tamed)", S("nether dragon")),
description = S("@1 (tamed)", S("Nether Dragon")),
inventory_image = "mobs_chicken_egg.png^(nether_sand.png^fire_basic_flame.png^[mask:mobs_chicken_egg_overlay.png)",
groups = {spawn_egg = 2},
stack_max = 1,

View File

@ -8,10 +8,19 @@ nethermobs.DRAGON_ENABLED = true
--spawn heights - use numbers corresponding to -31000 < y < 31000 or use nether.DEPTH_CEILING and nether.FLOOR_CEILING to adapt to the position of the Nether layer
--spawn heights for the netherman
nethermobs.MAX_HEIGHT_NETHERMAN = nether.DEPTH_CEILING
nethermobs.MIN_HEIGHT_NETHERMAN = nether.FLOOR_CEILING
nethermobs.MIN_HEIGHT_NETHERMAN = nether.DEPTH_FLOOR
--spawn heights for the dragon
nethermobs.MAX_HEIGHT_DRAGON = nether.DEPTH_CEILING
nethermobs.MIN_HEIGHT_DRAGON = nether.FLOOR_CEILING
nethermobs.MIN_HEIGHT_DRAGON = nether.DEPTH_FLOOR
nethermobs.custom_spawn = false
local input = io.open(modpath .. "/spawn.lua", "r")
if input then
nethermobs.custom_spawn = true
input:close()
input = nil
end
--nethermobs.NETHERMAN_SPAWN_ONLY_IN_NETHER = true
--nethermobs.DRAGON_SPAWN_ONLY_IN_NETHER = true
@ -34,4 +43,8 @@ if nethermobs.DRAGON_ENABLED then
dofile(modpath.."/dragon.lua")
end
if nethermobs.custom_spawn then
dofile(modpath .. "/spawn.lua")
end
-- please read README.md

19
locale/nether_mobs.ru.tr Normal file
View File

@ -0,0 +1,19 @@
# textdomain: nether_mobs
Dragon Scales Helmet=Шлем из драконьей чешуи
Dragon Scales Chestplate=Нагрудник из драконьей чешуи
Dragon Scales Leggings=Штаны из драконьей чешуи
Dragon Scales Boots=Ботинки из драконьей чешуи
Dragon Scales Shield=Щит из драконьей чешуи
Nether Tamed Dragon=Прирученный дракон пустоты
Nether Dragon=Дракон пустоты
@1 (tamed)=@1 (прирученный)
Nether Man=Человек пустоты
Nether Dragon Scale Block=Блок из чешуи дракона пустоты
Nether Dragon Scale Stair=Лестница из чешуи дракона пустоты
Nether Dragon Scale Slab=Плита из чешуи дракона пустоты
Inner Nether Dragon Scale Stair=Внутренняя лестница из чешуи дракона пустоты
Outer Nether Dragon Scale Stair=Внешняя лестница из чешуи дракона пустоты
Nether Dragon Fire=Огонь дракона пустоты
Permanent Nether Dragon Fire=Вечный огонь дракона пустоты
Nether Dragon Scale=Чешуя дракона пустоты

19
locale/template.txt Normal file
View File

@ -0,0 +1,19 @@
# textdomain: nether_mobs
Dragon Scales Helmet=
Dragon Scales Chestplate=
Dragon Scales Leggings=
Dragon Scales Boots=
Dragon Scales Shield=
Nether Tamed Dragon=
Nether Dragon=
@1 (tamed)=
Nether Man=
Nether Dragon Scale Block=
Nether Dragon Scale Stair=
Nether Dragon Scale Slab=
Inner Nether Dragon Scale Stair=
Outer Nether Dragon Scale Stair=
Nether Dragon Fire=
Permanent Nether Dragon Fire=
Nether Dragon Scale=

View File

@ -77,27 +77,27 @@ mobs:register_mob("nether_mobs:netherman", {
end,
})
if not nethermobs.custom_spawn then
mobs:spawn({
max_light = 12, --15 = bright daylight
name = "nether_mobs:netherman",
nodes = {"nether:sand","nether:rack","nether:rack_deep"},
max_height = nethermobs.MAX_HEIGHT_NETHERMAN,
min_height = nethermobs.MIN_HEIGHT_NETHERMAN,
interval = 8,
chance = 50,
day_toggle = nil,
active_object_count = 5,
on_spawn = function(self, pos)
pos.y = pos.y + 0.5
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
pos.y = pos.y + 0.25
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
end,
})
end
mobs:spawn({
max_light = 12, --15 = bright daylight
name = "nether_mobs:netherman",
nodes = {"nether:sand","nether:rack","nether:rack_deep"},
max_height = nethermobs.MAX_HEIGHT_NETHERMAN,
min_height = nethermobs.MIN_HEIGHT_NETHERMAN,
interval = 8,
chance = 50,
day_toggle = nil,
active_object_count = 5,
on_spawn = function(self, pos)
pos.y = pos.y + 0.5
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
pos.y = pos.y + 0.25
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
end,
})
mobs:register_egg("nether_mobs:netherman", S("nether man"), "nether_sand.png", 1)
mobs:register_egg("nether_mobs:netherman", S("Nether Man"), "nether_sand.png", 1)
mobs:alias_mob("mobs:netherman", "nether_mobs:netherman") -- compatibility

94
spawn_example.lua Normal file
View File

@ -0,0 +1,94 @@
--[[ Spawn Template, defaults to values shown if line not provided
mobs:spawn({
name = "",
- Name of mob, must be provided e.g. "mymod:my_mob"
nodes = {"group:soil, "group:stone"},
- Nodes to spawn on top of.
neighbors = {"air"},
- Nodes to spawn beside.
min_light = 0,
- Minimum light level.
max_light = 15,
- Maximum light level, 15 is sunlight only.
interval = 30,
- Spawn interval in seconds.
chance = 5000,
- Spawn chance, 1 in every 5000 nodes.
active_object_count = 1,
- Active mobs of this type in area.
min_height = -31000,
- Minimum height level.
max_height = 31000,
- Maximum height level.
day_toggle = nil,
- Daytime toggle, true to spawn during day, false for night, nil for both
on_spawn = nil,
- On spawn function to run when mob spawns in world
on_map_load = nil,
- On map load, when true mob only spawns in newly generated map areas
})
]]--
mobs:spawn({
name = "nether_mobs:dragon",
nodes = {"nether:rack","nether:rack_deep"},
neighbours = "air",
max_light = 14,
max_height = -5000,
min_height = -11000,
interval = 100,
chance = 64000,
day_toggle = nil,
active_object_count = 2,
on_spawn = function(self, pos)
pos.y = pos.y + 0.5
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
pos.y = pos.y + 0.25
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
end,
})
mobs:spawn({
max_light = 12,
name = "nether_mobs:netherman",
nodes = {"nether:sand","nether:rack","nether:rack_deep"},
max_height = -5000,
min_height = -11000,
interval = 8,
chance = 50,
day_toggle = nil,
active_object_count = 5,
on_spawn = function(self, pos)
pos.y = pos.y + 0.5
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
pos.y = pos.y + 0.25
mobs:effect(pos, 30, "nether_particle.png", 0.1, 2, 3, 5)
end,
})