User Tools

Site Tools


ja:mtr:adding_custom_resources

This is an old revision of the document!


FIXME このページはまだ完全には、翻訳されません。翻訳の完了を支援して下さい。
(翻訳が完了したらこの段落を削除して下さい)

カスタムリソースの追加

Minecraft Transit Railway Modでは、リソースパックを使用することで、以下のコンテンツをワールド内に追加することが可能である。

  • 既存(デフォルト)の列車 のテクスチャバリエーション
  • 列車 のBlockbenchモデル(BBmodel)
  • 鉄道標識 の新しいテクスチャやテキスト

なお本ガイドを進める前に、リソースパックの制作 に慣れていることを強く推奨する。

リソースパックのフォーマット

mtr_custom_resources.json では、MODに登録するカスタムコンテンツの定義を行う。これらはmtr の名前空間の下に置く必要がある。つまり、assets/mtr/mtr_custom_resources.json というファイルパスである必要がある。

既存の列車のテクスチャバリエーションを追加する

テクスチャのバリエーション(リテクスチャ)を追加するには、mtr_custom_resouces.jsoncustom_trains JSONオブジェクトを追加する必要がある。custom_trains の下にある各JSONオブジェクトは、列車のテクスチャバリエーションを表し、固有のキーといくつかの必須項目を持たなければならない。

キー データ型 説明 要否 デフォルトでの値 備考
name 文字列 ルートの列車選択時に ダッシュボード に表示される名前 必須 N/A
color 文字列 (HEXカラーコード) ルートの列車選択時にダッシュボード ダッシュボード に表示される色 任意 Black (#000000)
base_train_type 文字列 (train ID) テクスチャを適用する列車モデル 必須(bbmodelを使用しない場合) N/A See the trains page for a list of train identifiers
texture_id 文字列 (texture ID) テクスチャファイルの 名前空間付きID 必須 N/A
description 文字列 この列車に関する簡単な説明を追加可能。改行コード(\n)も使用可。 任意 N/A
wikipedia_article 文字列 英語版Wikipediaの記事の引用が可能。長すぎる場合は省略される。 任意 N/A
train_barrier_id 文字列 車両の端に列車バリアを設置する。指定がない場合は表示されない。 任意 N/A
gangway_connection_id 文字列 車両の端に貫通幌を設置する。指定がない場合はSP1900の貫通幌が表示される。 任意 mtr:textures/entity/sp1900
has_gangway_connection ブーリアン型 貫通幌を通行可能にするかを選択する。falseの場合、貫通幌は透明になり、gangway_connection_id の指定は無視される。 任意 true
door_animation_type 文字列 以下のドアアニメーションの指定が可能。大文字で記述する必要がある。

STANDARD
STANDARD_SLOW
CONSTANT
PLUG_FAST
PLUG_SLOW
BOUNCY_1
BOUNCY_2
MLR
R179
R211
任意 STANDARDCONSTANT only 32 (max) regardless of train door width.
model 文字列 BBmodelファイルのファイルパスを指定する。 必須(bbmodelを使用する場合) N/A
model_properties 文字列 Model Propertiesファイル(.json)のファイルパスを指定する。 必須(bbmodelを使用する場合) N/A
speed_sound_base_id 文字列 通常の走行音のIDの指定が可能。デフォルトの列車IDか、sounds.jsonで定義されたものを指定する。 任意 N/AIf not specified, the sound will be silent.
speed_sound_count 数列 上記のspeed_sound_base_idで指定したフォルダ内での加速または減速用oggファイルの数を指定する。正しく指定されない場合、ある速度以上で音が無音になる。 OptionalThe number of sounds specified by Train ID (if any)
door_sound_base_id 文字列 通常のドア音のIDを指定する。デフォルトの列車IDか、sounds.jsonで定義されたものを指定する。 任意 N/AIf not specified, the sound will be silent.
door_close_sound_time 数列 ドア音のオフセットを指定する。値は0以上、1以下である必要がある。 任意0.5
bve_sound_base_id 文字列 BVEサウンドのIDを指定する。デフォルトの列車IDか、sounds.jsonで定義されたものを指定する。BVEサウンドの定義方法については こちら を参照。 任意 N/AIf specified, conventional format sound will not be available.

以下に例を示す。

{
  "custom_trains": {
    "my_custom_train": {
      "name": "My Custom SP1900 Train",
      "color": "FEC5E5",
      "base_train_type": "sp1900",
      "texture_id": "mtr:custom_directory/custom_sp1900.png"
    }
  }
}

鉄道標識の新しいテクスチャやテキストの追加

鉄道標識 の新しいテクスチャやテキストを追加するには、mtr_custom_resouces.jsoncustom_trains JSONオブジェクトを追加する必要がある。custom_trains の下にある各JSONオブジェクトは、標識のテクスチャバリエーションを表し、固有のキーといくつかの必須項目を持たなければならない。

キー データ型 説明 要否
texture_id 文字列 (texture ID) テクスチャファイルの 名前空間付きID 必須
flip_texture ブーリアン型 True を指定することで、テクスチャが水平方向に反転する。 任意
custom_text 文字列 設定されている場合、画像の右側にテキストが表示される。パイプ文字\| が使用可能である。例:客務中心 | Customer Service Centre 任意
flip_custom_text ブーリアン型 custom_text が設定されており、flip_custom_texttrue の場合、画像の左側にテキストが表示される 任意
small ブーリアン型 True を指定することで、画像が余白付きで表示される。 任意
background_color 文字列 (HEXカラーコード) 背景色を指定する。 任意。指定がない場合には、黒色となる。

以下に例を示す。

{
  "custom_signs": {
    "my_custom_sign": {
      "texture_id": "mtr:custom_directory/custom_sign.png",
      "flip_texture": false,
      "custom_text": "你好|Hello",
      "flip_custom_text": false,
      "small": true,
      "background_color": "1167B1"
    }
  }
} 

Model Properties file

This section is currently unwritten.

The Model Properties file can be edited by the Resource Pack Creator or directly in a text editor, for example.

basis

Key Data Type Description Notes
transport_mode String The following transport type can be specified. Must be written in CAPITAL LETTERS.

TRAIN
AIRPLAIN
CABLECAR
FERRY
Required
length Number Specifies the length of the car body. Required
width Number Specifies the width of the car body. Required
door_max String Specifies the door opening/closing width. If it is set to CONSTANT, the description is ignored. Required
Key Data Type Description Notes
name String Specify the parts folder of BBmodel. Specifying a folder without a single cube may cause Minecraft to crash.Required
stage String The following model attributes can be specified. Must be written in CAPITAL LETTERS.

EXTERIOR
INTERIOR
LIGHTS
ALWAYS_ON_LIGHTS
INTERIOR_TRANSLUCENT
Required
mirror Boolean Flip the model 180 degrees on the y-axis. Optional, default is true
skip_rendering_if_too_far Boolean If set to true, models more than 2 chunks apart will not be displayed. Optional, default is false

Verifying the Resource Pack

Use a JSON validator to check for any syntax errors of the JSON files.

The resource pack (zip file) can be installed either clientside or as a server resource pack. If installed as a server resource pack, all players joining the server will be able to see the new additions after accepting the server resource pack.

Download the example resource pack to see a full example and to test out the functionality.

ja/mtr/adding_custom_resources.1728799559.txt.gz · Last modified: 2024/10/13 06:05 by asama_tk85