TrainCarts/Lag [ja]

From BergerHealer Wiki
Revision as of 02:12, 18 June 2026 by Saihou-Heiki (talk | contribs) (Created page with "Spawnerサインの使いすぎや、プレイヤーが配置しまくるなどでサーバーが停止してしまうのを避けるため、<code>plugins/Train_Carts/config.yml</code>を変更して、どれくらいの列車やトロッコがひとつのワールド内に存在できるのかを設定できます。 <pre> # Limits of the amount of carts on the server cartLimits: # Maximum number of TrainCarts minecarts allowed per world # If there are more than th...")
Jump to navigation Jump to search
Other languages:

プラグインの使い方によっては、サーバーやクライアントにラグを引き起こすかも知れません。このページでは、そのラグの原因や、対処法を説明します。

複雑な3Dモデル

Minecraftというゲームは、複雑なボクセルモデルを描画するのに向いた作りにはなっていません。もしサーバーのリソースパックで複雑なモデルを使っているなら、クライアントのFPS値を減少させる可能性もあります。実際のサーバーにリソースパックを適用する前に、一度試してラグを確認するようにしてください。モデルのJSONファイルサイズも有効な指標になります。

長い列車

アタッチメントエディタでは、トロッコのサイズをとても大きなものにすることができます。これはトロッコ本体の当たり判定も大きくしますが、これは同時に、特に、ブロックとの衝突などの処理でサーバーに小さくない負担をかけるかもしれません。これを防止するためには、ブロック衝突をオフにすることも検討してください。

Turns off block collisions, trains will fall through the ground
Command: /train collision block cancel
Permission: train.property.collision


DefaulTrainProperties.ymlもしくはSavedTrainProperties.ymlの設定を編集することで、プレイヤーが設置するトロッコの初期設定や、すべてのトロッコのプロパティを変更できます。

trainname:
  collision:
    block: CANCEL

長すぎるウェイトディスタンス

waitdistanceプロパティは、前方の列車との間で保つ距離を設定できます。これは前方のレールをずっと確認するという処理を伴うので、値が大きすぎるとサーバーに大きな負荷をかけるかもしれません。

チャンクロード

列車は付近のチャンクをロードし続けることができますが、いくつものチャンクを同時にロードし続けていると、サーバーのパフォーマンスに影響を及ぼします。その範囲内にレッドストーン機構やモブなどがあればなおさらです。そしてその列車が動くとチャンクのロード・アンロードが繰り返されるので、RAMを使いまくり、最悪サーバーがメモリ不足でエラーを起こしてしまうかもしれません。

通常、ひとつの列車がチャンクをロードするくらいであれば、プレイヤーが移動するのと変わらないので、大した処理にはなりません。しかしあちらこちらで数百個の列車がチャンクをロードしたら、それはそれは甚大な処理を行わなくてはならないわけです。

対策としては、列車のチャンクロードの範囲を狭めることができますし、モブやレッドストーンの処理を行わないようにもできます。特に、列車が長距離間を運行する時には、これを設定しておくことをおすすめします。

列車数の制限

Spawnerサインの使いすぎや、プレイヤーが配置しまくるなどでサーバーが停止してしまうのを避けるため、plugins/Train_Carts/config.ymlを変更して、どれくらいの列車やトロッコがひとつのワールド内に存在できるのかを設定できます。

# Limits of the amount of carts on the server
cartLimits:
  # Maximum number of TrainCarts minecarts allowed per world
  # If there are more than this number, no more minecarts can be placed/spawned
  # A value of -1 disables this limit (default)
  maxCartsPerWorld: -1

  <div lang="en" dir="ltr" class="mw-content-ltr">
# Whether to include unloaded trains/carts in the maxCartsPerWorld limit
  countUnloaded: false
</div>

  <div lang="en" dir="ltr" class="mw-content-ltr">
# Maximum number of carts that can be joined together in a train
  # Linking does not happen when it would exceed this limit,
  # and trains longer than this cannot be spawned
  # A value of -1 disables this limit, allowing any length (default)
  maxCartsPerTrain: -1

Saved Train Spawn Limits

Besides a global limit, it is possible to configure a spawn limit per saved train. After having saved a train with /train save name, you can configure a spawn limit with /savedtrain name spawnlimit <limit>.

Spawn signs and train chests configured with the train name will stop spawning trains when this limit is reached. This is particularly useful with auto-spawning spawn signs that populate a train network, combined with setting destroyAllOnShutdown to true in config.yml.