============================================================
Hxwi1Structures - 利用ガイド
============================================================

このMODはJSON設定とNBTテンプレートファイルによって
構造物を生成します。MOD自体に構造物は内蔵されていません。

============================================================
ファイルの場所
============================================================

  設定:   .minecraft/config/hxwi1structures/structure_rules.json
  オプション: .minecraft/config/hxwi1structures/mod_settings.json
  NBT:     .minecraft/config/hxwi1structures/structures/
  ガイド: .minecraft/config/hxwi1structures/readme.txt

初回起動時に自動生成:
  - mod_settings.json
  - structure_rules.json（3つのサンプルルール）
  - structures/example.nbt（石レンガの家）
  - structures/dock_example.nbt（木製の桟橋）
  - structures/forest_cabin.nbt（丸太小屋）
  - readme.txt（このファイル）

readmeの言語はゲーム言語設定に応じて自動切替されます。

============================================================
フィールド一覧
============================================================

biomes（必須）
  バイオームIDの配列。MODのバイオームも対応。
  例: "minecraft:plains", "terralith:highlands"

dimensions（任意, デフォルト: 全ディメンション）
  生成するディメンションを制限。
  バニラID: "minecraft:overworld",
           "minecraft:the_nether",
           "minecraft:the_end"

nbt_file（必須）
  config/hxwi1structures/からの相対パス。
  バニラのストラクチャーブロック形式が必要。

chance（必須）
  浮動小数 0.0~1.0。チャンクごとの生成確率。

min_y / max_y（必須）
  生成高度範囲（Y座標）。
  snap_to_surface が false の場合のみ使用。
  min_y <= max_y が必要。
  主世界: -64~319, ネザー: 0~255

snap_to_surface（任意, デフォルト: false）
  有効時は min_y/max_y を無視し地表に配置。

allowed_rotations（任意, デフォルト: [0,90,180,270]）
  許可する回転角度。0,90,180,270のみ有効。
  無効な角度は実行時に0°として処理。

max_conflict_ratio（任意, デフォルト: 0.2）
  配置の衝突許容度。0.0=完全平坦のみ、
  1.0=衝突検出をスキップ（地下構造に最適）

place_on_water（任意, デフォルト: false）
  snap_to_surface が true の場合のみ有効。
  水上への生成を許可。

dock_mode（任意, デフォルト: false）
  陸と水の境界を自動検出し向きを決定。
  桟橋や波止場に最適。

y_offset（任意, デフォルト: 0）
  整数。Y座標の垂直オフセット。
  正=上へ、負=下へ。

underwater_mode（任意, デフォルト: false）
  水中のみ生成。上方に水ブロックが必要。

clear_trees（任意, デフォルト: false）
  配置前に構造物の範囲内の原木と葉を除去。
  バニラのLOGSとLEAVESタグを使用。

loot_table（任意, デフォルト: 空）
  構造物内のコンテナに戦利品テーブルを注入。
  例: "minecraft:chests/simple_dungeon"

============================================================
ヒント
============================================================

- 森林用（自動伐採）:
    "snap_to_surface": true, "clear_trees": true
- 桟橋（自動で水面向き）:
    "dock_mode": true, "place_on_water": true
- 船（一部水没）:
    "place_on_water": true, "y_offset": -1
- 水中遺跡:
    "underwater_mode": true
- 地下ダンジョン:
    "snap_to_surface": false, "max_conflict_ratio": 1.0

============================================================
デバッグ
============================================================

mod_settings.json で "debug_logging": true に設定し、
ゲームログの [hxwi1structures] 出力を確認してください。

============================================================
NBTファイルの作成
============================================================

クリエイティブモードでストラクチャーブロックを使用:
  1. ストラクチャーブロックを設置
  2. 範囲内に構造物を建築
  3. 「SAVE」をクリック
  4. .minecraft/saves/<ワールド>/generated/<namespace>/structures/
     から .nbt ファイルをコピー
  5. config/hxwi1structures/structures/ に貼り付け

サブディレクトリも使用可能:
  structures/overworld/houses/cottage.nbt

============================================================
生成の流れ
============================================================

1. チャンク読み込み時に grid_interval をチェック
2. 対象チャンクは即座にキューに入り、世界生成をブロックしない
3. キュー内のチャンクは後続 tick で処理（最大2個/tick）
4. 各チャンクは1回のみ処理（SavedDataで永続化）
5. ルールを順にチェック、最初に成功したルールで停止
6. 各ルール: 次元→XZ位置→バイオーム→確率→Y座標
   →回転→樹木除去→衝突検出→チャンク境界→配置→戦利品

============================================================
mod_settings.json
============================================================

{
  "grid_interval": 2,
  "debug_logging": false
}

grid_interval（デフォルト: 2）
  チャンクサンプリング密度。1=100%, 2=~25%, 3=~11%, 4=~6%

debug_logging（デフォルト: false）
  DEBUGログの切り替え
