跳到正文

No Original Trains (Server side)

作者:ChengYouHang

Block MTR's built-in trains from the server side with /mtrnot commands, synced to clients. Fabric + Forge.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

No Original Trains (Server side)

Block MTR’s built-in trains on the server — clients follow automatically.

Server-side · Minecraft 1.20.1 · Fabric + Forge · /mtrnot commands · No MTR dependency

This is the server half of No Original Trains. It decides which built-in trains are blocked and hands that list to players who run No Original Trains (Client side). It never touches addon pack vehicles.


At a glance

Item

Detail

What it does

Lets an admin pick MTR’s built-in trains to block, then pushes the list to every client that has the client build

Where it runs

The server only. No GUI, no buttons, no client classes

What it can block

The 378 built-in trains of MTR 4.0.5, grouped into 36 families

What it never blocks

Every addon pack vehicle. There is no addon option anywhere in this mod

Loaders

Fabric 0.14.21+ · Forge 47.x

Hard requirements

None. MTR does not have to be installed on the server

Admin interface

/mtrnot commands, plus config/mtr_no_original_trains_server.json


How it works

  1. You pick trains on the server. /mtrnot block SP1900 adds that whole family — 24 cars — to the block list. /mtrnot list shows what is blocked.
  1. The list is pushed on join. Whenever a player connects, the server sends the current list on a dedicated channel. It is re-sent automatically after every change, so nobody has to reconnect.
  1. The client applies it. Players running No Original Trains (Client side) hide those trains immediately and stop loading them from the next launch.

Nothing is sent to players who do not have the client build. No error, no chat message, no log spam — the server just skips them.


Commands

All commands need permission level 2 (op).

Command

What it does

/mtrnot or /mtrnot status

Show whether blocking is on, how many cars are blocked, and how many families the catalog holds

/mtrnot search <terms>

Search the built-in catalog by family name, vehicle name or ID. Spaces mean AND

/mtrnot block <terms or id>

Add every matching family to the block list. block SP1900 blocks all 24 of its cars

/mtrnot unblock <terms or id>

Remove matching families from the list

/mtrnot list [page]

Page through the current list, grouped by family

/mtrnot clear

Empty the list

/mtrnot reload

Re-read the config file and push it to everyone online

Subcommand names autocomplete. The keyword argument is free text — use /mtrnot search first if you are not sure of a train’s name or ID.


Search works the same as on the client

The server build carries the same matcher as the client-side picker, so an admin can find a train as easily as a player can:

Behaviour

Detail

Space means AND

/mtrnot search 上海 16 matches only trains whose name or ID contains both terms

Numbers stay whole

2 does not match 12号线, and 16 does not match the digits inside AC16

Prefixes ignored

mtr_custom_train_ and mtr: are stripped, so a raw ID pasted from a log still resolves

Best matches first

Exact name → starts with → contains → ID only

Because search results are only a convenience for the admin, a wrong match costs one extra /mtrnot unblock. The catalog itself is exact: it is a bundled snapshot of MTR’s 378 built-in IDs, so the block list can never accidentally contain an addon vehicle.


The config file

config/mtr_no_original_trains_server.json is generated on first start:

 

Edit it by hand and run /mtrnot reload, or use the commands — both write the same file. A server pack or config manager can ship this file, so a modpack author can pre-block a set of trains and players never see them.


Which file do I need

Build

File

Needs

Fabric server

mtr_no_original_trains_server-fabric-1.0.0.jar

Minecraft 1.20.1 · Fabric Loader 0.14.21+

Forge server

mtr_no_original_trains_server-forge-1.0.0.jar

Minecraft 1.20.1 · Forge 47.x

Drop the matching jar into the server’s mods/ folder and restart. Nothing else to install.

⚠️ Both builds share the same mod ID. Install one of them, never both. This mod is separate from the client-side No Original Trains — different mod ID, different file, safe to run on the same machine.


Pairs with the client build

You run

Players run

Result

Server side

Client side

Block list is delivered and applied. This is the intended setup

Server side

Nothing

Players join normally and see vanilla MTR trains

Server side

Client-side No Original Trains

Players join normally; the client build applies its own local rules

Server side

Client side and client-side No Original Trains

Both work independently and do not conflict

Nothing here can get a player kicked

Different mods on client and server normally cause handshake rejections on Forge. This mod is built so that cannot happen with any build in this family:

  • displayTest="IGNORE_ALL_VERSION" in mods.toml — a client without the mod joins fine, and version mismatch is never compared.
  • The network channel accepts any version on both sides, so a 1.0.0 server and a future client build still talk to each other.
  • No mandatory dependency points at the client build. Forge never reports a missing required mod.
  • Fabric does not perform a mod-list check at all, so the Fabric build is naturally permissive.
  • Only server-side classes load on a dedicated server. No client class is touched, so the jar runs headless without complaint.

If a server is rejected by a third-party “mod detector” plugin, that is a server rule, not a loader handshake — this mod does not attempt to hide from it.


What this mod cannot do

  • It does not remove trains by itself. The server only decides and delivers. A player without the client build still sees every train.
  • It does not block addon vehicles. Those are declared by resource packs the server never reads. Blocking them is the job of the client-side No Original Trains build.
  • It does not stop other ways of spawning a blocked train (commands, other mods, schematics). For the players it targets, the train is simply not in their registry.
  • Changes need a client restart. A list update reaches a player instantly, but the vehicles are unregistered at resource load, so it takes effect on their next launch. The current session hides them from the picker only.
  • The catalog is a bundled snapshot of MTR 4.0.5’s 378 built-in vehicles, taken so the server does not need MTR installed. If a future MTR release adds built-in trains, those new trains will not appear in this catalog until the mod is updated.
  • Command feedback is Chinese-only in 1.0.0. Command names and arguments are English; the replies are not. English strings are planned for a later build.

Before you install

  • Back up config/ once. The file is small and human-readable; keeping a copy makes rolling back a one-liner.
  • Test with one family first. /mtrnot block SP1900, join with a client build, confirm the train is gone, then build the rest of your list.
  • This is 1.0.0. The command surface is stable, but expect polish rather than features until the client build has been in the wild for a while.
  • Not supported: NeoForge on 1.20.1, and any Minecraft version other than 1.20.1.

Source and license

MIT licensed · source on GitHub: ChengYouHang/mtr-no-original-trains

The server and client builds live in mtr_no_original_trains_server/ and mtr_no_original_trains_client/ in that repository. Issues and pull requests are welcome.


The project icon is derived from MTR’s official texture (assets/mtr/textures/item/train.png). MTR is released under the MIT license, copyright (c) 2021 LogisticsCraft. Thanks to the MTR team for building and open-sourcing it — this addon would not exist without it.

常见问题

No Original Trains (Server side) 支持哪些 Minecraft 版本?

No Original Trains (Server side) 支持 Minecraft Java 版 1.20.1,可用的加载器:Fabric / Forge。下载时注意选择和你游戏版本一致的文件。

No Original Trains (Server side) 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

ChengYouHang 的其他作品

查看全部 →