Hytsnbr10519 (トーク | 投稿記録) 細 (test) |
Hytsnbr10519 (トーク | 投稿記録) 細 (test) |
||
(同じ利用者による、間の1版が非表示) | |||
28行目: | 28行目: | ||
bedrock = '[[Bedrock Edition]]', |
bedrock = '[[Bedrock Edition]]', |
||
− | bedrock_beta = '[[Bedrock Edition 1. |
+ | bedrock_beta = '[[Bedrock Edition 1.5]]{{upcoming}}', |
-- these define which sprite, label and link to use, in the table, |
-- these define which sprite, label and link to use, in the table, |
||
209行目: | 209行目: | ||
}, |
}, |
||
}, |
}, |
||
− | poolsBedrock = { |
+ | poolsBedrock = { |
⚫ | |||
⚫ | |||
⚫ | |||
+ | ["buried-treasure-map"] = {1,1,1}, |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
poolsBedrockBeta = {} |
poolsBedrockBeta = {} |
||
}, |
}, |
||
238行目: | 256行目: | ||
}, |
}, |
||
}, |
}, |
||
− | poolsBedrock = { |
+ | poolsBedrock = { |
⚫ | |||
+ | rolls = {3,10}, |
||
+ | items = { |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | } |
||
+ | }, |
||
+ | }, |
||
poolsBedrockBeta = {} |
poolsBedrockBeta = {} |
||
}, |
}, |
||
266行目: | 304行目: | ||
}, |
}, |
||
}, |
}, |
||
− | poolsBedrock = { |
+ | poolsBedrock = { |
+ | { |
||
+ | rolls = {3,6}, |
||
+ | items = { |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | } |
||
+ | }, |
||
+ | { |
||
+ | rolls = {2,5}, |
||
+ | items = { |
||
⚫ | |||
⚫ | |||
⚫ | |||
+ | } |
||
+ | }, |
||
+ | }, |
||
poolsBedrockBeta = {} |
poolsBedrockBeta = {} |
||
}, |
}, |
||
305行目: | 362行目: | ||
}, |
}, |
||
}, |
}, |
||
− | poolsBedrock = { |
+ | poolsBedrock = { |
⚫ | |||
{ |
{ |
||
rolls = {1,1}, |
rolls = {1,1}, |
||
items = { |
items = { |
||
− | ["heart-of-the-sea"] |
+ | ["heart-of-the-sea"] = {1,1,1}, |
} |
} |
||
}, |
}, |
||
336行目: | 392行目: | ||
} |
} |
||
}, |
}, |
||
− | } |
+ | }, |
⚫ | |||
}, |
}, |
||
["underwater-ruin-big"] = { -- underwater_ruin_big.json |
["underwater-ruin-big"] = { -- underwater_ruin_big.json |
||
365行目: | 422行目: | ||
}, |
}, |
||
}, |
}, |
||
− | poolsBedrock = { |
+ | poolsBedrock = { |
+ | { |
||
+ | rolls = {2,8}, |
||
+ | items = { |
||
+ | ["coal"] = {1,4,10}, |
||
⚫ | |||
+ | ["emerald"] = {1,1,1}, |
||
+ | ["wheat"] = {2,3,10}, |
||
+ | } |
||
+ | }, |
||
+ | { |
||
+ | rolls = {1,1}, |
||
+ | items = { |
||
+ | ["golden-apple"] = {1,1,1}, |
||
+ | ["enchanted-book-rnd"] = {1,1,5}, |
||
+ | ["leather-tunic"] = {1,1,1}, |
||
+ | ["golden-helmet"] = {1,1,1}, |
||
+ | ["enchanted-fishing-rod"] = {1,1,5}, |
||
+ | ["buried-treasure-map"] = {1,1,10}, |
||
+ | } |
||
+ | }, |
||
+ | }, |
||
poolsBedrockBeta = {} |
poolsBedrockBeta = {} |
||
}, |
}, |
||
394行目: | 472行目: | ||
}, |
}, |
||
}, |
}, |
||
− | poolsBedrock = { |
+ | poolsBedrock = { |
+ | { |
||
+ | rolls = {2,8}, |
||
+ | items = { |
||
+ | ["coal"] = {1,4,10}, |
||
+ | ["stone-axe"] = {1,1,2}, |
||
+ | ["rotten-flesh"] = {1,1,5}, |
||
+ | ["emerald"] = {1,1,1}, |
||
+ | ["wheat"] = {2,3,10}, |
||
+ | } |
||
+ | }, |
||
+ | { |
||
+ | rolls = {1,1}, |
||
+ | items = { |
||
+ | ["leather-tunic"] = {1,1,1}, |
||
+ | ["golden-helmet"] = {1,1,1}, |
||
+ | ["enchanted-fishing-rod"] = {1,1,5}, |
||
+ | ["buried-treasure-map"] = {1,1,5}, |
||
+ | } |
||
+ | }, |
||
+ | }, |
||
poolsBedrockBeta = {} |
poolsBedrockBeta = {} |
||
}, |
}, |
||
482行目: | 580行目: | ||
poolsDev = {}, |
poolsDev = {}, |
||
poolsBedrock = { |
poolsBedrock = { |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
{ |
{ |
||
rolls = {2,3}, |
rolls = {2,3}, |
||
533行目: | 605行目: | ||
} |
} |
||
}, |
}, |
||
− | } |
+ | }, |
⚫ | |||
}, |
}, |
||
["stronghold-library"] = { -- stronghold_library.json |
["stronghold-library"] = { -- stronghold_library.json |
||
963行目: | 1,036行目: | ||
poolsDev = {}, |
poolsDev = {}, |
||
poolsBedrock = { |
poolsBedrock = { |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
{ |
{ |
||
rolls = {2,6}, |
rolls = {2,6}, |
||
996行目: | 1,052行目: | ||
} |
} |
||
}, |
}, |
||
− | } |
+ | }, |
⚫ | |||
}, |
}, |
||
["jungle-temple-dispenser"] = { -- jungle_temple_dispenser.json |
["jungle-temple-dispenser"] = { -- jungle_temple_dispenser.json |
||
1,473行目: | 1,530行目: | ||
local html = {} |
local html = {} |
||
− | local item_display_name = '' |
+ | local item_display_name = 'では' |
if use_they then |
if use_they then |
2018年5月25日 (金) 02:51時点における版
メンテナンス
Java Editionのリリースバージョンについてのデータは、1.20.1時点のものです。(1.20.4の確認および更新が必要です) | 20:49, June 9 2022 (UTC) |
Java Editionのスナップショットについてのデータは、23w32a時点のものです。(24w07aの確認および更新が必要です) | 18:43, 20 April 2022 (UTC) |
Bedrock Editionのリリースバージョンについてのデータは、1.19.0時点のものです。(1.20.51の確認および更新が必要です) | 20:49, June 9 2022 (UTC) |
Bedrock Editionのベータバージョンについてのデータは、beta 1.19.10.22時点のものです。(beta 1.20.70.20の確認および更新が必要です) | 20:49, June 9 2022 (UTC) |
.base の使用法 (テンプレート:LootChest)
指定されたチェストの中身の表を、それらのアイテムの入手可能性に関するさまざまな統計情報に対応するとともに生成します。
呼び出し
chestパラメータとcolumnパラメータは、いくつでも順不同に受け取ることができます。
chestパラメータが指定されなかった場合は、すべてのチェストについて表示します。これは、columnパラメータでも同様です。
{{#invoke:LootChest|base [ |<chestParam1> ... |<chestParamN> ] [ |<columnHideParam1> ... |<columnHideParamN> ] }}
chestパラメータ
bonus
buried-treasure
desert-temple ( desert )
dungeon
end-city
igloo
jungle-temple ( jungle )
jungle-temple-dispenser
mineshaft
nether-fortress ( nether, fortress )
shipwreck-map
shipwreck-supply
shipwreck-treasure
stronghold-altar ( altar )
stronghold-library ( library )
stronghold-storeroom ( storeroom )
underwater-ruin-big
underwater-ruin-small
village-blacksmith ( blacksmith )
village-two-room-house
woodland-mansion ( mansion )
columnパラメータ
chance: 1つのチェストの中に、このいずれかのアイテムを得る確率。
chests: このアイテムのいずれかを見つけるために、捜索すると予想されるチェストの数。
items: 多数のチェストを平均した、1つのチェストあたりの期待アイテム数。
stacksize: このチェストにあるアイテムのスタックの大きさ(またはスタックできないアイテムの数)。
weight: このアイテムの数値は、チェストの他のアイテムと比較した数値。
使用例
{{#invoke:LootChest|base}}
→ すべてのchestとすべてのcolumn
{{#invoke:LootChest|base|weaponsmith|jungle|bonus|chance|stacksize}}
→ 鍛冶屋とジャングルのチェストのみ、かつ「stacksize」と「chance」の列のみ
.base2 の使用法 (テンプレート:LootChestItem)
ワールドに生成されるチェストで入手できるアイテムの概要を出力します。
呼び出し
パラメータにはアイテム名を1つだけ受け取ります。
{{#invoke:LootChest|base2|<itemParam>}}
itemパラメータ
acacia-log, acacia-sapling, acacia-wood, activator-rail, apple, arrow, beetroot, beetroot-seeds, birch-log, birch-sapling, bone, book, book-and-quill, bottle-o'-enchanting, bread, brown-mushroom, bucket, buried-treasure-map, cactus, cake, carrot, chainmail-boots, chainmail-chestplate, chainmail-helmet, chainmail-leggings, coal, cocoa-beans, compass, cooked-fish, cooked-salmon, dark-oak-log, dark-oak-sapling, detector-rail, diamond, diamond-chestplate, diamond-hoe, diamond-horse-armor, disc-13, disc-cat, disc-mellohi, disc-wait, emerald, empty, empty-map, enchanted-book, enchanted-book-rnd, enchanted-book-rnd-treasure, enchanted-diamond-boots, enchanted-diamond-chestplate, enchanted-diamond-helmet, enchanted-diamond-leggings, enchanted-diamond-pickaxe, enchanted-diamond-shovel, enchanted-diamond-sword, enchanted-fishing-rod, enchanted-golden-apple, enchanted-iron-boots, enchanted-iron-chestplate, enchanted-iron-helmet, enchanted-iron-leggings, enchanted-iron-pickaxe, enchanted-iron-shovel, enchanted-iron-sword, enchanted-leather-boots, enchanted-leather-cap, enchanted-leather-pants, enchanted-leather-tunic, ender-pearl, feather, flint-and-steel, gold-ingot, gold-nugget, golden-apple, golden-chestplate, golden-helmet, golden-horse-armor, golden-sword, gunpowder, heart-of-the-sea, ink-sac, iron-boots, iron-chestplate, iron-helmet, iron-horse-armor, iron-ingot, iron-leggings, iron-nugget, iron-pickaxe, iron-sword, jungle-log, jungle-sapling, lapis-lazuli, lead, leather-tunic, melon-seeds, name-tag, nether-wart, oak-log, oak-sapling, oak-wood-planks, obsidian, paper, poisonous-potato, potato, potion-of-regeneration, potion-of-water-breathing, powered-rail, prismarine-crystals, pumpkin, pumpkin-seeds, rail, raw-salmon, redstone, rotten-flesh, saddle, sand, spider-eye, spruce-log, spruce-sapling, stick, stone-axe, stone-pickaxe, string, tnt, torch, wheat, wheat-seeds, wooden-axe, wooden-hoe, wooden-pickaxe
使用例
{{#invoke:LootChest|base2|iron-ingot}}
→
Lua エラー 1553 行目: attempt to call field 'xlink' (a nil value)
{{#invoke:LootChest|base2|emerald}}
→
Lua エラー 1553 行目: attempt to call field 'xlink' (a nil value)
.base3 の使用法 (テンプレート:LootChestItemの表)
Prints a summary of this item's availability in the various worldgen chests in the form of a table.
呼び出し
パラメータにはアイテム名を1つだけ受け取ります。
{{#invoke:LootChest|base3|<itemParam>}}
itemパラメータ
上記と同様
例
{{#invoke:LootChest|base3|emerald}}
→ スクリプトエラー: 関数「base3」は存在しません。
ソース
- データは
p
内に設定されているため、マインクラフトのルートテーブルファイルから直接引っ張ってくることができる(または直接比較することができる)。 - ここで与えられた(そしてコード中で与えられた)スタックサイズはアイテムのスタック可能サイズよりも大きくなる可能性がある(特にエンチャントされた本の場合)。しかし、ゲームが適切な数のアイテムを置くが、スタックされていないため、この事実は計算値には影響しない。
データ構造
p.items
'<item-id>' = {
- このキーはモジュール:BlockSpriteまたはモジュール:ItemSpriteで定義されたアイテム/ブロックのスプライト名と一致しなければならない。
'<sprite-type>'
item
またはblock
のいずれか。
[, id='<sprite-id>']
- これはモジュール:BlockSpriteやモジュール:ItemSpriteで定義されたスプライトを指定する際に使用する。それ以外の場合は、
item-id
で指定された名前のスプライトを使用する。
- これはモジュール:BlockSpriteやモジュール:ItemSpriteで定義されたスプライトを指定する際に使用する。それ以外の場合は、
[, link='<item-link>']
- sprite-id名とは別のページへのリンク。テンプレート:LootChestで使用する。
[, title='<item-text>']
- スプライトID名とは異なるアイテムの名前。
[, cannot_stack=false]
- これは、アイテムがスタックではなくグループで来ることを示すために使用する。テンプレート:LootChestItem で使用する。
[, plural=(false|'<custom-plural-word>')]
- 'Nether Wart' のように複数形がない場合は
false
を使用する。'Bottles o' Enchanting'のように、ベースとなる単語に's'を追加して複数形にすることができない場合は、カスタムの複数形を使用する。テンプレート:LootChestItemで使用する。
- 'Nether Wart' のように複数形がない場合は
[, preserve_case=false]
- アイテム名が
title
で指定された大文字小文字に従うべきで、'TNT'のように文の大文字小文字に従わない場合は、false
を使用する。
- アイテム名が
[, note='<note-name>']
- 表のこの項目の隣に注意書きが表示されることを示す。(注意書きは項目リストの直下に定義されている)
}
p.notes
'<note-name>' = '<note-full-text>'
p.chests[n].poolsJava[n]
p.chests[n].poolsJavaUpcoming[n]
p.chests[n].poolsBedrock[n]
p.chests[n].poolsBedrockUpcoming[n]
- rolls
{ <min-number-of-stacks>, <max-number-of-stacks> }
p.chests[n].poolsJava[n].items
p.chests[n].poolsJavaUpcoming[n].items
p.chests[n].poolsBedrock[n].items
p.chests[n].poolsBedrockUpcoming[n].items
'<item-id>' = { <min-stack-size>, <max-stack-size>, <item-weight> }
p.synonyms
'<chest-name-synonym>' = '<original-interally-valid-chest-name>'
- p.chestsで定義されているものに加えて、追加のチェスト名をパラメータとして使用できるようにする。
p.display_names
'<chest-name-given-via-parameter>' = '<name-displayed-in-single-chest-table>'
- 1つのchestパラメータが使用されている場合、テーブルの上の要約文で呼び出される名前を定義する。
p.columns
'<column-name>' = '<column-full-description>'
- columnの説明は、columnヘッダーのツールチップ、または表の上の要約文のいずれかに記載されている。
関数
ファイルの先頭に以下の機能を用意し、閲覧しやすくしている。
calc_average_amount_this_item_per_chest
- あるアイテムのチェストあたり(構造あたりではなく)の平均数(スタック数ではなく)
calc_chance_any_of_this_item_per_chest
- チェストごとに(構造ごとではなく)、あるアイテムのうち少なくとも1つのアイテムが見つかる確率。
テスト
{{#invoke:LootChest|base2_test}}
Lua エラー 1553 行目: attempt to call field 'xlink' (a nil value)
注釈
local p = {
calc_average_amount_this_item_per_pool = function(
min_stacksize, max_stacksize,
min_pool_rolls, max_pool_rolls,
item_weight, pool_total_item_weight )
local avg_stacksize = ( min_stacksize + max_stacksize ) / 2
local avg_rolls = ( min_pool_rolls + max_pool_rolls ) / 2
return avg_stacksize * avg_rolls * item_weight / pool_total_item_weight
end,
calc_chance_any_of_this_item_per_pool = function(
min_pool_rolls, max_pool_rolls,
item_weight, pool_total_item_weight )
local avg_rolls = ( min_pool_rolls + max_pool_rolls ) / 2
local relativeweight = item_weight / pool_total_item_weight
return 1 - math.pow( 1 - relativeweight, avg_rolls )
end,
dev = '[[1.13]]{{upcoming}}',
bedrock = '[[Bedrock Edition]]',
bedrock_beta = '[[Bedrock Edition 1.5]]{{upcoming}}',
-- these define which sprite, label and link to use, in the table,
-- and 'cannot_stack' and 'plural' dictate how to display the single-item summary
-- NOTE: order in this list doesn't matter.
items = {
["acacia-log"] = { "block", link="原木" },
["acacia-sapling"] = { "block", link="苗木" },
["acacia-wood"] = { "block", link="原木", title="アカシアまたはダークオークの原木", plural=false },
["activator-rail"] = { "block" },
["apple"] = { "item" },
["arrow"] = { "item" },
["beetroot"] = { "item" },
["beetroot-seeds"] = { "item", plural=false },
["birch-log"] = { "block", link="原木" },
["birch-sapling"] = { "block", link="苗木" },
["bone"] = { "item" },
["book"] = { "item" },
["book-and-quill"] = { "item", plural=false, title="本と羽根ペン" },
["bottle-o'-enchanting"] = { "item" },
["bread"] = { "item", plural=false },
["brown-mushroom"] = { "block", link="キノコ" },
["bucket"] = { "item" },
["buried-treasure-map"] = { "item", link="探検家の地図", title=" Buried treasure map " },
["cactus"] = { "block", plural=false },
["cake"] = { "block", plural=false },
["carrot"] = { "item" },
["chainmail-chestplate"] = { "item", link="防具", cannot_stack=true },
["chainmail-helmet"] = { "item", link="防具", cannot_stack=true },
["chainmail-leggings"] = { "item", link="防具", cannot_stack=true, plural=false },
["chainmail-boots"] = { "item", link="防具", cannot_stack=true, plural=false },
["cocoa-beans"] = { "item", plural=false },
["coal"] = { "item", plural=false },
["cooked-fish"] = { "item", plural=false, link="焼き魚" },
["cooked-salmon"] = { "item", plural=false, link="焼き鮭" },
["compass"] = { "item" },
["dark-oak-log"] = { "block", link="原木" },
["dark-oak-sapling"] = { "block", link="苗木" },
["detector-rail"] = { "block" },
["diamond"] = { "item" },
["diamond-chestplate"] = { "item", link="防具", cannot_stack=true },
["diamond-hoe"] = { "item", link="ダイヤのクワ", cannot_stack=true },
["diamond-horse-armor"] = { "item", link="馬鎧", cannot_stack=true, plural=false },
["disc-13"] = { "item", title="レコード(13)", link="レコード", cannot_stack=true, plural=false },
["disc-cat"] = { "item", title="レコード(Cat)", link="レコード", cannot_stack=true, plural=false },
["disc-wait"] = { "item", title="レコード(Wait)", link="レコード", cannot_stack=true, plural=false },
["disc-mellohi"] = { "item", title="レコード(Mellohi)", link="レコード", cannot_stack=true, plural=false },
["emerald"] = { "item" },
["empty-map"] = { "item", link="地図", title="白紙の地図" },
["enchanted-book"] = { "item", cannot_stack=true, note="enchant-with-levels" },
["enchanted-book-rnd"] = { "item", id='enchanted-book', title="エンチャントの本", link="エンチャントの本", cannot_stack=true, note="enchant-randomly" },
["ender-pearl"] = { "item" },
["enchanted-fishing-rod"] = { "item", title="エンチャントされた釣竿", id="fishing-rod", link="釣竿", cannot_stack=true, note="enchant-randomly" },
["enchanted-book-rnd-treasure"] = { "item", id='enchanted-book', title="エンチャントの本", link="エンチャントの本", cannot_stack=true, note="enchant-randomly-treasure" },
["enchanted-golden-apple"] = { "item", id='golden-apple', link="金のリンゴ" },
["feather"] = { "item" },
["flint-and-steel"] = { "item", cannot_stack=true, plural=false },
["golden-apple"] = { "item" },
["golden-chestplate"] = { "item", link="防具", cannot_stack=true },
["golden-helmet"] = { "item", link="防具", cannot_stack=true },
["golden-horse-armor"] = { "item", link="馬鎧", cannot_stack=true, plural=false },
["golden-sword"] = { "item", link="剣", cannot_stack=true },
["gold-ingot"] = { "item" },
["gold-nugget"] = { "item" },
["gunpowder"] = { "item", plural=false },
["heart-of-the-sea"] = { "item", plural=false, link="Heart of the Sea" },
["ink-sac"] = { "item" },
["iron-boots"] = { "item", link="防具", cannot_stack=true, plural=false },
["iron-chestplate"] = { "item", link="防具", cannot_stack=true },
["iron-helmet"] = { "item", link="防具", cannot_stack=true },
["iron-horse-armor"] = { "item", link="馬鎧", cannot_stack=true, plural=false },
["iron-ingot"] = { "item" },
["iron-leggings"] = { "item", link="防具", cannot_stack=true, plural=false },
["iron-nugget"] = { "item" },
["iron-pickaxe"] = { "item", link="ツルハシ", cannot_stack=true },
["iron-sword"] = { "item", link="剣", cannot_stack=true },
["jungle-log"] = { "block", link="原木" },
["jungle-sapling"] = { "block", link="苗木" },
["lapis-lazuli"] = { "item", plural=false },
["lead"] = { "item", plural=false },
["leather-tunic"] = { "item", link="防具", cannot_stack=true },
["melon-seeds"] = { "item", plural=false },
["name-tag"] = { "item" },
["nether-wart"] = { "item", plural=false },
["oak-sapling"] = { "block", link="苗木" },
["oak-log"] = { "block", link="原木" },
["oak-wood-planks"] = { "block", link="木材", plural=false },
["obsidian"] = { "block", plural=false },
["paper"] = { "item", plural=false },
["potato"] = { "item" },
["potion-of-regeneration"] = { "item", link="ポーション", title="再生のポーション", plural=false, preserve_case=true },
["potion-of-water-breathing"] = { "item", link="ポーション", title="水中呼吸のポーション", plural=false, preserve_case=true },
["poisonous-potato"] = { "item" },
["powered-rail"] = { "block", title="パワードレール", plural=false },
["prismarine-crystals"] = { "item", plural=false },
["pumpkin"] = { "block" },
["pumpkin-seeds"] = { "item", plural=false },
["rail"] = { "block", title="レール", plural=false },
["redstone"] = { "item", plural=false },
["rotten-flesh"] = { "item", plural=false },
["sand"] = { "block", plural=false },
["saddle"] = { "item", cannot_stack=true },
["raw-salmon"] = { "item", plural=false },
["spider-eye"] = { "item" },
["spruce-log"] = { "block", link="原木" },
["spruce-sapling"] = { "block", link="苗木" },
["stick"] = { "item" },
["stone-axe"] = { "item", link="斧", cannot_stack=true },
["stone-pickaxe"] = { "item", link="ツルハシ", cannot_stack=true },
["string"] = { "item", plural=false },
["tnt"] = { "block", title="TNT", plural=false, preserve_case=true },
["torch"] = { "block" },
["wheat"] = { "item", plural=false },
["wheat-seeds"] = { "item", plural=false },
["wooden-axe"] = { "item", link="斧", cannot_stack=true },
["wooden-hoe"] = { "item", link="クワ", cannot_stack=true },
["wooden-pickaxe"] = { "item", link="ツルハシ", cannot_stack=true },
["enchanted-leather-cap"] = { "item", title="エンチャントされた革の帽子", id="leather-cap", link="防具", note="enchant-randomly", cannot_stack=true },
["enchanted-leather-tunic"] = { "item", title="エンチャントされた革の上着", id="leather-tunic", link="防具", note="enchant-randomly", cannot_stack=true },
["enchanted-leather-pants"] = { "item", title="エンチャントされた革のズボン", id="leather-pants", link="防具", note="enchant-randomly", cannot_stack=true, plural=false },
["enchanted-leather-boots"] = { "item", title="エンチャントされた革のブーツ", id="leather-boots", link="防具", note="enchant-randomly", cannot_stack=true, plural=false },
["enchanted-diamond-boots"] = { "item", title="エンチャントされたダイヤのブーツ", id="diamond-boots", link="ダイヤのブーツ", note="enchant-with-levels-20-39", cannot_stack=true, plural=false },
["enchanted-diamond-chestplate"] = { "item", title="エンチャントされたダイヤのチェストプレート", id="diamond-chestplate", link="ダイヤのチェストプレート", note="enchant-with-levels-20-39", cannot_stack=true },
["enchanted-diamond-helmet"] = { "item", title="エンチャントされたダイヤのヘルメット", id="diamond-helmet", link="ダイヤのヘルメット", note="enchant-with-levels-20-39", cannot_stack=true },
["enchanted-diamond-leggings"] = { "item", title="エンチャントされたダイヤのレギンス", id="diamond-leggings", link="ダイヤのレギンス", note="enchant-with-levels-20-39", cannot_stack=true, plural=false },
["enchanted-diamond-pickaxe"] = { "item", title="エンチャントされたダイヤのツルハシ", id="diamond-pickaxe", link="ダイヤのツルハシ", note="enchant-with-levels-20-39", cannot_stack=true },
["enchanted-diamond-shovel"] = { "item", title="エンチャントされたダイヤのシャベル", id="diamond-shovel", link="ダイヤのシャベル", note="enchant-with-levels-20-39", cannot_stack=true },
["enchanted-diamond-sword"] = { "item", title="エンチャントされたダイヤの剣", id="diamond-sword", link="ダイヤの剣", note="enchant-with-levels-20-39", cannot_stack=true },
["enchanted-iron-boots"] = { "item", title="エンチャントされた鉄のブーツ", id="iron-boots", link="鉄のブーツ", note="enchant-with-levels-20-39", cannot_stack=true, plural=false },
["enchanted-iron-chestplate"] = { "item", title="エンチャントされた鉄のチェストプレート", id="iron-chestplate", link="鉄のチェストプレート", note="enchant-with-levels-20-39", cannot_stack=true },
["enchanted-iron-helmet"] = { "item", title="エンチャントされた鉄のヘルメット", id="iron-helmet", link="鉄のヘルメット", note="enchant-with-levels-20-39", cannot_stack=true },
["enchanted-iron-leggings"] = { "item", title="エンチャントされた鉄のレギンス", id="iron-leggings", link="鉄のレギンス", note="enchant-with-levels-20-39", cannot_stack=true, plural=false },
["enchanted-iron-pickaxe"] = { "item", title="エンチャントされた鉄のツルハシ", id="iron-pickaxe", link="鉄のツルハシ", note="enchant-with-levels-20-39", cannot_stack=true },
["enchanted-iron-shovel"] = { "item", title="エンチャントされた鉄のシャベル", id="iron-shovel", link="鉄のシャベル", note="enchant-with-levels-20-39", cannot_stack=true },
["enchanted-iron-sword"] = { "item", title="エンチャントされた鉄の剣", id="iron-sword", link="鉄の剣", note="enchant-with-levels-20-39", cannot_stack=true },
["empty"] = { "block", id="air", link='', title="なし", plural=false, note="nothing" },
},
notes = {
["enchant-with-levels"] = "<ref group='注釈' name='enchant-with-levels'>エンチャントの確率は[[エンチャントテーブル]]でレベル30のエンチャントをした時と同じで、[[宝のエンチャント]]が付く場合があり、エンチャントが複数される確率は減少していない。</ref>",
["enchant-with-levels-20-39"] = "<ref group='注釈' name='enchant-with-levels-20-39'>エンチャントの確率はレベル30の上限を持たない[[エンチャントテーブル]]でレベル20からレベル39の[[エンチャントの仕組み|エンチャント]]をした時と同じで、[[宝のエンチャント]]が付く場合があり、エンチャントが複数される確率は減少していない。</ref>",
["enchant-randomly"] = "<ref group='注釈' name='enchant-randomly'>全てのエンチャントの付与される確率は同じであり、[[宝のエンチャント]]を除いてエンチャントのレベルは等しくなる。</ref>",
["enchant-randomly-treasure"] = "<ref group='注釈' name='enchant-randomly-treasure'>全てのエンチャントの付与される確率は同じであり、[[宝のエンチャント]]を含む全てのエンチャントのレベルは等しくなる。</ref>",
["nothing"] = "<ref group='注釈' name='nothing'>「なし」はチェストが空だということではなく、ランダムな戦利品の生成が行われない可能性があることを指す。</ref>",
},
-- NOTE: order here doesn't matter.
-- * in the table, chests will sort in alphabetical order
-- * in the table, items will sort by chance, then by avg#, then alphabetically.
-- * If poolsDev is omitted, pools will be used. To omit a pool entirely in the dev version, set poolsDev = {}.
chests = {
["shipwreck-map"] = { -- shipwreck_map.json
header = "Map",
superheader = "[[Shipwreck]]",
link = " [[Shipwreck]] map ",
pools = {},
poolsDev = {
{
rolls = {1,1},
items = {
["buried-treasure-map"] = {1,1,1},
}
},
{
rolls = {3,3},
items = {
["compass"] = {1,1,1},
["empty-map"] = {1,1,1},
["clock"] = {1,1,1},
["paper"] = {1,10,20},
["feather"] = {1,5,10},
["book"] = {1,5,5},
}
},
},
poolsBedrock = {
{
rolls = {1,1},
items = {
["buried-treasure-map"] = {1,1,1},
}
},
{
rolls = {3,3},
items = {
["compass"] = {1,1,1},
["empty-map"] = {1,1,1},
["clock"] = {1,1,1},
["paper"] = {1,10,20},
["feather"] = {1,5,10},
["book"] = {1,5,5},
}
},
},
poolsBedrockBeta = {}
},
["shipwreck-supply"] = { -- shipwreck_supply.json
header = "Supply",
superheader = "[[Shipwreck]]",
link = " [[Shipwreck]] supply ",
pools = {},
poolsDev = {
{
rolls = {3,10},
items = {
["paper"] = {1,12,8},
["potato"] = {2,6,7},
["poisonous-potato"] = {2,6,7},
["carrot"] = {4,8,7},
["wheat"] = {8,21,7},
["coal"] = {2,8,6},
["rotten-flesh"] = {5,24,5},
["pumpkin"] = {1,3,2},
["gunpowder"] = {1,5,3},
["tnt"] = {1,2,1},
["enchanted-leather-cap"] = {1,1,3},
["enchanted-leather-tunic"] = {1,1,3},
["enchanted-leather-pants"] = {1,1,3},
["enchanted-leather-boots"] = {1,1,3},
}
},
},
poolsBedrock = {
{
rolls = {3,10},
items = {
["paper"] = {1,12,8},
["potato"] = {2,6,7},
["poisonous-potato"] = {2,6,7},
["carrot"] = {4,8,7},
["wheat"] = {8,21,7},
["coal"] = {2,8,6},
["rotten-flesh"] = {5,24,5},
["pumpkin"] = {1,3,2},
["gunpowder"] = {1,5,3},
["tnt"] = {1,2,1},
["enchanted-leather-cap"] = {1,1,3},
["enchanted-leather-tunic"] = {1,1,3},
["enchanted-leather-pants"] = {1,1,3},
["enchanted-leather-boots"] = {1,1,3},
}
},
},
poolsBedrockBeta = {}
},
["shipwreck-treasure"] = { -- shipwreck_treasure.json
header = "Treasure",
superheader = "[[Shipwreck]]",
link = " [[Shipwreck]] treasure ",
pools = {},
poolsDev = {
{
rolls = {3,6},
items = {
["iron-ingot"] = {1,5,90},
["gold-ingot"] = {1,5,10},
["emerald"] = {1,5,40},
["diamond"] = {1,1,5},
["bottle-o'-enchanting"] = {1,1,5},
}
},
{
rolls = {2,5},
items = {
["iron-nugget"] = {1,10,50},
["gold-nugget"] = {1,10,10},
["lapis-lazuli"] = {1,10,20},
}
},
},
poolsBedrock = {
{
rolls = {3,6},
items = {
["iron-ingot"] = {1,5,90},
["gold-ingot"] = {1,5,10},
["emerald"] = {1,5,40},
["diamond"] = {1,1,5},
["bottle-o'-enchanting"] = {1,1,5},
}
},
{
rolls = {2,5},
items = {
["iron-nugget"] = {1,10,50},
["gold-nugget"] = {1,10,10},
["lapis-lazuli"] = {1,10,20},
}
},
},
poolsBedrockBeta = {}
},
["buried-treasure"] = { -- buried_treasure.json
header = "[[Buried treasure]]",
link = " [[Buried treasure]] ",
pools = {},
poolsDev = {
{
rolls = {5,8},
items = {
["iron-ingot"] = {1,4,20},
["gold-ingot"] = {1,4,10},
["tnt"] = {1,2,5},
}
},
{
rolls = {1,3},
items = {
["emerald"] = {4,8,5},
["diamond"] = {1,2,5},
["prismarine-crystals"] = {1,5,5},
}
},
{
rolls = {0,1},
items = {
["leather-tunic"] = {1,1,1},
["iron-sword"] = {1,1,1},
}
},
{
rolls = {2,2},
items = {
["cooked-fish"] = {2,4,1},
["cooked-salmon"] = {2,4,1},
}
},
},
poolsBedrock = {
{
rolls = {1,1},
items = {
["heart-of-the-sea"] = {1,1,1},
}
},
{
rolls = {5,12},
items = {
["prismarine-crystals"] = {1,5,5},
["iron-ingot"] = {3,5,20},
["gold-ingot"] = {1,5,10},
["tnt"] = {1,2,10},
["diamond"] = {1,1,15},
["disc-wait"] = {1,1,5},
["disc-mellohi"] = {1,1,5},
["name-tag"] = {1,1,10},
["chainmail-chestplate"] = {1,1,20},
["chainmail-helmet"] = {1,1,20},
["chainmail-leggings"] = {1,1,20},
["chainmail-boots"] = {1,1,20},
["book-and-quill"] = {1,2,5},
["lead"] = {1,3,10},
["bottle-o'-enchanting"] = {1,1,3},
["potion-of-water-breathing"] = {1,1,15},
["potion-of-regeneration"] = {1,1,10},
["cake"] = {1,1,1},
}
},
},
poolsBedrockBeta = {}
},
["underwater-ruin-big"] = { -- underwater_ruin_big.json
header = "Big",
superheader = "[[Underwater ruins]]",
link = " big [[Underwater ruins]] ",
pools = {},
poolsDev = {
{
rolls = {2,8},
items = {
["coal"] = {1,4,10},
["gold-nugget"] = {1,3,10},
["emerald"] = {1,1,1},
["wheat"] = {2,3,10},
}
},
{
rolls = {1,1},
items = {
["golden-apple"] = {1,1,1},
["enchanted-book-rnd"] = {1,1,5},
["leather-tunic"] = {1,1,1},
["golden-helmet"] = {1,1,1},
["enchanted-fishing-rod"] = {1,1,5},
["buried-treasure-map"] = {1,1,10},
}
},
},
poolsBedrock = {
{
rolls = {2,8},
items = {
["coal"] = {1,4,10},
["gold-nugget"] = {1,3,10},
["emerald"] = {1,1,1},
["wheat"] = {2,3,10},
}
},
{
rolls = {1,1},
items = {
["golden-apple"] = {1,1,1},
["enchanted-book-rnd"] = {1,1,5},
["leather-tunic"] = {1,1,1},
["golden-helmet"] = {1,1,1},
["enchanted-fishing-rod"] = {1,1,5},
["buried-treasure-map"] = {1,1,10},
}
},
},
poolsBedrockBeta = {}
},
["underwater-ruin-small"] = { -- underwater_ruin_small.json
header = "Small",
superheader = "[[Underwater ruins]]",
link = " small [[Underwater ruins]] ",
pools = {},
poolsDev = {
{
rolls = {2,8},
items = {
["coal"] = {1,4,10},
["stone-axe"] = {1,1,2},
["rotten-flesh"] = {1,1,5},
["emerald"] = {1,1,1},
["wheat"] = {2,3,10},
}
},
{
rolls = {1,1},
items = {
["leather-tunic"] = {1,1,1},
["golden-helmet"] = {1,1,1},
["enchanted-fishing-rod"] = {1,1,5},
["buried-treasure-map"] = {1,1,5},
}
},
},
poolsBedrock = {
{
rolls = {2,8},
items = {
["coal"] = {1,4,10},
["stone-axe"] = {1,1,2},
["rotten-flesh"] = {1,1,5},
["emerald"] = {1,1,1},
["wheat"] = {2,3,10},
}
},
{
rolls = {1,1},
items = {
["leather-tunic"] = {1,1,1},
["golden-helmet"] = {1,1,1},
["enchanted-fishing-rod"] = {1,1,5},
["buried-treasure-map"] = {1,1,5},
}
},
},
poolsBedrockBeta = {}
},
["village-blacksmith"] = { -- village_blacksmith.json
header = "鍛冶屋",
superheader = "[[村]]",
link = "[[村]]の鍛冶屋",
pools = {
{
rolls = {3,8},
items = {
["diamond"] = {1,3,3},
["iron-ingot"] = {1,5,10},
["gold-ingot"] = {1,3,5},
["bread"] = {1,3,15},
["apple"] = {1,3,15},
["iron-pickaxe"] = {1,1,5},
["iron-sword"] = {1,1,5},
["iron-chestplate"] = {1,1,5},
["iron-helmet"] = {1,1,5},
["iron-leggings"] = {1,1,5},
["iron-boots"] = {1,1,5},
["obsidian"] = {3,7,5},
["oak-sapling"] = {3,7,5},
["iron-horse-armor"] = {1,1,1},
["golden-horse-armor"] = {1,1,1},
["diamond-horse-armor"] = {1,1,1},
["saddle"] = {1,1,3}
}
},
},
poolsDev = {},
poolsBedrock = {},
poolsBedrockBeta = {}
},
["village-two-room-house"] = { -- village_two_room_house.json
header = "2つの部屋の家",
superheader = "[[村]]",
link = "[[村]]の2つの部屋の家",
pools = {},
poolsDev = {},
poolsBedrock = {
{
rolls = {6,8},
items = {
["potato"] = {5,8,10},
["carrot"] = {4,8,10},
["wheat"] = {8,12,15},
["wheat-seeds"] = {2,4,5},
["beetroot"] = {5,8,5},
["wooden-hoe"] = {1,1,1}
}
},
},
poolsBedrockBeta = {}
},
["stronghold-altar"] = { -- stronghold_corridor.json
header = "祭壇",
superheader = "[[要塞]]",
link = "[[要塞]]の祭壇",
pools = {
{
rolls = {2,3},
items = {
["ender-pearl"] = {1,1,10},
["diamond"] = {1,3,3},
["iron-ingot"] = {1,5,10},
["gold-ingot"] = {1,3,5},
["redstone"] = {4,9,5},
["bread"] = {1,3,15},
["apple"] = {1,3,15},
["iron-pickaxe"] = {1,1,5},
["iron-sword"] = {1,1,5},
["iron-chestplate"] = {1,1,5},
["iron-helmet"] = {1,1,5},
["iron-leggings"] = {1,1,5},
["iron-boots"] = {1,1,5},
["golden-apple"] = {1,1,1},
["saddle"] = {1,1,1},
["iron-horse-armor"] = {1,1,1},
["golden-horse-armor"] = {1,1,1},
["diamond-horse-armor"] = {1,1,1},
["enchanted-book"] = {1,1,1},
}
},
},
poolsDev = {},
poolsBedrock = {
{
rolls = {2,3},
items = {
["ender-pearl"] = {1,1,50},
["emerald"] = {1,3,15},
["diamond"] = {1,3,15},
["iron-ingot"] = {1,5,50},
["gold-ingot"] = {1,3,25},
["redstone"] = {4,9,25},
["bread"] = {1,3,75},
["apple"] = {1,3,75},
["iron-pickaxe"] = {1,1,25},
["iron-sword"] = {1,1,25},
["iron-chestplate"] = {1,1,25},
["iron-helmet"] = {1,1,25},
["iron-leggings"] = {1,1,25},
["iron-boots"] = {1,1,25},
["golden-apple"] = {1,1,5},
["saddle"] = {1,1,5},
["iron-horse-armor"] = {1,1,5},
["golden-horse-armor"] = {1,1,5},
["diamond-horse-armor"] = {1,1,5},
["enchanted-book"] = {1,1,6},
}
},
},
poolsBedrockBeta = {}
},
["stronghold-library"] = { -- stronghold_library.json
header = "図書室",
superheader = "[[要塞]]",
link = "[[要塞]]の図書室",
pools = {
{
rolls = {2,10},
items = {
["book"] = {1,3,20},
["paper"] = {2,7,20},
["empty-map"] = {1,1,1},
["compass"] = {1,1,1},
["enchanted-book"] = {1,1,10},
}
},
},
poolsDev = {},
poolsBedrock = {
{
rolls = {2,10},
items = {
["book"] = {1,3,100},
["paper"] = {2,7,100},
["empty-map"] = {1,1,5},
["compass"] = {1,1,5},
["enchanted-book"] = {1,1,60},
}
},
},
poolsBedrockBeta = {}
},
["stronghold-storeroom"] = { -- stronghold_crossing.json
header = "倉庫",
superheader = "[[要塞]]",
link = "[[要塞]]の倉庫",
pools = {
{
rolls = {1,4},
items = {
["iron-ingot"] = {1,5,10},
["gold-ingot"] = {1,3,5},
["redstone"] = {4,9,5},
["coal"] = {3,8,10},
["bread"] = {1,3,15},
["apple"] = {1,3,15},
["iron-pickaxe"] = {1,1,1},
["enchanted-book"] = {1,1,1},
}
},
},
poolsDev = {},
poolsBedrock = {
{
rolls = {1,4},
items = {
["iron-ingot"] = {1,5,50},
["gold-ingot"] = {1,3,25},
["redstone"] = {4,9,25},
["coal"] = {3,8,50},
["bread"] = {1,3,75},
["apple"] = {1,3,75},
["iron-pickaxe"] = {1,1,5},
["enchanted-book"] = {1,1,6},
["ink-sac"] = {1,3,75},
}
},
},
poolsBedrockBeta = {}
},
["bonus"] = { -- spawn_bonus_chest.json
chest_type = "bonus",
header = "[[ボーナスチェスト]]",
link = "[[ボーナスチェスト]]",
pools = {
{
rolls = {1,1},
items = {
["stone-axe"] = {1,1,1},
["wooden-axe"] = {1,1,3},
}
},
{
rolls = {1,1},
items = {
["stone-pickaxe"] = {1,1,1},
["wooden-pickaxe"] = {1,1,3}
}
},
{
rolls = {3,3},
items = {
["apple"] = {1,2,5},
["bread"] = {1,2,3},
["raw-salmon"] = {1,2,3},
}
},
{
rolls = {4,4},
items = {
["stick"] = {1,12,10},
["oak-planks"] = {1,12,10},
["oak-wood"] = {1,3,10},
["acacia-wood"] = {1,3,10},
}
},
},
poolsDev = {
{
rolls = {1,1},
items = {
["stone-axe"] = {1,1,1},
["wooden-axe"] = {1,1,3},
}
},
{
rolls = {1,1},
items = {
["stone-pickaxe"] = {1,1,1},
["wooden-pickaxe"] = {1,1,3}
}
},
{
rolls = {3,3},
items = {
["apple"] = {1,2,5},
["bread"] = {1,2,3},
["raw-salmon"] = {1,2,3},
}
},
{
rolls = {4,4},
items = {
["stick"] = {1,12,10},
["oak-planks"] = {1,12,10},
["oak-log"] = {1,3,3},
["spruce-log"] = {1,3,3},
["birch-log"] = {1,3,3},
["jungle-log"] = {1,3,3},
["acacia-log"] = {1,3,3},
["dark-oak-log"] = {1,3,3},
}
},
},
poolsBedrock = {
{
rolls = {1,1},
items = {
["stone-axe"] = {1,1,1},
["wooden-axe"] = {1,1,3},
}
},
{
rolls = {1,1},
items = {
["stone-pickaxe"] = {1,1,1},
["wooden-pickaxe"] = {1,1,3}
}
},
{
rolls = {1,1},
items = {
["apple"] = {1,2,1}
}
},
{
rolls = {1,1},
items = {
["bread"] = {1,2,1}
}
},
{
rolls = {1,1},
items = {
["raw-salmon"] = {1,2,1}
}
},
{
rolls = {1,1},
items = {
["stick"] = {1,12,1}
}
},
{
rolls = {1,1},
items = {
["oak-planks"] = {1,12,1}
}
},
{
rolls = {1,1},
items = {
["dark-oak-log"] = {1,3,1},
["acacia-log"] = {1,3,1},
}
},
{
rolls = {1,1},
items = {
["oak-log"] = {1,3,1},
["spruce-log"] = {1,3,1},
["birch-log"] = {1,3,1},
["jungle-log"] = {1,3,1},
}
},
{
rolls = {1,1},
items = {
["potato"] = {1,2,3},
["carrot"] = {1,2,3},
}
},
{
rolls = {1,1},
items = {
["oak-sapling"] = {4,4,2},
["spruce-sapling"] = {4,4,2},
["birch-sapling"] = {4,4,2},
["jungle-sapling"] = {4,4,2},
["dark-oak-sapling"] = {4,4,2},
["acacia-sapling"] = {4,4,2},
}
},
{
rolls = {1,1},
items = {
["melon-seeds"] = {1,2,3},
["pumpkin-seeds"] = {1,2,3},
["beetroot-seeds"] = {1,2,3},
}
},
{
rolls = {1,1},
items = {
["cactus"] = {1,2,3},
["cocoa-beans"] = {1,2,3},
}
},
{
rolls = {1,1},
items = {
["brown-mushroom"] = {1,2,2},
}
},
},
poolsBedrockBeta = {}
},
["dungeon"] = { -- simple_dungeon.json
header = "[[ダンジョン]]",
link = "[[ダンジョン]]",
pools = {
{
rolls = {1,3},
items = {
["saddle"] = {1,1,20},
["golden-apple"] = {1,1,15},
["enchanted-golden-apple"] = {1,1,2},
["disc-13"] = {1,1,15},
["disc-cat"] = {1,1,15},
["name-tag"] = {1,1,20},
["golden-horse-armor"] = {1,1,10},
["iron-horse-armor"] = {1,1,15},
["diamond-horse-armor"] = {1,1,5},
["enchanted-book-rnd"] = {1,1,10},
}
},
{
rolls = {1,4},
items = {
["iron-ingot"] = {1,4,10},
["gold-ingot"] = {1,4,5},
["bread"] = {1,1,20},
["wheat"] = {1,4,20},
["bucket"] = {1,1,10},
["redstone"] = {1,4,15},
["coal"] = {1,4,15},
["melon-seeds"] = {2,4,10},
["pumpkin-seeds"] = {2,4,10},
["beetroot-seeds"] = {2,4,10},
}
},
{
rolls = {3,3},
items = {
["bone"] = {1,8,10},
["gunpowder"] = {1,8,10},
["rotten-flesh"] = {1,8,10},
["string"] = {1,8,10},
}
},
},
poolsDev = {},
poolsBedrock = {},
poolsBedrockBeta = {}
},
["mineshaft"] = { -- abandoned_mineshaft.json
chest_type = "minecart with chest",
header = "[[廃坑]]",
link = "[[廃坑]]",
pools = {
{
rolls = {1,1},
items = {
["golden-apple"] = {1,1,20},
["enchanted-golden-apple"] = {1,1,1},
["name-tag"] = {1,1,30},
["enchanted-book-rnd"] = {1,1,10},
["iron-pickaxe"] = {1,1,5},
["empty"] = {1,1,5},
}
},
{
rolls = {2,4},
items = {
["iron-ingot"] = {1,5,10},
["gold-ingot"] = {1,3,5},
["redstone"] = {4,9,5},
["lapis-lazuli"] = {4,9,5},
["diamond"] = {1,2,3},
["coal"] = {3,8,10},
["bread"] = {1,3,15},
["melon-seeds"] = {2,4,10},
["pumpkin-seeds"] = {2,4,10},
["beetroot-seeds"] = {2,4,10},
}
},
{
rolls = {3,3},
items = {
["rail"] = {4,8,20},
["powered-rail"] = {1,4,5},
["detector-rail"] = {1,4,5},
["activator-rail"] = {1,4,5},
["torch"] = {1,16,15},
}
},
},
poolsDev = {},
poolsBedrock = {},
poolsBedrockBeta = {}
},
["nether-fortress"] = { -- nether_bridge.json
header = "[[ネザー要塞|ネザー]]<br>[[ネザー要塞|要塞]]",
link = "[[ネザー要塞]]",
pools = {
{
rolls = {2,4},
items = {
["diamond"] = {1,3,5},
["iron-ingot"] = {1,5,5},
["gold-ingot"] = {1,3,15},
["golden-sword"] = {1,1,5},
["golden-chestplate"] = {1,1,5},
["flint-and-steel"] = {1,1,5},
["nether-wart"] = {3,7,5},
["saddle"] = {1,1,10},
["golden-horse-armor"] = {1,1,8},
["iron-horse-armor"] = {1,1,5},
["diamond-horse-armor"] = {1,1,3},
["obsidian"] = {2,4,2},
}
},
},
poolsDev = {},
poolsBedrock = {},
poolsBedrockBeta = {}
},
["desert-temple"] = { -- desert_pyramid.json
header = "[[砂漠の寺院]]",
link = "[[砂漠の寺院]]",
pools = {
{
rolls = {2,4},
items = {
["diamond"] = {1,3,5},
["iron-ingot"] = {1,5,15},
["gold-ingot"] = {2,7,15},
["emerald"] = {1,3,15},
["bone"] = {4,6,25},
["spider-eye"] = {1,3,25},
["rotten-flesh"] = {3,7,25},
["saddle"] = {1,1,20},
["iron-horse-armor"] = {1,1,15},
["golden-horse-armor"] = {1,1,10},
["diamond-horse-armor"] = {1,1,5},
["enchanted-book-rnd"] = {1,1,20},
["golden-apple"] = {1,1,20},
["enchanted-golden-apple"] = {1,1,2},
["empty"] = {1,1,15},
}
},
{
rolls = {4,4},
items = {
["bone"] = {1,8,10},
["gunpowder"] = {1,8,10},
["rotten-flesh"] = {1,8,10},
["string"] = {1,8,10},
["sand"] = {1,8,10},
}
},
},
poolsDev = {},
poolsBedrock = {},
poolsBedrockBeta = {}
},
["jungle-temple"] = { -- jungle_temple.json
header = "[[ジャングルの寺院]]",
link = "[[ジャングルの寺院]]",
pools = {
{
rolls = {2,6},
items = {
["diamond"] = {1,3,3},
["iron-ingot"] = {1,5,10},
["gold-ingot"] = {2,7,15},
["emerald"] = {1,3,2},
["bone"] = {4,6,20},
["rotten-flesh"] = {3,7,16},
["saddle"] = {1,1,3},
["iron-horse-armor"] = {1,1,1},
["golden-horse-armor"] = {1,1,1},
["diamond-horse-armor"] = {1,1,1},
["enchanted-book"] = {1,1,1}
}
},
},
poolsDev = {},
poolsBedrock = {
{
rolls = {2,6},
items = {
["diamond"] = {1,3,15},
["iron-ingot"] = {1,5,50},
["gold-ingot"] = {2,7,75},
["emerald"] = {1,3,10},
["bone"] = {4,6,100},
["rotten-flesh"] = {3,7,80},
["saddle"] = {1,1,15},
["iron-horse-armor"] = {1,1,5},
["golden-horse-armor"] = {1,1,5},
["diamond-horse-armor"] = {1,1,5},
["enchanted-book"] = {1,1,6}
}
},
},
poolsBedrockBeta = {}
},
["jungle-temple-dispenser"] = { -- jungle_temple_dispenser.json
chest_type = "dispenser",
link = "[[ジャングルの寺院]]",
pools = {
{
rolls = {1,2},
items = {
["arrow"] = {2,7,30}
}
},
},
poolsDev = {},
poolsBedrock = {
{
rolls = {2,2},
items = {
["arrow"] = {2,7,30}
}
},
},
poolsBedrock = {},
poolsBedrockBeta = {}
},
["end-city"] = { -- end_city_treasure.json
header = "[[エンドシティ]]",
link = "[[エンドシティ]]",
pools = {
{
rolls = {2,6},
items = {
["diamond"] = {2,7,5},
["iron-ingot"] = {4,8,10},
["gold-ingot"] = {2,7,15},
["emerald"] = {2,6,2},
["beetroot-seeds"] = {1,10,5},
["saddle"] = {1,1,3},
["iron-horse-armor"] = {1,1,1},
["golden-horse-armor"] = {1,1,1},
["diamond-horse-armor"] = {1,1,1},
["enchanted-diamond-sword"] = {1,1,3},
["enchanted-diamond-boots"] = {1,1,3},
["enchanted-diamond-chestplate"] = {1,1,3},
["enchanted-diamond-leggings"] = {1,1,3},
["enchanted-diamond-helmet"] = {1,1,3},
["enchanted-diamond-pickaxe"] = {1,1,3},
["enchanted-diamond-shovel"] = {1,1,3},
["enchanted-iron-sword"] = {1,1,3},
["enchanted-iron-boots"] = {1,1,3},
["enchanted-iron-chestplate"] = {1,1,3},
["enchanted-iron-leggings"] = {1,1,3},
["enchanted-iron-helmet"] = {1,1,3},
["enchanted-iron-pickaxe"] = {1,1,3},
["enchanted-iron-shovel"] = {1,1,3},
}
},
},
poolsDev = {},
poolsBedrock = {},
poolsBedrockBeta = {}
},
["igloo"] = {
header = "[[イグルー]]",
link = "[[イグルー]]",
pools = {
{
rolls = {2,8},
items = {
["apple"] = {1,3,15},
["coal"] = {1,4,15},
["gold-nugget"] = {1,3,10},
["stone-axe"] = {1,1,2},
["rotten-flesh"] = {1,1,10},
["emerald"] = {1,1,1},
["wheat"] = {2,3,10}
}
},
{
rolls = {1,1},
items = {
["golden-apple"] = {1,1,1},
}
},
},
poolsDev = {},
poolsBedrock = {},
poolsBedrockBeta = {}
},
["woodland-mansion"] = { -- woodland_mansion.json
header = "[[森の洋館]]",
link = "[[森の洋館]]",
pools = {
{
rolls = {1,3},
items = {
["lead"] = {1,1,20},
["golden-apple"] = {1,1,15},
["enchanted-golden-apple"] = {1,1,2},
["disc-13"] = {1,1,15},
["disc-cat"] = {1,1,15},
["name-tag"] = {1,1,20},
["chainmail-chestplate"] = {1,1,10},
["diamond-hoe"] = {1,1,15},
["diamond-chestplate"] = {1,1,5},
["enchanted-book-rnd"] = {1,1,10},
}
},
{
rolls = {1,4},
items = {
["iron-ingot"] = {1,4,10},
["gold-ingot"] = {1,4,5},
["bread"] = {1,1,20},
["wheat"] = {1,4,20},
["bucket"] = {1,1,10},
["redstone"] = {1,4,15},
["coal"] = {1,4,15},
["melon-seeds"] = {2,4,10},
["pumpkin-seeds"] = {2,4,10},
["beetroot-seeds"] = {2,4,10},
}
},
{
rolls = {3,3},
items = {
["bone"] = {1,8,10},
["gunpowder"] = {1,8,10},
["rotten-flesh"] = {1,8,10},
["string"] = {1,8,10},
}
},
},
poolsDev = {},
poolsBedrock = {
{
rolls = {1,3},
items = {
["lead"] = {1,1,100},
["golden-apple"] = {1,1,75},
["enchanted-golden-apple"] = {1,1,10},
["disc-13"] = {1,1,75},
["disc-cat"] = {1,1,75},
["name-tag"] = {1,1,100},
["chainmail-chestplate"] = {1,1,50},
["diamond-hoe"] = {1,1,75},
["diamond-chestplate"] = {1,1,25},
["enchanted-book-rnd-treasure"] = {1,1,60},
}
},
{
rolls = {1,4},
items = {
["iron-ingot"] = {1,4,50},
["gold-ingot"] = {1,4,25},
["bread"] = {1,1,100},
["wheat"] = {1,4,100},
["bucket"] = {1,1,50},
["redstone"] = {1,4,75},
["coal"] = {1,4,75},
["melon-seeds"] = {2,4,50},
["pumpkin-seeds"] = {2,4,50},
["beetroot-seeds"] = {2,4,50},
}
},
{
rolls = {3,3},
items = {
["bone"] = {1,8,50},
["gunpowder"] = {1,8,50},
["rotten-flesh"] = {1,8,50},
["string"] = {1,8,50},
}
},
},
poolsBedrockBeta = {}
},
},
-- these values are used:
-- * in place of the keys, when the key is used as a parameter
-- chest-param -> internally-valid-chest-param
synonyms = {
["desert"] = "desert-temple",
["jungle"] = "jungle-temple",
["nether"] = "nether-fortress",
["fortress"] = "nether-fortress",
["blacksmith"] = "village-blacksmith",
["altar"] = "stronghold-altar",
["storeroom"] = "stronghold-storeroom",
["library"] = "stronghold-library",
["mansion"] = "woodland-mansion"
},
-- these values are used:
-- * in the header-description of a table showing only a single chest
-- * if the key is not here, but it is a valid chest parameter,
-- that header-description will default to use the key string from p.chests,
-- e.g. "nether-fortress"
-- chest-param -> description-string
display_names = {
["nether-fortress"] = "ネザー要塞",
["nether"] = "ネザー要塞",
["dungeon"] = "ダンジョン",
["fortress"] = "ネザー要塞",
["desert"] = "砂漠の寺院",
["jungle"] = "ジャングルの寺院",
["desert-temple"] = "砂漠の寺院",
["jungle-temple"] = "ジャングルの寺院",
["igloo"] = "イグルー",
["end-city"] = "エンドシティ",
["village-two-room-house"] = "村の2つの部屋の家",
["village-blacksmith"] = "村の鍛冶屋",
["village"] = "村の鍛冶屋",
["blacksmith"] = "村の鍛冶屋",
["stronghold-altar"] = "要塞の祭壇",
["stronghold-storeroom"] = "要塞の倉庫",
["stronghold-library"] = "要塞の図書室",
["altar"] = "要塞の祭壇",
["storeroom"] = "要塞の倉庫",
["library"] = "要塞の図書室",
["mineshaft"] = "廃坑",
["woodland-mansion"] = "森の洋館",
["jungle-temple-dispenser"] = "ジャングルの寺院のディスペンサー",
["bonus"] = "ボーナスチェスト",
-- 1.13 リリース時に翻訳
["underwater-ruin-big"] = " big Underwater ruins ",
["underwater-ruin-small"] = " small Underwater ruins ",
["shipwreck-supply"] = " Shipwreck supply ",
["shipwreck-map"] = " Shipwreck map ",
["shipwreck-treasure"] = " Shipwreck treasure ",
["buried-treasure"] = " Buried treasure "
},
-- these descriptions are used:
-- * in column <abbr> titles,
-- * and above the table when only a single column-type is chosen
columns = {
["stacksize"] = 'このチェストにあるアイテムのスタックの大きさ(またはスタックできないアイテムの数)。',
["weight"] = 'このアイテムの数値は、チェストの他のアイテムと比較した数値。',
["items"] = '多数のチェストを平均した、1つのチェストあたりの期待アイテム数。',
["chance"] = '1つのチェストの中に、このいずれかのアイテムを得る確率。',
["chests"] = 'このアイテムのいずれかを見つけるために、捜索すると予想されるチェストの数。'
},
current_frame = nil
}
p.base = function( ... )
p.current_frame = mw.getCurrentFrame()
local args = { ... }
if args[1] == p.current_frame then
args = require( 'モジュール:ProcessArgs' ).merge( true )
else
args = args[1]
end
-- transform args into usable list
local chests, columns = q.massage_args( args )
if #chests == 0 then
return "<span style='font-style:italic; color:red;'>モジュール:LootChest: 有効な引数がありません</span>"
end
q.fill_in_chest_derivative_data( chests )
-- construct an ordered list dictating the order of the rows
local ordered_item_rows = {}
local ordered_item_rows_dev = {}
local ordered_item_rows_bedrock = {}
local ordered_item_rows_bedrock_beta = {}
local ret = {}
local java_specified = args.java and args.java ~= '0';
local dev_specified = args.dev and args.dev ~= '0';
local bedrock_specified = args.bedrock and args.bedrock ~= '0';
local bedrock_beta_specified = args.bedrock_beta and args.bedrock_beta ~= '0';
local any_specified = java_specified or dev_specified or bedrock_specified or bedrock_beta_specified
if any_specified then
if java_specified then
ordered_item_rows = q.construct_ordered_item_rows( chests, '' )
end
if dev_specified then
ordered_item_rows_dev = q.construct_ordered_item_rows( chests, 'Dev' )
end
if bedrock_specified then
ordered_item_rows_bedrock = q.construct_ordered_item_rows( chests, 'Bedrock' )
end
if bedrock_beta_specified then
ordered_item_rows_bedrock_beta = q.construct_ordered_item_rows( chests, 'BedrockBeta' )
end
else
local java_excluded = args.java and args.java == '0';
local dev_excluded = args.dev and args.dev == '0';
local bedrock_excluded = args.bedrock and args.bedrock == '0';
local bedrock_beta_excluded = args.bedrock_beta and args.bedrock_beta == '0';
if not java_excluded then
ordered_item_rows = q.construct_ordered_item_rows( chests, '' )
end
if not dev_excluded then
ordered_item_rows_dev = q.construct_ordered_item_rows( chests, 'Dev' )
end
if not bedrock_excluded then
ordered_item_rows_bedrock = q.construct_ordered_item_rows( chests, 'Bedrock' )
end
if not bedrock_beta_excluded then
ordered_item_rows_bedrock_beta = q.construct_ordered_item_rows( chests, 'BedrockBeta' )
end
end
if q.tablelength( ordered_item_rows ) > 0 then
table.insert( ret, q.print_table( chests, columns, ordered_item_rows, '' ) )
end
if q.tablelength( ordered_item_rows_dev ) > 0 and q.compare_tables( ordered_item_rows, ordered_item_rows_dev ) then
table.insert( ret, p.current_frame:preprocess( p.dev ) .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_dev, 'Dev' ) ) )
end
if q.tablelength( ordered_item_rows_bedrock ) > 0 and q.compare_tables( ordered_item_rows, ordered_item_rows_bedrock ) then
table.insert( ret, p.current_frame:preprocess( p.bedrock ) .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_bedrock, 'Bedrock' ) ) .. '[[カテゴリ:Bedrock Edition限定]]' )
end
if q.tablelength( ordered_item_rows_bedrock_beta ) > 0 and q.compare_tables( ordered_item_rows, ordered_item_rows_bedrock_beta ) then
table.insert( ret, p.current_frame:preprocess( p.bedrock_beta ) .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_bedrock_beta, 'BedrockBeta' ) ) .. '[[カテゴリ:Bedrock Edition限定]]' )
end
return table.concat( ret, '\n\n' )
end
p.doc = function()
local valid_args = {}
for chest_name, val in pairs(p.chests) do
local synonyms = {}
for syn, orig in pairs(p.synonyms) do
if orig == chest_name then
table.insert( synonyms, syn )
end
end
if #synonyms > 0 then
chest_name = chest_name .. " ( " .. table.concat( synonyms, ", " ) .. " )"
end
table.insert( valid_args, chest_name )
end
table.sort( valid_args )
return table.concat( valid_args, "\n<br>" )
end
p.doc2 = function()
local valid_args = {}
for column_name, val in pairs(p.columns) do
table.insert( valid_args, column_name .. ": " .. val )
end
table.sort( valid_args )
return table.concat( valid_args, "\n<br>" )
end
p.doc3 = function()
local valid_args = {}
for item_name, val in pairs(p.items) do
table.insert( valid_args, item_name )
end
table.sort( valid_args )
return table.concat( valid_args, ", " )
end
p.base2 = function( ... )
p.current_frame = mw.getCurrentFrame()
local args = { ... }
if args[1] == p.current_frame then
args = require( 'モジュール:ProcessArgs' ).merge( true )
else
args = args[1]
end
local itemname = args[1]
if p.items[itemname] == nil then
return '<span style="color:red;">"' .. itemname .. '"は未知のアイテムです。</span>'
end
if args.java and args.java ~= '0' then
chances = q.single_item_find_values( itemname, 'pools' )
devChances = {}
bedrockChances = {}
bedrockBetaChances = {}
else
if args.dev and args.dev ~= '0' then
chances = q.single_item_find_values( itemname, 'poolsDev' )
devChances = {}
bedrockChances = {}
bedrockBetaChances = {}
else
if args.bedrock and args.bedrock ~= '0' then
chances = q.single_item_find_values( itemname, 'poolsBedrock' )
devChances = {}
bedrockChances = {}
bedrockBetaChances = {}
else
if args.bedrock_beta and args.bedrock_beta ~= '0' then
chances = q.single_item_find_values( itemname, 'poolsBedrockBeta' )
devChances = {}
bedrockChances = {}
bedrockBetaChances = {}
else
chances = q.single_item_find_values( itemname, 'pools' )
devChances = q.single_item_find_values( itemname, 'poolsDev', chances )
bedrockChances = q.single_item_find_values( itemname, 'poolsBedrock', chances )
bedrockBetaChances = q.single_item_find_values( itemname, 'poolsBedrockBeta', chances, bedrockChances )
end
end
end
end
local html = {}
local any_current = q.tablelength( chances ) > 0
local any_changes_upcoming = q.tablelength( devChances ) > 0 and q.compare_tables( chances, devChances )
local any_standard = any_current or any_changes_upcoming
local any_bedrock_current = q.tablelength( bedrockChances ) > 0
local any_bedrock_upcoming = q.tablelength( bedrockBetaChances ) > 0 and q.compare_tables( bedrockChances, bedrockBetaChances )
local any_bedrock = any_bedrock_current or any_bedrock_upcoming
local change_case = p.items[itemname].preserve_case == nil or p.items[itemname].preserve_case ~= true
if any_current then
table.insert( html, p.base2_sub( itemname, chances ) )
end
if any_changes_upcoming then
table.insert( html, p.current_frame:preprocess( p.dev ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, devChances, any_current ) ) or p.base2_sub( itemname, devChances, any_current ) ) )
end
if any_bedrock_current then
table.insert( html, ( any_standard and '\n\n' or '' ) .. p.current_frame:preprocess( p.bedrock ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, bedrockChances, any_standard ) ) or p.base2_sub( itemname, bedrockChances, any_standard ) ) )
end
if any_bedrock_upcoming then
table.insert( html, ( any_standard and not any_bedrock_current and '\n\n' or '' ) .. p.current_frame:preprocess( p.bedrock_beta ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, bedrockBetaChances, any_bedrock_current or any_standard ) ) or p.base2_sub( itemname, bedrockBetaChances, any_bedrock_current or any_standard ) ) )
end
if args.nocat then
else
table.insert( html, '[[カテゴリ:テンプレート:LootChestItemを読み込んでいるページ]]' )
if p.items[itemname].category ~= nil and p.items[itemname].category ~= false then
table.insert( html, '[[カテゴリ:Edition限定の戦利品を含むページ]]' )
end
if any_bedrock then
table.insert( html, '[[カテゴリ:Bedrock Edition限定]]' )
end
end
return table.concat( html, ' ' )
end
p.base2_sub = function( itemname, chances, use_they )
local html = {}
local item_display_name = 'では'
if use_they then
item_display_name = 'ではこれら'
else
if p.items[itemname].plural ~= nil and p.items[itemname].plural ~= false then
item_display_name = p.items[itemname].plural
else
if p.items[itemname].title ~= nil then
item_display_name = p.items[itemname].title
else
item_display_name = string.gsub( itemname, '-', ' ' )
end
-- 複数形にされるのでコメントアウト
-- if p.items[itemname].plural == nil or p.items[itemname].plural ~= false then
-- item_display_name = q.single_item_plural( item_display_name )
-- end
end
local Autolink = require( 'モジュール:Autolink' )
item_display_name = Autolink.xlink(item_display_name, 'nolink')
if p.items[itemname].preserve_case == nil or p.items[itemname].preserve_case ~= true then
item_display_name = q.capitalize( item_display_name )
end
if p.items[itemname].note and p.notes[p.items[itemname].note] then
item_display_name = item_display_name .. p.current_frame:preprocess( p.notes[p.items[itemname].note] )
end
end
table.insert( html, item_display_name )
table.insert( html, 'は、' )
local html_stacks = {}
local stack_sep = '。 '
local ns = q.tablelength( chances )
local s = 0
for stacksize, chest_details in pairs( chances ) do
s = s + 1
local html_per_stack = { '' }
local c = 0
local nc = q.tablelength( chest_details )
local sep = ( nc > 2 and '、' or'、' )
if nc > 2 and s ~= ns then
stack_sep = '。'
end
for k, chest in pairs( chest_details ) do
c = c + 1
if c == nc and nc > 1 then
table.insert( html_per_stack, '' )
end
if chest.chance == 1 then
table.insert( html_per_stack, "全て" )
else
table.insert( html_per_stack, string.format("%.1f", chest.chance*100) )
table.insert( html_per_stack, "% の確率で" )
end
if chest.chest_type == 'minecart with chest' then
table.insert( html_per_stack, p.chests[chest.chest_name].link )
table.insert( html_per_stack, 'の[[チェスト付きトロッコ]]の中に' )
elseif chest.chest_type == 'dispenser' then
table.insert( html_per_stack, p.chests[chest.chest_name].link )
table.insert( html_per_stack, 'の[[ディスペンサー]]の中に' )
elseif chest.chest_type == 'bonus' then
table.insert( html_per_stack, p.chests[chest.chest_name].link )
table.insert( html_per_stack, 'の中に' )
else
table.insert( html_per_stack, p.chests[chest.chest_name].link )
table.insert( html_per_stack, 'のチェストの中に' )
end
table.insert( html_per_stack, sep )
end
if nc > 2 then
table.insert( html_per_stack, '全て ' )
end
table.insert( html_per_stack, stacksize )
if p.items[itemname].cannot_stack ~= nil then
table.insert( html_per_stack, 'つ' )
else
table.insert( html_per_stack, '個' )
end
table.insert( html_per_stack, '生成される' )
table.insert( html_stacks, table.concat( html_per_stack ) )
end
local stackwise_summaries = ''
if #html_stacks == 1 then
table.insert( html, html_stacks[1] )
else
for i = 1, #html_stacks - 1 do
table.insert( html, html_stacks[ i ] )
table.insert( html, stack_sep )
end
table.insert( html, 'また ' )
table.insert( html, html_stacks[#html_stacks] )
end
table.insert( html, '。' )
return table.concat( html )
end
p.base2_test = function()
items = {}
for item_name, v in pairs( p.items ) do
table.insert( items, p.base2{ item_name, ["nocat"]=true } .. '\n\n' )
end
table.sort( items )
return table.concat(items)
end
q = {
tablelength = function(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end,
deepcopy = function(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[q.deepcopy(orig_key)] = q.deepcopy(orig_value)
end
setmetatable(copy, q.deepcopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end,
single_item_find_values = function( itemname, poolsKey, exclusions_param, other_exclusions_param )
local chances = {}
local exclusions = q.deepcopy(exclusions_param or {})
local other_exclusions = q.deepcopy(other_exclusions_param or {})
for stacksize, other_exclusion_list in pairs(other_exclusions) do
if exclusions[stacksize] == nil then
exclusions[stacksize] = {}
end
for _, other_exclusion in pairs(other_exclusion_list) do
local already_in_here = false
for _, exclusion in pairs(exclusions[stacksize]) do
if exclusion["chest_name"] == other_exclusion["chest_name"] and exclusion["chance"] == other_exclusion["chance"] then
already_in_here = true
break
end
end
if not already_in_here then
table.insert( exclusions[stacksize], other_exclusion )
end
end
end
for chest_name, chest in pairs( p.chests ) do
local poolchances = {}
for k, pool in pairs( chest[poolsKey] or chest.pools or {} ) do
local poolitem = pool.items[itemname]
if poolitem ~= nil then
local stacksize = poolitem[1]
if poolitem[1] ~= poolitem[2] then
stacksize = stacksize .. "~" .. poolitem[2]
end
local itemweight = poolitem[3]
local pool_total_item_weight = 0
for itemname, item in pairs(pool.items) do
pool_total_item_weight = pool_total_item_weight + item[3]
end
local chance = p.calc_chance_any_of_this_item_per_pool(
pool.rolls[1], pool.rolls[2],
itemweight, pool_total_item_weight )
if poolchances[stacksize] == nil then
poolchances[stacksize] = chance
else
poolchances[stacksize] = poolchances[stacksize] + (1 - poolchances[stacksize]) * chance
end
end
end
for stacksize, chance in pairs( poolchances ) do
local excluded = false
for _, exclusion in pairs( exclusions[stacksize] or {} ) do
if exclusion["chest_name"] == chest_name and exclusion["chance"] == chance then
excluded = true
break
end
end
if not excluded then
if chances[stacksize] == nil then
chances[stacksize] = {}
end
table.insert( chances[stacksize], { ["chance"]=chance, ["chest_name"]=chest_name, ["chest_type"]=( chest.chest_type or "chest" ) } )
end
end
end
return chances
end,
single_item_plural = function( itemname )
if string.sub( itemname, -2 ) == 'ss'
or string.sub( itemname, -2 ) == 'ch'
or string.sub( itemname, -2 ) == 'sh'
or string.sub( itemname, -1 ) == 's' then
return itemname .. 'es'
end
return itemname .. 's'
end,
massage_args = function( args )
-- find what columns to put
local columns = {}
for k, _arg in pairs(args) do
if p.columns[_arg] ~= nil then
columns[_arg] = true
end
end
if q.tablelength(columns) == 0 then
for column_name, v in pairs(p.columns) do
columns[column_name] = true
end
end
-- find what chests to show
local chests = {}
for k, _arg in pairs(args) do
if p.chests[_arg] ~= nil then
table.insert( chests, _arg )
elseif p.synonyms[_arg] ~= nil then
table.insert( chests, p.synonyms[_arg] )
end
if p.display_names[_arg] ~= nil then
local chestname = _arg
if p.chests[chestname] == nil then
chestname = p.synonyms[_arg]
end
p.chests[chestname].display_name = p.display_names[_arg]
end
end
if #chests == 0 then
for chest_name, chest in pairs(p.chests) do
local chest_type = ( chest.chest_type or "chest" )
if chest_type == "chest" or chest_type == "bonus" or chest_type == "minecart with chest" then
table.insert( chests, chest_name )
end
end
end
table.sort( chests )
return chests, columns
end,
sort_items = function( e1, e2 )
if e1.chanceany ~= e2.chanceany then return ( e1.chanceany > e2.chanceany ) end
if e1.avgamount ~= e2.avgamount then return ( e1.avgamount > e2.avgamount ) end
if e1.material == nil then
e1.material = 0
if string.find( e1.itemname, "leather" ) ~= nil then e1.material = 1 end
if string.find( e1.itemname, "iron" ) ~= nil then e1.material = 2 end
if string.find( e1.itemname, "gold" ) ~= nil then e1.material = 3 end
if string.find( e1.itemname, "diamond" ) ~= nil then e1.material = 4 end
e1.armor = 0
if string.find( e1.itemname, "helmet" ) ~= nil or string.find( e1.itemname, "cap" ) ~= nil then e1.armor = 1 end
if string.find( e1.itemname, "chestplate" ) ~= nil or string.find( e1.itemname, "tunic" ) ~= nil then e1.armor = 2 end
if string.find( e1.itemname, "leggings" ) ~= nil or string.find( e1.itemname, "pants" ) ~= nil then e1.armor = 3 end
if string.find( e1.itemname, "boots" ) ~= nil then e1.armor = 4 end
end
if e2.material == nil then
e2.material = 0
if string.find( e2.itemname, "leather" ) ~= nil then e2.material = 1 end
if string.find( e2.itemname, "iron" ) ~= nil then e2.material = 2 end
if string.find( e2.itemname, "gold" ) ~= nil then e2.material = 3 end
if string.find( e2.itemname, "diamond" ) ~= nil then e2.material = 4 end
e2.armor = 0
if string.find( e2.itemname, "helmet" ) ~= nil or string.find( e2.itemname, "cap" ) ~= nil then e2.armor = 1 end
if string.find( e2.itemname, "chestplate" ) ~= nil or string.find( e2.itemname, "tunic" ) ~= nil then e2.armor = 2 end
if string.find( e2.itemname, "leggings" ) ~= nil or string.find( e2.itemname, "pants" ) ~= nil then e2.armor = 3 end
if string.find( e2.itemname, "boots" ) ~= nil then e2.armor = 4 end
end
if e1.material ~= e2.material then return ( e1.material < e2.material ) end
if e1.armor ~= e2.armor then return ( e1.armor < e2.armor ) end
return ( e1.itemname < e2.itemname )
end,
fill_in_chest_derivative_data = function( chest_names )
for k, chest_name in pairs(chest_names) do
local chest = p.chests[chest_name]
if chest == nil then break end
chest.allRolls = {}
chest.itemData = {}
for k, pool in pairs( chest.pools or {} ) do
table.insert( chest.allRolls, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'~'..pool.rolls[2] ) )
local total_weight = 0
for itemname, item in pairs(pool.items) do
total_weight = total_weight + item[3]
end
pool.totalweight = total_weight
q.fill_in_chest_item_details( chest.itemData, pool, #chest.allRolls )
end
chest.allRollsDev = {}
chest.itemDataDev = {}
for k, pool in pairs( chest.poolsDev or chest.pools or {} ) do
table.insert( chest.allRollsDev, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'~'..pool.rolls[2] ) )
local total_weight = 0
for itemname, item in pairs(pool.items) do
total_weight = total_weight + item[3]
end
pool.totalweight = total_weight
q.fill_in_chest_item_details( chest.itemDataDev, pool, #chest.allRollsDev )
end
chest.allRollsBedrock = {}
chest.itemDataBedrock = {}
for k, pool in pairs( chest.poolsBedrock or chest.pools or {} ) do
table.insert( chest.allRollsBedrock, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )
local total_weight = 0
for itemname, item in pairs(pool.items) do
total_weight = total_weight + item[3]
end
pool.totalweight = total_weight
q.fill_in_chest_item_details( chest.itemDataBedrock, pool, #chest.allRollsBedrock )
end
chest.allRollsBedrockBeta = {}
chest.itemDataBedrockBeta = {}
for k, pool in pairs( chest.poolsBedrockBeta or chest.pools or {} ) do
table.insert( chest.allRollsBedrockBeta, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )
local total_weight = 0
for itemname, item in pairs(pool.items) do
total_weight = total_weight + item[3]
end
pool.totalweight = total_weight
q.fill_in_chest_item_details( chest.itemDataBedrockBeta, pool, #chest.allRollsBedrockBeta )
end
end
end,
fill_in_chest_item_details = function( data, pool, ct )
for item_name, item in pairs(pool.items) do
if p.items[item_name] then
local min_stacksize = item[1]
local max_stacksize = item[2]
local min_pool_rolls = pool.rolls[1]
local max_pool_rolls = pool.rolls[2]
local item_weight = item[3]
if data[item_name] == nil then
data[item_name] = {
avgamount = 0,
chanceany = 0,
itemname = item_name,
sortsize = {},
sortweight = {},
sizes = {},
weights = {},
}
for i = 1, ct-1 do
data[item_name].sortsize[i] = 0
data[item_name].sortweight[i] = 0
data[item_name].sizes[i] = '—'
data[item_name].weights[i] = '—'
end
end
data[item_name].avgamount = data[item_name].avgamount + p.calc_average_amount_this_item_per_pool(
min_stacksize, max_stacksize,
min_pool_rolls, max_pool_rolls,
item_weight, pool.totalweight )
data[item_name].chanceany = data[item_name].chanceany + (1 - data[item_name].chanceany) * p.calc_chance_any_of_this_item_per_pool(
min_pool_rolls, max_pool_rolls,
item_weight, pool.totalweight )
data[item_name].sortsize[ct] = ( min_stacksize + max_stacksize ) / 2
data[item_name].sortweight[ct] = item_weight;
data[item_name].sizes[ct] = ( min_stacksize == max_stacksize and min_stacksize or min_stacksize .. '~' .. max_stacksize )
data[item_name].weights[ct] = p.current_frame:expandTemplate{ title = 'frac', args = { item_weight, pool.totalweight } }
end
end
for item_name, d in pairs(data) do
if not d.sizes[ct] then
d.sortsize[ct] = 0
d.sortweight[ct] = 0
d.sizes[ct] = '—'
d.weights[ct] = '—'
end
end
end,
construct_ordered_items_from_first_chest = function( chest_names, suffix )
local items_from_first_table = {}
local item_chests = {}
local item_names_ordered = {}
for item_name, item in pairs( p.chests[chest_names[1]]['itemData'..suffix] ) do
table.insert( items_from_first_table, item )
end
table.sort( items_from_first_table, q.sort_items )
for k, item in pairs( items_from_first_table ) do
table.insert( item_names_ordered, item.itemname )
item_chests[item.itemname] = true
end
return item_names_ordered, item_chests
end,
get_ordered_items_from_other_chests = function( chest_names, item_chests, suffix )
local items_not_from_first_table = {}
for chest_idx = 2, #chest_names do
for item_name, item in pairs( p.chests[chest_names[chest_idx]]['itemData'..suffix] ) do
if item_chests[item_name] == nil then
p.items[item_name].itemname = item_name
table.insert( items_not_from_first_table, p.chests[chest_names[chest_idx]]['itemData'..suffix][item_name] )
item_chests[item_name] = true
end
end
end
table.sort( items_not_from_first_table, q.sort_items )
return items_not_from_first_table
end,
add_other_items_to_first_list = function( chest_names, item_names_ordered, item_chests, items_not_from_first_table )
for k, item in pairs( items_not_from_first_table ) do
table.insert( item_names_ordered, item.itemname )
end
return item_names_ordered
end,
set_up_ordered_item_rows = function( chest_names, item_names_ordered, suffix )
for k, itemname in pairs(item_names_ordered) do
item_names_ordered[k] = {itemname}
for chest_idx = 1, #chest_names do
if suffix == 'Dev' or p.chests[chest_names[chest_idx]]['pools'..suffix] ~= nil then
local item_data = p.chests[chest_names[chest_idx]]['itemData'..suffix][itemname]
if item_data == nil then
table.insert( item_names_ordered[k], false )
else
table.insert( item_names_ordered[k], item_data )
end
end
end
end
return item_names_ordered
end,
construct_ordered_item_rows = function( chest_names, suffix )
-- for the first chest, sort its by chance desc, then by avg amount desc, then alphabetically asc
local item_names_ordered, item_chests = q.construct_ordered_items_from_first_chest( chest_names, suffix )
if #chest_names > 1 then
-- after that, sort all the remaining items in list order
local items_not_from_first_table = q.get_ordered_items_from_other_chests( chest_names, item_chests, suffix )
item_names_ordered = q.add_other_items_to_first_list( chest_names, item_names_ordered, item_chests, items_not_from_first_table )
end
-- set up item_names_ordered so that each is a row, representing chest values
item_names_ordered = q.set_up_ordered_item_rows( chest_names, item_names_ordered, suffix )
return item_names_ordered
end,
print_table = function( chest_names, columns, ordered_item_rows, suffix )
local html = {}
local use_roll_row = false
local use_superheader = false
local superheader_sizes = {}
for i = 1, #chest_names do
sh = p.chests[chest_names[i]].superheader
if sh ~= nil then
if superheader_sizes[sh] == nil then
superheader_sizes[sh] = 0
end
superheader_sizes[sh] = superheader_sizes[sh] + 1
use_superheader = true
end
local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
if #allRolls > 1 then
use_roll_row = true
end
end
if columns['stacksize'] == nil and columns['weight'] == nil then
use_roll_row = false
end
local rowspan = ( #chest_names > 1 and 1 or 0 ) + ( use_superheader and 1 or 0 ) + 1
local hide_col_description = rowspan > 1 and q.tablelength(columns) == 1
if use_roll_row then
rowspan = rowspan + 1
end
if q.tablelength(columns) == 1 then
for column_name, v in pairs(columns) do
if(suffix ~= '') then
table.insert( html, " での" )
end
table.insert( html, p.columns[column_name] )
table.insert( html, "\n" )
end
end
if #chest_names == 1 then
if q.tablelength(columns) == 1 then
table.insert( html, "<br>" )
end
local chest_name = chest_names[1]
local allRolls = p.chests[chest_name]['allRolls'..suffix]
local chest_type = p.chests[chest_name].chest_type or "chest"
local display_name = p.chests[chest_name].display_name
chest_name = chest_name:gsub( "-", " " )
if(suffix ~= '') then
table.insert( html, " での" )
end
table.insert( html, display_name or chest_name )
if chest_type ~= 'chest' and chest_type ~= 'minecart with chest' then
table.insert( html, "には" )
else
table.insert( html, "のチェストには" )
end
table.insert( html, '、' )
table.insert( html, 'アイテムが ')
if #allRolls == 1 then
table.insert( html, allRolls[1] )
table.insert( html, '個生成される。' )
else
local s = ( #allRolls > 2 and '個、' or '個と' )
for i = 1, #allRolls-1 do
table.insert( html, allRolls[i] )
table.insert( html, s )
end
table.insert( html, '' )
table.insert( html, allRolls[#allRolls] )
table.insert( html, '個のスタック数で' )
table.insert( html, #allRolls )
table.insert( html, 'つのグループに分けられ生成される。' )
end
table.insert( html, "これらは以下の表のようになっている: \n" )
end
table.insert( html, '<div style="overflow:auto">\n' )
table.insert( html, "<table class='wikitable sortable jquery-tablesorter'>\n" )
table.insert( html, "<tr>\n" )
table.insert( html, "<th rowspan=" )
table.insert( html, ( rowspan - ( hide_col_description and 1 or 0 ) ) )
table.insert( html, "></th>\n" )
local superheader_cols_used = {}
if #chest_names > 1 then
local row1, row2 = {}, {}
for i = 1, #chest_names do
if suffix == 'Dev' or p.chests[chest_names[i]]['pools'..suffix] ~= nil then
local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
local colspan = q.tablelength(columns)
local allRollsSpan = #allRolls == 0 and 1 or #allRolls
if columns['stacksize'] ~= nil then
colspan = colspan - 1 + allRollsSpan
end
if columns['weight'] ~= nil then
colspan = colspan - 1 + allRollsSpan
end
local row = row1
rowspan = 1
if use_superheader then
sh = p.chests[chest_names[i]].superheader
if sh ~= nil then
if superheader_cols_used[sh] == nil then
table.insert( row, "<th colspan=" )
table.insert( row, ( colspan * superheader_sizes[sh] ) )
table.insert( row, ">" )
table.insert( row, sh )
table.insert( row, "</th>\n" )
superheader_cols_used[sh] = 0
end
row = row2
else
rowspan = rowspan + 1
end
end
if use_roll_row and hide_col_description and #allRolls < 2 then
rowspan = rowspan + 1
end
table.insert( row, "<th colspan=" )
table.insert( row, colspan )
if rowspan > 1 then
table.insert( row, " rowspan=" )
table.insert( row, rowspan )
end
table.insert( row, ">" )
table.insert( row, p.chests[ chest_names[i] ].header )
if #allRolls > 0 then
table.insert( row, ' <br><span style="font-weight:normal; font-style:italic; font-size:11px;">(' )
if #allRolls == 1 then
table.insert( row, allRolls[1] )
else
local s = ( #allRolls > 2 and '、 ' or ' ' )
for i = 1, #allRolls-1 do
table.insert( row, allRolls[i] )
table.insert( row, s )
end
table.insert( row, 'と ' )
table.insert( row, allRolls[#allRolls] )
end
table.insert( row, ' スタック)</span>' )
end
table.insert( row, "</th>\n" )
end
end
table.insert( html, table.concat( row1 ) )
table.insert( html, "</tr><tr>\n" )
if #row2 then
table.insert( html, table.concat( row2 ) )
table.insert( html, "</tr><tr>\n" )
end
end
if not hide_col_description then
local headersort_th_open
if use_roll_row then
headersort_th_open = "<th rowspan='2' class='headersort' role='columnheader button' data-sort-type='number'> <abbr title='"
else
headersort_th_open = "<th class='headersort' role='columnheader button' data-sort-type='number'> <abbr title='"
end
for i = 1, #chest_names do
if suffix == 'Dev' or p.chests[chest_names[i]]['pools'..suffix] ~= nil then
local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
local allRollsSpan = #allRolls == 0 and 1 or #allRolls
local headersort_th_colspan_open
if #allRolls > 1 then
headersort_th_colspan_open = "<th colspan='" .. allRollsSpan .. "' role='columnheader'> <abbr title='"
else
headersort_th_colspan_open = headersort_th_open
end
if columns['stacksize'] ~= nil then
table.insert( html, headersort_th_colspan_open )
table.insert( html, p.columns['stacksize'] )
table.insert( html, "'> スタック数 </abbr></th>\n" )
end
if columns['weight'] ~= nil then
table.insert( html, headersort_th_colspan_open )
table.insert( html, p.columns['weight'] )
table.insert( html, "'> 割合" )
table.insert( html, "</abbr></th>\n" )
end
if columns['items'] ~= nil then
table.insert( html, headersort_th_open )
table.insert( html, p.columns['items'] )
table.insert( html, "'> アイテム数 </abbr></th>\n" )
end
if columns['chance'] ~= nil then
table.insert( html, headersort_th_open )
table.insert( html, p.columns['chance'] )
table.insert( html, "'> 確率 </abbr></th>\n" )
end
if columns['chests'] ~= nil then
table.insert( html, headersort_th_open )
table.insert( html, p.columns['chests'] )
table.insert( html, "'> チェスト数 </abbr></th>\n" )
end
end
end
table.insert( html, "</tr><tr>\n" )
end
if use_roll_row then
local rowcols = ( columns['stacksize'] ~= nil and 1 or 0 ) + ( columns['weight'] ~= nil and 1 or 0 )
for i = 1, #chest_names do
local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
if #allRolls > 1 then
for j = 1, rowcols do
for k = 1, #allRolls do
table.insert( html, "<th class='headersort' role='columnheader button' data-sort-type='number' style='font-weight:normal'><abbr title='The chest will draw " )
table.insert( html, allRolls[k] )
table.insert( html, " stack(s) randomly from this pool.'>" )
table.insert( html, allRolls[k] )
table.insert( html, "×</abbr></th>\n" )
end
end
end
end
table.insert( html, "</tr><tr>\n" )
end
for i = 1, #ordered_item_rows do
if type( ordered_item_rows[i] ) == "table" then
for j = 1, #ordered_item_rows[i] do
local chest_item = ordered_item_rows[i][j]
if type( chest_item ) == "table" then
local avg_amount = string.format("%.3f", chest_item.avgamount)
local chance_any = string.format("%.1f", chest_item.chanceany*100) .. "%"
local num_chests = string.format("%.1f", 1/chest_item.chanceany)
table.insert( html, "\n" )
if columns['stacksize'] ~= nil then
for k = 1, #chest_item.sizes do
table.insert( html, "<td style='text-align:center;' data-sort-value='" )
table.insert( html, chest_item.sortsize[k] == 0 and "9e99" or chest_item.sortsize[k] )
table.insert( html, "'>" )
table.insert( html, chest_item.sizes[k] )
table.insert( html, "</td>" )
end
end
if columns['weight'] ~= nil then
for k = 1, #chest_item.sizes do
table.insert( html, "<td style='text-align:center;' data-sort-value='" )
table.insert( html, chest_item.sortweight[k] == 0 and "9e99" or chest_item.sortsize[k] )
table.insert( html, "'>" )
table.insert( html, chest_item.weights[k] )
table.insert( html, "</td>" )
end
end
if columns['items'] ~= nil then
table.insert( html, "<td style='text-align:center;'>" )
table.insert( html, avg_amount )
table.insert( html, "</td>" )
end
if columns['chance'] ~= nil then
table.insert( html, "<td style='text-align:right;'>" )
table.insert( html, chance_any )
table.insert( html, "</td>" )
end
if columns['chests'] ~= nil then
table.insert( html, "<td style='text-align:right;'>" )
table.insert( html, num_chests )
table.insert( html, "</td>" )
end
elseif type( chest_item ) == "boolean" then
local allRolls = p.chests[chest_names[j-1]]['allRolls'..suffix]
local allRollsSpan = #allRolls == 0 and 1 or #allRolls
table.insert( html, "\n" )
if columns['stacksize'] ~= nil then
for k = 1, allRollsSpan do
table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
end
end
if columns['weight'] ~= nil then
for k = 1, allRollsSpan do
table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
end
end
if columns['items'] ~= nil then
table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
end
if columns['chance'] ~= nil then
table.insert( html, "<td data-sort-value='9e99' style='text-align:right;'>—</td>" )
end
if columns['chests'] ~= nil then
table.insert( html, "<td data-sort-value='9e99' style='text-align:right;'>—</td>" )
end
else
if i > 1 then
table.insert( html, "</tr><tr>" )
end
local item = p.items[chest_item]
local s = require( 'モジュール:Sprite' )
table.insert( html, "\n<td>" )
local image, spriteCat = s.link{
id=item.id or chest_item,
link=item.link or string.gsub(chest_item,'-',' '),
text=item.title or q.titlecase(string.gsub(chest_item,'-',' ')),
data= ( item[1] == 'item' and 'ItemSprite' or 'BlockSprite' )
}
table.insert( html, image )
table.insert( html, spriteCat )
if item.note and p.notes[item.note] then
table.insert( html, p.current_frame:preprocess( p.notes[item.note] ) )
end
table.insert( html, "</td>" )
end
if j == #ordered_item_rows[i] then
table.insert( html, "</tr>" )
end
end
table.insert( html, "\n" )
end
end
table.insert( html, "</table></div>" )
return table.concat( html )
end,
titlecase = function( str )
local buf = {}
for word in string.gfind(str, "%S+") do
if word == "and" then
table.insert( buf, word )
else
local first, rest = string.sub( word, 1, 1 ), string.sub( word, 2 )
table.insert( buf, string.upper(first) .. string.lower(rest) )
end
end
return table.concat( buf, " " )
end,
capitalize = function( str )
return ( string.lower(str):gsub( "^%l", string.upper ) )
end,
lcfirst = function( str )
return ( string.gsub( str, "^%u", string.lower ) )
end,
compare_tables = function( a, b )
local seen = {}
for k, v in pairs( a ) do
if type( v ) ~= type( b[k] ) then
return true
end
if v ~= b[k] then
return true
end
if type( v ) == 'table' and q.compare_tables( v, b[k] ) then
return true
end
seen[k] = true
end
for k, v in pairs( b ) do
if not seen[k] then
return true
end
end
return false
end,
}
string.lpad = function(str, len, char)
if char == nil then char = ' ' end
return string.rep(char, len - #(''..str)) .. str
end
return p