1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-30 13:50:23 +02:00

Merge commit '833ed776' into dev

This commit is contained in:
2023-06-04 22:13:07 +02:00
55 changed files with 461 additions and 312 deletions

View File

@ -53,19 +53,22 @@ end
default.chest.open_chests = {}
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "default:chest" then
return
end
if not player or not fields.quit then
return
end
local pn = player:get_player_name()
if not default.chest.open_chests[pn] then
if formname ~= "default:chest" then
if default.chest.open_chests[pn] then
default.chest.chest_lid_close(pn)
end
return
end
if not (fields.quit and default.chest.open_chests[pn]) then
return
end
default.chest.chest_lid_close(pn)
return true
end)
@ -129,6 +132,12 @@ function default.chest.register_chest(prefixed_name, d)
return itemstack
end
local cn = clicker:get_player_name()
if default.chest.open_chests[cn] then
default.chest.chest_lid_close(cn)
end
minetest.sound_play(def.sound_open, {gain = 0.3,
pos = pos, max_hear_distance = 10}, true)
if not default.chest.chest_lid_obstructed(pos) then
@ -136,10 +145,9 @@ function default.chest.register_chest(prefixed_name, d)
{ name = name .. "_open",
param2 = node.param2 })
end
minetest.after(0.2, minetest.show_formspec,
clicker:get_player_name(),
minetest.after(0.2, minetest.show_formspec, cn,
"default:chest", default.chest.get_chest_formspec(pos))
default.chest.open_chests[clicker:get_player_name()] = { pos = pos,
default.chest.open_chests[cn] = { pos = pos,
sound = def.sound_close, swap = name }
end
def.on_blast = function() end
@ -200,6 +208,12 @@ function default.chest.register_chest(prefixed_name, d)
return inv:is_empty("main")
end
def.on_rightclick = function(pos, node, clicker)
local cn = clicker:get_player_name()
if default.chest.open_chests[cn] then
default.chest.chest_lid_close(cn)
end
minetest.sound_play(def.sound_open, {gain = 0.3, pos = pos,
max_hear_distance = 10}, true)
if not default.chest.chest_lid_obstructed(pos) then
@ -208,9 +222,9 @@ function default.chest.register_chest(prefixed_name, d)
param2 = node.param2 })
end
minetest.after(0.2, minetest.show_formspec,
clicker:get_player_name(),
cn,
"default:chest", default.chest.get_chest_formspec(pos))
default.chest.open_chests[clicker:get_player_name()] = { pos = pos,
default.chest.open_chests[cn] = { pos = pos,
sound = def.sound_close, swap = name }
end
def.on_blast = function(pos)
@ -274,6 +288,18 @@ function default.chest.register_chest(prefixed_name, d)
end
})
end
-- close opened chests on load
minetest.register_lbm({
label = "close opened chests on load",
name = "default:close_" .. prefixed_name:gsub(":", "_") .. "_open",
nodenames = {prefixed_name .. "_open"},
run_at_every_load = true,
action = function(pos, node)
node.name = prefixed_name
minetest.swap_node(pos, node)
end
})
end
default.chest.register_chest("default:chest", {

View File

@ -148,7 +148,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
return
end
if fields.close then
if fields.quit then
book_writers[player_name] = nil
end
@ -179,6 +179,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
data.description = S("\"@1\" by @2", short_title, data.owner)
data.text = fields.text:sub(1, max_text_size)
data.text = data.text:gsub("\r\n", "\n"):gsub("\r", "\n")
data.text = data.text:gsub("[%z\1-\8\11-\31\127]", "") -- strip naughty control characters (keeps \t and \n)
data.page = 1
data.page_max = math.ceil((#data.text:gsub("[^\n]", "") + 1) / lpp)

View File

@ -162,6 +162,7 @@ Empty Bookshelf=Malplena Librobreto
Bookshelf (@1 written, @2 empty books)=Librobreto (@1 skriba(j), @2 malplena(j) libro(j))
Bookshelf=Librobreto
Text too long=Tro longa teksto
"@1"=
Wooden Sign=Ligna Signo
Steel Sign=Ŝtala Signo
Wooden Ladder=Ligna Ŝtupetaro
@ -217,4 +218,3 @@ Torch=Torĉo
##### not used anymore #####
Mese Post Light=Mesea Fosta Lampo

View File

@ -4,16 +4,16 @@ Locked Chest (owned by @1)=Peti Terkunci (milik @1)
You do not own this chest.=Anda bukan pemilik peti ini.
a locked chest=peti terkunci
Chest=Peti
Write=
Read=
Write=Tulis
Read=Baca
Title:=Judul:
Contents:=Isi:
Save=Simpan
by @1=oleh @1
Page @1 of @2=Halaman @1 dari @2
The book you were writing to mysteriously disappeared.=
The book you were writing to mysteriously disappeared.=Buku yang Anda tulis menghilang secara misterius.
"@1" by @2="@1" oleh @2
Blueberries=Blueberry
Blueberries=Bluberi
Book=Buku
Book with Text=Buku Tertulis
Bronze Ingot=Perunggu Batangan
@ -38,7 +38,7 @@ Tin Lump=Bongkahan Timah
Furnace is empty=Tungku kosong
100% (output full)=100% (keluaran penuh)
@1%=@1%
Not cookable=Tidak dapat dimasak
Not cookable=Tidak bisa dimasak
Empty=Kosong
Furnace active=Tungku nyala
Furnace inactive=Tungku mati
@ -85,7 +85,7 @@ Clay=Tanah Liat
Snow=Salju
Snow Block=Balok Salju
Ice=Es
Cave Ice=Gua Es
Cave Ice=Es Gua
Apple Tree=Pohon Apel
Apple Wood Planks=Papan Kayu Pohon Apel
Apple Tree Sapling=Anak Pohon Apel
@ -132,13 +132,13 @@ Jungle Grass=Rumput Rimba
Grass=Rumput
Savanna Grass=Rumput Sabana
Fern=Pakis
Marram Grass=Rumput Maram
Marram Grass=Rumput Pantai
Bush Stem=Batang Semak
Bush Leaves=Daun Semak
Bush Sapling=Anak Semak
Blueberry Bush Leaves with Berries=Daun Semak Blueberry Berbuah
Blueberry Bush Leaves=Daun Semak Blueberry
Blueberry Bush Sapling=Anak Semak Blueberry
Blueberry Bush Leaves with Berries=Daun Semak Bluberi Berbuah
Blueberry Bush Leaves=Daun Semak Bluberi
Blueberry Bush Sapling=Anak Semak Bluberi
Acacia Bush Stem=Batang Semak Akasia
Acacia Bush Leaves=Daun Semak Akasia
Acacia Bush Sapling=Bibit Semak Akasia
@ -147,7 +147,7 @@ Pine Bush Needles=Daun Semak Pinus
Pine Bush Sapling=Bibit Semak Pinus
Kelp=Kelp
Green Coral=Koral Hijau
Pink Coral=Koral Jambon
Pink Coral=Koral Merah Muda
Cyan Coral=Koral Sian
Brown Coral=Koral Cokelat
Orange Coral=Koral Oranye
@ -181,18 +181,18 @@ Glass=Kaca
Obsidian Glass=Kaca Obsidian
Brick Block=Balok Bata
Mese Lamp=Lampu Mese
Apple Wood Mese Post Light=
Acacia Wood Mese Post Light=
Jungle Wood Mese Post Light=
Pine Wood Mese Post Light=
Aspen Wood Mese Post Light=
Apple Wood Mese Post Light=Lampu Taman Mese Kayu Apel
Acacia Wood Mese Post Light=Lampu Taman Mese Kayu Akasia
Jungle Wood Mese Post Light=Lampu Taman Mese Kayu Rimba
Pine Wood Mese Post Light=Lampu Taman Mese Kayu Pinus
Aspen Wood Mese Post Light=Lampu Taman Mese Kayu Aspen
Cloud=Awan
Wooden Pickaxe=Gancu Kayu
Stone Pickaxe=Gancu Batu
Bronze Pickaxe=Gancu Perunggu
Steel Pickaxe=Gancu Baja
Mese Pickaxe=Gancu Mese
Diamond Pickaxe=Gancu Berlian
Wooden Pickaxe=Belencong Kayu
Stone Pickaxe=Belencong Batu
Bronze Pickaxe=Belencong Perunggu
Steel Pickaxe=Belencong Baja
Mese Pickaxe=Belencong Mese
Diamond Pickaxe=Belencong Berlian
Wooden Shovel=Sekop Kayu
Stone Shovel=Sekop Batu
Bronze Shovel=Sekop Perunggu

View File

@ -4,37 +4,37 @@ Locked Chest (owned by @1)=鍵のかかったチェスト(@1所有)
You do not own this chest.=あなたはこのチェストの所有者ではありません。
a locked chest=ロックされたチェスト
Chest=チェスト
Write=
Read=
Write=書き込む
Read=読む
Title:=題名
Contents:=内容
Save=保存
by @1=@1著
Page @1 of @2=@1 / @2 ページ
The book you were writing to mysteriously disappeared.=
The book you were writing to mysteriously disappeared.=あなたが書いていた本が、不思議なことに消えました。
"@1" by @2=@2著「@1」
Blueberries=ブルーベリー
Book=本
Book with Text=テキストが書かれた
Book with Text=記入済みの
Bronze Ingot=青銅インゴット
Clay Brick=粘土レンガ
Clay Lump=粘土の塊
Clay Lump=粘土
Coal Lump=石炭
Copper Ingot=銅インゴット
Copper Lump=銅の
Copper Lump=銅の粗鉱
Diamond=ダイヤモンド
Flint=火打ち石
Gold Ingot=金インゴット
Gold Lump=金の
Iron Lump=鉄の
Gold Lump=金の粗鉱
Iron Lump=鉄の粗鉱
Mese Crystal=メセクリスタル
Mese Crystal Fragment=メセクリスタルの破片
Obsidian Shard=黒曜石の
Obsidian Shard=黒曜石の
Paper=紙
Steel Ingot=鉄インゴット
Stick=棒
Tin Ingot=スズインゴット
Tin Lump=スズの
Tin Lump=スズの粗鉱
Furnace is empty=かまどは空です
100% (output full)=100%(フル出力)
@1%=@1%
@ -59,70 +59,70 @@ Sandstone Block=砂岩ブロック
Desert Sandstone=砂漠の砂岩
Desert Sandstone Brick=砂漠の砂岩レンガ
Desert Sandstone Block=砂漠の砂岩ブロック
Silver Sandstone=銀の砂岩
Silver Sandstone Brick=銀の砂岩レンガ
Silver Sandstone Block=銀の砂岩ブロック
Silver Sandstone=銀の砂岩
Silver Sandstone Brick=銀の砂岩レンガ
Silver Sandstone Block=銀の砂岩ブロック
Obsidian=黒曜石
Obsidian Brick=黒曜石レンガ
Obsidian Block=黒曜石ブロック
Dirt=土
Dirt with Grass=草のついた土
Dirt with Grass and Footsteps=足あとと草のついた土
Dirt with Savanna Grass=サバンナの草のついた土
Dirt with Snow=雪のついた土
Dirt with Rainforest Litter=熱帯雨林のよごれた土
Dirt with Coniferous Litter=針葉樹のよごれた土
Dirt with Grass=草に覆われた土
Dirt with Grass and Footsteps=足跡と草に覆われた土
Dirt with Savanna Grass=サバンナの草に覆われた土
Dirt with Snow=雪に覆われた土
Dirt with Rainforest Litter=熱帯雨林の落葉に覆われた土
Dirt with Coniferous Litter=針葉樹の落葉に覆われた土
Savanna Dirt=サバンナの土
Savanna Dirt with Savanna Grass=サバンナの草のついたサバンナの土
Savanna Dirt with Savanna Grass=サバンナの草に覆われたサバンナの土
Permafrost=永久凍土
Permafrost with Stones=石のついた永久凍土
Permafrost with Moss=苔のついた永久凍土
Permafrost with Stones=石に覆われた永久凍土
Permafrost with Moss=苔に覆われた永久凍土
Sand=砂
Desert Sand=砂漠の砂
Silver Sand=銀の砂
Silver Sand=銀の砂
Gravel=砂利
Clay=粘土
Snow=雪
Snow Block=雪ブロック
Ice=氷
Cave Ice=洞窟の氷
Apple Tree=リンゴの木
Apple Wood Planks=リンゴの板材
Apple Tree Sapling=リンゴの苗木
Apple Tree Leaves=リンゴの葉
Apple Tree=リンゴの
Apple Wood Planks=リンゴの木の板材
Apple Tree Sapling=リンゴの木の苗木
Apple Tree Leaves=リンゴの木の
Apple=リンゴ
Apple Marker=リンゴのマーカー
Jungle Tree=ジャングルの木
Jungle Wood Planks=ジャングルの板材
Jungle Tree=ジャングルの
Jungle Wood Planks=ジャングルの木の板材
Jungle Tree Leaves=ジャングルの木の葉
Jungle Tree Sapling=ジャングルの木の苗木
Emergent Jungle Tree Sapling=新芽のジャングルの木の苗木
Pine Tree=マツの木
Pine Wood Planks=マツの板材
Pine Needles=マツの葉
Pine Tree Sapling=マツの苗木
Acacia Tree=アカシアの木
Acacia Wood Planks=アカシアの板材
Acacia Tree Leaves=アカシアの葉
Acacia Tree Sapling=アカシアの苗木
Aspen Tree=ポプラの木
Aspen Wood Planks=ポプラの板材
Aspen Tree Leaves=ポプラの葉
Aspen Tree Sapling=ポプラの苗木
Emergent Jungle Tree Sapling=ジャングルの超高木の苗木
Pine Tree=マツの
Pine Wood Planks=マツの木の板材
Pine Needles=マツの木の
Pine Tree Sapling=マツの木の苗木
Acacia Tree=アカシアの
Acacia Wood Planks=アカシアの木の板材
Acacia Tree Leaves=アカシアの木の
Acacia Tree Sapling=アカシアの木の苗木
Aspen Tree=ポプラの
Aspen Wood Planks=ポプラの木の板材
Aspen Tree Leaves=ポプラの木の
Aspen Tree Sapling=ポプラの木の苗木
Coal Ore=石炭鉱石
Coal Block=石炭ブロック
Iron Ore=鉄鉱石
Iron Ore=鉄鉱石
Steel Block=鉄ブロック
Copper Ore=銅鉱石
Copper Ore=銅鉱石
Copper Block=銅ブロック
Tin Ore=スズ鉱石
Tin Ore=スズ鉱石
Tin Block=スズブロック
Bronze Block=青銅ブロック
Mese Ore=メセ鉱石
Mese Block=メセブロック
Gold Ore=金鉱石
Gold Ore=金鉱石
Gold Block=金ブロック
Diamond Ore=ダイヤモンド鉱石
Diamond Ore=ダイヤモンド鉱石
Diamond Block=ダイヤモンドブロック
Cactus=サボテン
Large Cactus Seedling=大きなサボテンの苗
@ -136,7 +136,7 @@ Marram Grass=マラムの草
Bush Stem=低木の幹
Bush Leaves=低木の葉
Bush Sapling=低木の苗木
Blueberry Bush Leaves with Berries=ブルーベリーの低木と実
Blueberry Bush Leaves with Berries=ブルーベリーの実った低木
Blueberry Bush Leaves=ブルーベリーの低木の葉
Blueberry Bush Sapling=ブルーベリーの低木の苗木
Acacia Bush Stem=アカシアの低木の幹
@ -153,9 +153,9 @@ Brown Coral=茶色のサンゴ
Orange Coral=橙色のサンゴ
Coral Skeleton=サンゴのしがい
Water Source=水源
Flowing Water=
River Water Source=川水源
Flowing River Water=川の水
Flowing Water=流れる水
River Water Source=川水源
Flowing River Water=流れる河川水
Lava Source=溶岩
Flowing Lava=流れる溶岩
Empty Bookshelf=空の本棚
@ -163,49 +163,49 @@ Bookshelf (@1 written, @2 empty books)=本棚(記述済み @1 冊, 未記述 @2
Bookshelf=本棚
Text too long=テキストが長すぎます
"@1"=「@1」
Wooden Sign=木の看板
Wooden Sign=木の看板
Steel Sign=鉄の看板
Wooden Ladder=木のはしご
Wooden Ladder=木のはしご
Steel Ladder=鉄のはしご
Apple Wood Fence=リンゴのフェンス
Acacia Wood Fence=アカシアのフェンス
Jungle Wood Fence=ジャングルのフェンス
Pine Wood Fence=マツのフェンス
Aspen Wood Fence=ポプラのフェンス
Apple Wood Fence Rail=リンゴのフェンスレール
Acacia Wood Fence Rail=アカシアのフェンスレール
Jungle Wood Fence Rail=ジャングルのフェンスレール
Pine Wood Fence Rail=マツのフェンスレール
Aspen Wood Fence Rail=ポプラのフェンスレール
Apple Wood Fence=リンゴのフェンス
Acacia Wood Fence=アカシアのフェンス
Jungle Wood Fence=ジャングルのフェンス
Pine Wood Fence=マツのフェンス
Aspen Wood Fence=ポプラのフェンス
Apple Wood Fence Rail=リンゴのフェンスレール
Acacia Wood Fence Rail=アカシアのフェンスレール
Jungle Wood Fence Rail=ジャングルのフェンスレール
Pine Wood Fence Rail=マツのフェンスレール
Aspen Wood Fence Rail=ポプラのフェンスレール
Glass=ガラス
Obsidian Glass=黒曜石ガラス
Obsidian Glass=黒曜石ガラス
Brick Block=レンガブロック
Mese Lamp=メセの
Apple Wood Mese Post Light=リンゴのメセ灯柱
Acacia Wood Mese Post Light=アカシアのメセ灯柱
Jungle Wood Mese Post Light=ジャングルのメセ灯柱
Pine Wood Mese Post Light=マツのメセ灯柱
Aspen Wood Mese Post Light=ポプラのメセ灯柱
Mese Lamp=メセのランプ
Apple Wood Mese Post Light=リンゴのメセ灯柱
Acacia Wood Mese Post Light=アカシアのメセ灯柱
Jungle Wood Mese Post Light=ジャングルのメセ灯柱
Pine Wood Mese Post Light=マツのメセ灯柱
Aspen Wood Mese Post Light=ポプラのメセ灯柱
Cloud=雲
Wooden Pickaxe=木のつるはし
Stone Pickaxe=石のつるはし
Bronze Pickaxe=青銅のつるはし
Steel Pickaxe=鉄のつるはし
Mese Pickaxe=メセのつるはし
Diamond Pickaxe=ダイヤモンドのつるはし
Wooden Shovel=木のシャベル
Wooden Pickaxe=木製のツルハシ
Stone Pickaxe=石のツルハシ
Bronze Pickaxe=青銅のツルハシ
Steel Pickaxe=鉄のツルハシ
Mese Pickaxe=メセのツルハシ
Diamond Pickaxe=ダイヤモンドのツルハシ
Wooden Shovel=木のシャベル
Stone Shovel=石のシャベル
Bronze Shovel=青銅のシャベル
Steel Shovel=鉄のシャベル
Mese Shovel=メセのシャベル
Diamond Shovel=ダイヤモンドのシャベル
Wooden Axe=木の斧
Wooden Axe=木の斧
Stone Axe=石の斧
Bronze Axe=青銅の斧
Steel Axe=鉄の斧
Mese Axe=メセの斧
Diamond Axe=ダイヤモンドの斧
Wooden Sword=木の剣
Wooden Sword=木の剣
Stone Sword=石の剣
Bronze Sword=青銅の剣
Steel Sword=鉄の剣

View File

@ -4,14 +4,14 @@ Locked Chest (owned by @1)=已上锁的箱子(属于@1
You do not own this chest.=这个箱子不属于你所有。
a locked chest=一个已上锁的箱子
Chest=箱子
Write=
Read=
Write=
Read=
Title:=标题:
Contents:=内容:
Save=保存
by @1=由@1
Page @1 of @2=第@1页共@2页。
The book you were writing to mysteriously disappeared.=
The book you were writing to mysteriously disappeared.=你正在写的书不知为何消失了。
"@1" by @2="@1" by @2
Blueberries=蓝莓
Book=书

View File

@ -4,14 +4,14 @@ Locked Chest (owned by @1)=已上鎖的箱子(屬於@1所有
You do not own this chest.=這個箱子不屬於你所有。
a locked chest=一個已上鎖的箱子
Chest=箱子
Write=
Read=
Write=
Read=
Title:=標題:
Contents:=內容:
Save=保存
by @1=由@1
Page @1 of @2=第@1頁共@2頁。
The book you were writing to mysteriously disappeared.=
The book you were writing to mysteriously disappeared.=你正在寫的書神秘消失了。
"@1" by @2="@1" by @2
Blueberries=藍莓
Book=書

View File

@ -2597,12 +2597,12 @@ local function register_sign(material, desc, def)
if not text then
return
end
if string.len(text) > 512 then
if #text > 512 then
minetest.chat_send_player(player_name, S("Text too long"))
return
end
default.log_player_action(sender, "wrote \"" .. text ..
"\" to the sign at", pos)
text = text:gsub("[%z-\8\11-\31\127]", "") -- strip naughty control characters (keeps \t and \n)
default.log_player_action(sender, ("wrote %q to the sign at"):format(text), pos)
local meta = minetest.get_meta(pos)
meta:set_string("text", text)