Skip to content

Repository files navigation

Minecart Train(矿车列车)

一个 Minecraft 1.21.10 · Fabric 模组:让玩家把矿车紧紧连成列车一起跑, 矿车之间不再互相推挤、抖动、重叠或产生渲染错乱,玩家坐上任何一节(建议车头) 都能正常行驶。

A Fabric mod for Minecraft 1.21.10 that couples minecarts into a tight train: no more shoving, jitter, overlapping carts or rendering glitches. Ride the front cart to pull the whole train.

功能 / Features

  • 自动连挂:把矿车推到前面的矿车上(约 1.5 格内、同一轨道、同向)就会自动 连接成一列。推几辆就连几辆,无限长度。 Push minecarts into each other (same rail, same direction, ~1.5 blocks) and they auto-couple into a train of any length.
  • 紧紧跟车:后面的矿车以恒定间距(默认 1.0 格,中心距)紧贴前车,速度与前车 一致——充能铁轨加速整列、爬坡、过弯、停车都自然跟随。 Followers keep a constant gap and match the leader's speed: powered rails accelerate the whole train, slopes, curves and stops just work.
  • 不推挤 / 不抖动 / 不重叠:同一列车的矿车互相忽略碰撞推力,再也不会互相 顶开、抖动或叠在一起(也就没有渲染错乱)。 Train members ignore collision pushes, so carts never shove, jitter or overlap (and therefore never render wrong).
  • 可乘坐:坐上任意一节都能正常跑;在车头按 WASD 即可驾驶整列(与原版 驾驶矿车一致)。 Ride any cart; press WASD on the front cart to drive the whole train.
  • 分离:把中间的矿车打掉,或把某节推离超过 4 格,连挂自动断开。 Break a cart or push one more than 4 blocks away to decouple.
  • 兼容两种矿车物理minecart_improvements(1.21.2+ 新矿车物理)开或关都可用。 Works with the new minecart physics flag both on and off.
  • 服务端逻辑:纯服务端运算,客户端无需任何改动,单机 / 联机 / 专用服务器通用。

使用方法 / Usage

  1. 在铁轨上放好矿车(普通矿车、运输矿车、动力矿车、漏斗矿车均可)。
  2. 把后面的矿车向前面的矿车(或坐上最前面的车开动,让后面追上)。
  3. 撞上后自动连挂成功——把车头开起来,整列一起跑。

提示:动力矿车(Furnace Minecart)加燃料后放在车头,可以当“火车头”牵引整列; 但它自带最高速度减半,别嫌慢(原版设定)。

配置 / Configuration

配置文件在 config/minecart_train.json(首次启动自动生成),修改后用 /minecarttrain reload(需要权限等级 2)热重载:

默认值 说明
gap 1.0 前后矿车的中心距(格)。想更紧可以调小(如 0.9),别低于车身宽度以免穿模
linkDistance 1.5 自动连挂的最大中心距离(格)
unlinkDistance 4.0 距离超过此值自动脱钩(格)
gain 2.0 跟车纠偏强度(P 控制器增益),越大追得越紧,过大可能抖动
maxCorrection 0.35 单次纠偏最大速度修正(格/刻)
maxSpeed 0.6 跟随车最大速度上限(格/刻)

命令 / Commands

  • /minecarttrain reload —— 重新读取配置文件(权限等级 2 / OP)。

兼容性 / Compatibility

  • Minecraft 1.21.10,Fabric Loader >=0.16.0, Java 21,需要 Fabric API。
  • 服务端逻辑:专用服务器只需服务端安装;单机/局域网客户端安装即可。
  • minecart_improvements(1.21.2+ 实验矿车物理,1.21.4 起默认开启)开关均兼容。

构建 / Build

./gradlew build

产物在 build/libs/。CI 配置:.github/workflows/GitHubWorkflow.yml(手动触发 构建 + 发布 Modrinth/GitHub Release)与 build.yml(push/PR 自动构建并跑单元测试)。

开源 / License

MIT License,见 LICENSE

About

Minecraft Vanilla Train Implementation Minecraft原版列车实现

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages