Table of Contents
This page hasnt been fully completed. Please help with the Creation.
(remove this note when the page is completed)
Transport Simulation Core
| Transport Simulation Core | |
| Created by | jonafanho |
| Repository | Transport-Simulation-Core |
| Language | Java |
Transport Simulation Core (Often abbreviated as TSC) is a project facilitating train & vehicles simulation.
It primarily serves as the backend for MTR 4, responsible for holding all the station, trains, depot, track data and more, as well as simulating vehicle movements and hosting the online system map.
State of TSC in MTR 4.0
The latest commit in Transport Simulation Core is designed for MTR 4.1, not for MTR 4.0. (MTR4 Commit hash TBD)
The simplest way to modify the behavior of TSC (Or to obtain private/protected fields) in MTR 4.0 is by using Mixin or similar injection tools.
Otherwise, you can locate the TSC commit used by MTR 4.0, recompile it, and copy the pre-built jar into MTR 4's codebase.
Dependency Configuration
TSC is used as a Java dependency by the MTR Mod. It's code are then shadowed within the main MTR Mod jar, so the TSC jar does not need to be separately shipped to the end user.
In MTR 4.0, the Transport Simulation Core pre-built jar file is uploaded within the MTR Mod GitHub repository.
In MTR 4.1, the Transport Simulation Core is published as GitHub package, in whichj the MTR Mod would grab the packages via GitHub package. However this requires setting up an access token on your local machine in order to authenticate with GitHub package and obtain the dependency.
See GitHub's documentation for detail.
Communicating
Transport Simulation Core can be executed in the background thread, independent of the Minecraft Server. It hosts a webserver powering the MTR Online System Map, as well as allowing various operations such as adding/updating stations, depots and trains by submitting it into a message queue via Java code.