add translation support, add mineclone support

This commit is contained in:
tenplus1 2024-09-05 10:02:22 +01:00
parent 004bc2d3a1
commit fbc18ee7a5
5 changed files with 62 additions and 27 deletions

View File

@ -1,6 +1,8 @@
-- Green Slimes by TomasJLuis & TenPlus1
local S = minetest.get_translator("mobs_slimes")
-- sounds
local green_sounds = {
@ -137,16 +139,28 @@ mobs:register_mob("mobs_slimes:greenbig", {
-- spawn eggs
mobs:register_egg("mobs_slimes:greensmall", "Small Green Slime", "green_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:greenmedium", "Medium Green Slime", "green_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:greenbig", "Big Green Slime", "green_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:greensmall", S("Small Green Slime"), "green_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:greenmedium", S("Medium Green Slime"), "green_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:greenbig", S("Big Green Slime"), "green_slime_egg.png", 1)
-- choose spawn medium depending on [game]
local nod_dirt = "default:dirt_with_rainforest_litter"
local nod_grass = "default:junglegrass"
local nod_mossy = "default:mossycobble"
if minetest.get_modpath("mcl_core") then
nod_dirt = "mcl_core:dirt_with_grass"
nod_grass = "mcl_flowers:tallgrass"
nod_mossy = "mcl_core:mossycobble"
end
-- spawn in world
mobs:spawn({
name = "mobs_slimes:greensmall",
nodes = {"default:junglegrass"},
neighbors = {"air", "default:junglegrass"},
nodes = {nod_dirt},
neighbors = {"air", nod_grass},
min_light = 4,
chance = 5000,
min_height = 0,
@ -155,8 +169,8 @@ mobs:spawn({
mobs:spawn({
name = "mobs_slimes:greenmedium",
nodes = {"default:junglegrass"},
neighbors = {"air", "default:junglegrass"},
nodes = {nod_dirt},
neighbors = {"air", nod_grass},
min_light = 4,
chance = 10000,
min_height = 0,
@ -165,8 +179,8 @@ mobs:spawn({
mobs:spawn({
name = "mobs_slimes:greenbig",
nodes = {"default:junglegrass"},
neighbors = {"air", "default:junglegrass"},
nodes = {nod_dirt},
neighbors = {"air", nod_grass},
min_light = 4,
chance = 15000,
min_height = 0,
@ -175,7 +189,7 @@ mobs:spawn({
mobs:spawn({
name = "mobs_slimes:greensmall",
nodes = {"default:mossycobble"},
nodes = {nod_mossy},
min_light = 4,
chance = 10000,
min_height = 0,
@ -184,7 +198,7 @@ mobs:spawn({
mobs:spawn({
name = "mobs_slimes:greenmedium",
nodes = {"default:mossycobble"},
nodes = {nod_mossy},
min_light = 4,
chance = 10000,
min_height = 0,

View File

@ -2,9 +2,10 @@
-- Slimes by TomasJLuis
-- Migration to Mobs Redo API by TenPlus1
-- get path
-- get path and translator
local path = minetest.get_modpath("mobs_slimes")
local S = minetest.get_translator("mobs_slimes")
-- load mod files
@ -16,7 +17,7 @@ if not minetest.get_modpath("mesecons_materials") then
minetest.register_craftitem(":mesecons_materials:glue", {
image = "jeija_glue.png",
description="Glue",
description = S("Glue")
})
end

View File

@ -1,13 +1,15 @@
-- Lava Slimes by TomasJLuis & TenPlus1
local S = minetest.get_translator("mobs_slimes")
-- sounds
local lava_sounds = {
damage = "slimes_damage",
death = "slimes_death",
jump = "slimes_jump",
attack = "slimes_attack",
attack = "slimes_attack"
}
-- lava slime textures
@ -17,6 +19,16 @@ local lava_textures = {
"lava_slime_sides.png", "lava_slime_front.png", "lava_slime_sides.png"
}
-- choose spawn medium depending on [game]
local nod_lava_source = "default:lava_source"
local nod_lava_flow = "default:lava_flowing"
if minetest.get_modpath("mcl_core") then
nod_lava_source = "mcl_core:lava_source"
nod_lava_flow = "mcl_core:lava_flowing"
end
-- small lava slime
mobs:register_mob("mobs_slimes:lavasmall", {
@ -50,7 +62,7 @@ mobs:register_mob("mobs_slimes:lavasmall", {
replace_rate = 20,
replace_what = {"air"},
replace_with = "fire:basic_flame",
fly_in = {"default:lava_source", "default:lava_flowing"},
fly_in = {nod_lava_source, nod_lava_flow},
glow = 10
})
@ -84,7 +96,7 @@ mobs:register_mob("mobs_slimes:lavamedium", {
replace_rate = 20,
replace_what = {"air"},
replace_with = "fire:basic_flame",
fly_in = {"default:lava_source", "default:lava_flowing"},
fly_in = {nod_lava_source, nod_lava_flow},
glow = 10,
on_die = function(self, pos)
@ -133,7 +145,7 @@ mobs:register_mob("mobs_slimes:lavabig", {
replace_what = {"air"},
replace_with = "fire:basic_flame",
replace_offset = -1,
fly_in = {"default:lava_source", "default:lava_flowing"},
fly_in = {nod_lava_source, nod_lava_flow},
glow = 10,
on_die = function(self, pos)
@ -153,16 +165,16 @@ mobs:register_mob("mobs_slimes:lavabig", {
-- spawn eggs
mobs:register_egg("mobs_slimes:lavasmall", "Small Lava Slime", "lava_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:lavamedium", "Medium Lava Slime", "lava_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:lavabig", "Big Lava Slime", "lava_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:lavasmall", S("Small Lava Slime"), "lava_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:lavamedium", S("Medium Lava Slime"), "lava_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:lavabig", S("Big Lava Slime"), "lava_slime_egg.png", 1)
-- spawn in world
mobs:spawn({
name = "mobs_slimes:lavasmall",
nodes = {"default:lava_source"},
neighbors = {"default:lava_flowing"},
nodes = {nod_lava_source},
neighbors = {nod_lava_flow},
min_light = 4,
chance = 5000,
max_height = -64,
@ -171,8 +183,8 @@ mobs:spawn({
mobs:spawn({
name = "mobs_slimes:lavamedium",
nodes = {"default:lava_source"},
neighbors = {"default:lava_flowing"},
nodes = {nod_lava_source},
neighbors = {nod_lava_flow},
min_light = 4,
chance = 10000,
max_height = -64,
@ -181,8 +193,8 @@ mobs:spawn({
mobs:spawn({
name = "mobs_slimes:lavabig",
nodes = {"default:lava_source"},
neighbors = {"default:lava_flowing"},
nodes = {nod_lava_source},
neighbors = {nod_lava_flow},
min_light = 4,
chance = 15000,
max_height = -64,

8
locale/mobs_slimes.en.tr Normal file
View File

@ -0,0 +1,8 @@
# textdomain:mobs_slimes
#Glue=
#Small Green Slime=
#Medium Green Slime=
#Big Green Slime=
#Small Lava Slime=
#Medium Lava Slime=
#Big Lava Slime=

View File

@ -2,6 +2,6 @@ title = Mobs Slimes
name = mobs_slimes
description = Add green and lava slimes to your world.
depends = mobs
optional_depends = default, lucky_block, simple_dialogs, screwdriver, mcl_core
optional_depends = default, mcl_core
author = ThomasJLuis
min_minetest_version = 5.0