New translation system, part 5: Items, part 1
This commit is contained in:
parent
0cc038c545
commit
342202c979
9 changed files with 153 additions and 138 deletions
|
@ -1,3 +1,4 @@
|
|||
local S = minetest.get_translator("mcl_beds")
|
||||
|
||||
local reverse = true
|
||||
|
||||
|
@ -32,17 +33,17 @@ local function kick_player_after_destruct(destruct_pos)
|
|||
end
|
||||
end
|
||||
|
||||
local beddesc = "Beds allow you to sleep at night and make the time pass faster."
|
||||
local beduse = "To use a bed, stand close to it and right-click the bed to sleep in it. Sleeping only works when the sun sets, at night or during a thunderstorm. The bed must also be clear of any danger."
|
||||
local beddesc = S("Beds allow you to sleep at night and make the time pass faster.")
|
||||
local beduse = S("To use a bed, stand close to it and right-click the bed to sleep in it. Sleeping only works when the sun sets, at night or during a thunderstorm. The bed must also be clear of any danger.")
|
||||
if minetest.settings:get_bool("enable_bed_respawn") == false then
|
||||
beddesc = beddesc .. "\n" .. "In local folklore, legends are told of other worlds where setting the start point for your next life would be possible. But this world is not one of them."
|
||||
beddesc = beddesc .. "\n" .. S("In local folklore, legends are told of other worlds where setting the start point for your next life would be possible. But this world is not one of them.")
|
||||
else
|
||||
beddesc = beddesc .. "\n" .. "By using a bed, you set the starting point for your next life. If you die, you will start your next life at this bed, unless it is obstructed or destroyed."
|
||||
beddesc = beddesc .. "\n" .. S("By using a bed, you set the starting point for your next life. If you die, you will start your next life at this bed, unless it is obstructed or destroyed.")
|
||||
end
|
||||
if minetest.settings:get_bool("enable_bed_night_skip") == false then
|
||||
beddesc = beddesc .. "\n" .. "In this strange world, going to bed won't skip the night, but you can skip thunderstorms."
|
||||
beddesc = beddesc .. "\n" .. S("In this strange world, going to bed won't skip the night, but you can skip thunderstorms.")
|
||||
else
|
||||
beddesc = beddesc .. "\n" .. "Sleeping allows you to skip the night. The night is skipped when all players in this world went to sleep. The night is skipped after sleeping for a few seconds. Thunderstorms can be skipped in the same manner."
|
||||
beddesc = beddesc .. "\n" .. S("Sleeping allows you to skip the night. The night is skipped when all players in this world went to sleep. The night is skipped after sleeping for a few seconds. Thunderstorms can be skipped in the same manner.")
|
||||
end
|
||||
|
||||
local default_sounds
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
-- 3D bed
|
||||
local S = minetest.get_translator("mcl_beds")
|
||||
|
||||
local nodebox = {
|
||||
bottom = {
|
||||
|
@ -15,22 +15,22 @@ local nodebox = {
|
|||
|
||||
local colors = {
|
||||
-- { ID, decription, wool, dye }
|
||||
{ "red", "Red Bed", "mcl_wool:red", "mcl_dye:red" },
|
||||
{ "blue", "Blue Bed", "mcl_wool:blue", "mcl_dye:blue" },
|
||||
{ "cyan", "Cyan Bed", "mcl_wool:cyan", "mcl_dye:cyan" },
|
||||
{ "grey", "Grey Bed", "mcl_wool:grey", "mcl_dye:dark_grey" },
|
||||
{ "silver", "Light Grey Bed", "mcl_wool:silver", "mcl_dye:grey" },
|
||||
{ "black", "Black Bed", "mcl_wool:black", "mcl_dye:black" },
|
||||
{ "yellow", "Yellow Bed", "mcl_wool:yellow", "mcl_dye:yellow" },
|
||||
{ "green", "Green Bed", "mcl_wool:green", "mcl_dye:dark_green" },
|
||||
{ "magenta", "Magenta Bed", "mcl_wool:magenta", "mcl_dye:magenta" },
|
||||
{ "orange", "Orange Bed", "mcl_wool:orange", "mcl_dye:orange" },
|
||||
{ "purple", "Purple Bed", "mcl_wool:purple", "mcl_dye:violet" },
|
||||
{ "brown", "Brown Bed", "mcl_wool:brown", "mcl_dye:brown" },
|
||||
{ "pink", "Pink Bed", "mcl_wool:pink", "mcl_dye:pink" },
|
||||
{ "lime", "Lime Bed", "mcl_wool:lime", "mcl_dye:green" },
|
||||
{ "light_blue", "Light Blue Bed", "mcl_wool:light_blue", "mcl_dye:lightblue" },
|
||||
{ "white", "White Bed", "mcl_wool:white", "mcl_dye:white" },
|
||||
{ "red", S("Red Bed"), "mcl_wool:red", "mcl_dye:red" },
|
||||
{ "blue", S("Blue Bed"), "mcl_wool:blue", "mcl_dye:blue" },
|
||||
{ "cyan", S("Cyan Bed"), "mcl_wool:cyan", "mcl_dye:cyan" },
|
||||
{ "grey", S("Grey Bed"), "mcl_wool:grey", "mcl_dye:dark_grey" },
|
||||
{ "silver", S("Light Grey Bed"), "mcl_wool:silver", "mcl_dye:grey" },
|
||||
{ "black", S("Black Bed"), "mcl_wool:black", "mcl_dye:black" },
|
||||
{ "yellow", S("Yellow Bed"), "mcl_wool:yellow", "mcl_dye:yellow" },
|
||||
{ "green", S("Green Bed"), "mcl_wool:green", "mcl_dye:dark_green" },
|
||||
{ "magenta", S("Magenta Bed"), "mcl_wool:magenta", "mcl_dye:magenta" },
|
||||
{ "orange", S("Orange Bed"), "mcl_wool:orange", "mcl_dye:orange" },
|
||||
{ "purple", S("Purple Bed"), "mcl_wool:purple", "mcl_dye:violet" },
|
||||
{ "brown", S("Brown Bed"), "mcl_wool:brown", "mcl_dye:brown" },
|
||||
{ "pink", S("Pink Bed"), "mcl_wool:pink", "mcl_dye:pink" },
|
||||
{ "lime", S("Lime Bed"), "mcl_wool:lime", "mcl_dye:green" },
|
||||
{ "light_blue", S("Light Blue Bed"), "mcl_wool:light_blue", "mcl_dye:lightblue" },
|
||||
{ "white", S("White Bed"), "mcl_wool:white", "mcl_dye:white" },
|
||||
}
|
||||
|
||||
for c=1, #colors do
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
local S = minetest.get_translator("mcl_beds")
|
||||
|
||||
local pi = math.pi
|
||||
local player_in_bed = 0
|
||||
local is_sp = minetest.is_singleplayer()
|
||||
|
@ -67,20 +69,20 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||
if bed_pos then
|
||||
-- No sleeping if too far away
|
||||
if vector.distance(bed_pos, pos) > 2 then
|
||||
minetest.chat_send_player(name, "You can't sleep, the bed's too far away!")
|
||||
minetest.chat_send_player(name, S("You can't sleep, the bed's too far away!"))
|
||||
return false
|
||||
end
|
||||
|
||||
for _, other_pos in pairs(mcl_beds.bed_pos) do
|
||||
if vector.distance(bed_pos, other_pos) < 0.1 then
|
||||
minetest.chat_send_player(name, "This bed is already occupied!")
|
||||
minetest.chat_send_player(name, S("This bed is already occupied!"))
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- No sleeping while moving. Slightly different behaviour than in MC.
|
||||
if vector.length(player:get_player_velocity()) > 0.001 then
|
||||
minetest.chat_send_player(name, "You have to stop moving before going to bed!")
|
||||
minetest.chat_send_player(name, S("You have to stop moving before going to bed!"))
|
||||
return false
|
||||
end
|
||||
|
||||
|
@ -96,7 +98,7 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||
-- Approximation of monster detection range
|
||||
if def._cmi_is_mob and ((mobname ~= "mobs_mc:pigman" and def.type == "monster" and not monster_exceptions[mobname]) or (mobname == "mobs_mc:pigman" and ent.state == "attack")) then
|
||||
if math.abs(bed_pos.y - obj:get_pos().y) <= 5 then
|
||||
minetest.chat_send_player(name, "You can't sleep now, monsters are nearby!")
|
||||
minetest.chat_send_player(name, S("You can't sleep now, monsters are nearby!"))
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
@ -143,10 +145,10 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||
local def1 = minetest.registered_nodes[n1.name]
|
||||
local def2 = minetest.registered_nodes[n2.name]
|
||||
if def1.walkable or def2.walkable then
|
||||
minetest.chat_send_player(name, "You can't sleep, the bed is obstructed!")
|
||||
minetest.chat_send_player(name, S("You can't sleep, the bed is obstructed!"))
|
||||
return false
|
||||
elseif (def1.damage_per_second ~= nil and def1.damage_per_second > 0) or (def2.damage_per_second ~= nil and def2.damage_per_second > 0) then
|
||||
minetest.chat_send_player(name, "It's too dangerous to sleep here!")
|
||||
minetest.chat_send_player(name, S("It's too dangerous to sleep here!"))
|
||||
return false
|
||||
end
|
||||
|
||||
|
@ -162,14 +164,14 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||
-- Values taken from Minecraft Wiki with offset of +6000
|
||||
if tod < 18541 and tod > 5458 and (not weather_mod or (mcl_weather.get_weather() ~= "thunder")) then
|
||||
if spawn_changed then
|
||||
minetest.chat_send_player(name, "New respawn position set! But you can only sleep at night or during a thunderstorm.")
|
||||
minetest.chat_send_player(name, S("New respawn position set! But you can only sleep at night or during a thunderstorm."))
|
||||
else
|
||||
minetest.chat_send_player(name, "You can only sleep at night or during a thunderstorm.")
|
||||
minetest.chat_send_player(name, S("You can only sleep at night or during a thunderstorm."))
|
||||
end
|
||||
return false
|
||||
end
|
||||
if spawn_changed then
|
||||
minetest.chat_send_player(name, "New respawn position set!")
|
||||
minetest.chat_send_player(name, S("New respawn position set!"))
|
||||
end
|
||||
|
||||
mcl_beds.player[name] = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue