Create Track Map



Create Track Map (CTM) 是一个多加载器模组,用于在你的世界中显示 Create 列车的轨道地图,包括所有轨道、信号、车站和列车。信号和列车状态会近乎实时地更新。

使用方法
CTM 可在 Modrinth 下载。请确保你下载的版本与你的加载器、Minecraft 版本以及 Create 版本相匹配。 以下是 Create 版本的兼容性图表:
|
CTM ≤1.3 |
CTM 1.4 |
CTM ≥1.5 |
| Create 0.5.0 |
✅ |
✅ |
❌ |
| Create 0.5.1 |
❌ |
✅ |
✅ |
安装
只需将 .jar 文件放入你的 mods 文件夹(或通过模组加载器安装),就像安装其他模组一样!CTM 设计为服务端模组,但也可以在单人世界和局域网服务器中运行。它默认会在端口 3876 上运行 Web 服务器,但可以在此配置。如果你希望查看地图,必须转发此端口。(我该怎么做?)
地图本身可以在根目录访问(默认为 http://localhost:3876/)。如果使用代理来提供地图服务,请确保配置允许 Server-Sent Events 通过。
单人游戏
地图托管在你的电脑上,因此当 Minecraft 运行时,在浏览器中输入 http://localhost:3876/。
多人游戏
A) 本地(局域网)服务器
地图仍然托管在你的电脑上,因此当游戏运行时,在浏览器中输入 http://localhost:3876/。
你家里的其他人可以通过在浏览器中输入 http://[你电脑的 IPV4 地址]:3876/ 来查看地图。\
B) 服务器在我的 PC 上
地图仍然托管在你的电脑上,因此当服务器运行时,在浏览器中输入 http://localhost:3876/。
你家里的其他人可以通过在浏览器中输入 http://[你电脑的 IPV4 地址]:3876/ 来查看地图。
你家庭网络之外的人可以通过在浏览器中输入 http://[你的公网 IPV4 地址]:3876/ 来查看地图。\
C) 服务器由托管服务提供商托管
地图与该服务上的服务器一起托管。当服务器在线时,你可以在 [你的服务器地址]:3876/ 查看地图。
注意:你的服务必须支持额外的端口转发。 你可以联系服务商支持/查阅文档或直接在 Google 搜索确认。如果该服务不支持此功能,你将无法使用。你可以更换服务或尝试自行托管。
为了明确起见:请勿在 IPV4 地址周围包含方括号!例如:192.168.0.0:3876
在寻求帮助之前必读!
要使用此模组,除了你的 Minecraft 服务器外,你还必须能够打开第二个端口,CTM 将在该端口上运行其 Web 服务器。如果你使用的是 Aternos,这是不可能的。如果你使用的是共享托管提供商,请联系你的主机商以协助打开端口。对于打开端口或因模组错误以外的原因导致的问题诊断,我们将不提供任何支持。
高级用法
CTM API
CTM 提供以下 API,也可通过同一端口访问:
/api/network, /api/network.rt: 所有轨道部件和列车车站的列表
/api/signals, /api/signals.rt: 所有列车信号的列表,包括它们的状态
(绿色、黄色、红色)
/api/blocks, /api/blocks.rt: 所有信号控制块的列表,以及它们是否被列车占用或预留
/api/trains, /api/trains.rt: 所有已组装列车的列表,包括它们的名称和
位置
/api/style.css: 根据配置的颜色和字体生成的 CSS 样式表
/api/config.json: 地图配置
.rt 版本会通过服务器发送事件(SSE)实时进行更新。
配置
CTM 的配置选项位于服务器 config 目录下的 create-track-map.json 文件中。如果该文件不存在,它会在启动时自动创建。
以下选项可用:
{
// 是否实际启动监视器和服务器。
"enable": false,
// 轨道数据更新之间的等待时间(秒)。
"watch_interval_seconds": 0.5,
// 内部 Web 服务器监听的端口。
"server_port": 3876,
"map_style": {
// 用于地图 UI 的字体。必须是有效的 CSS 字体栈。
"font": "ui-monospace, \"JetBrains Mono\", monospace",
// 地图各个组件的颜色。必须是有效的 CSS 颜色。
// 任何 CSS 颜色格式均可使用,例如命名颜色和 rgb()。
"colors": {
"background": "#888",
"track": {
"occupied": "red",
"reserved": "pink",
"free": "white"
},
"signal": {
"green": "#71db51",
"yellow": "#ffd15c",
"red": "#ff5f5c",
"outline": "black"
},
"portal": {
"primary": "purple",
"outline": "white"
},
"station": {
"primary": "white",
"outline": "black"
},
"train": "cyan",
"lead_car": "darkturquoise"
}
},
"map_view": {
"initial_dimension": "minecraft:overworld",
"initial_position": { "x": 0, "z": 0 },
// 缩放级别必须是整数,但可以为负数。
// 每个缩放级别是前一个级别的两倍大。
// 0 是一个合理的最低值,但对于大型网络可能不切实际。
// 3 是查看双轨网络的合理默认值。
"initial_zoom": 3,
"min_zoom": 0,
"max_zoom": 4,
// 屏幕上是否应显示缩放控件。
"zoom_controls": true,
// 信号应在轨道的哪一侧显示。
// 有效值为 LEFT 或 RIGHT(全部大写)。
"signals_on": "RIGHT"
},
"dimensions": {
// 维度名称必须带命名空间。
"minecraft:overworld": {
// 在图层切换器中显示的标签。
"label": "Overworld"
},
"minecraft:the_nether": {
"label": "Nether"
},
"minecraft:the_end": {
"label": "End"
}
},
"layers": {
"tracks": {
"label": "Tracks",
"min_zoom": 0,
"max_zoom": 4
},
"blocks": {
"label": "Track Occupancy",
"min_zoom": 0,
"max_zoom": 4
},
"signals": {
"label": "Signals",
"min_zoom": 0,
"max_zoom": 4
},
"portals": {
"label": "Portals",
"min_zoom": 0,
"max_zoom": 4
},
"stations": {
"label": "Stations",
"min_zoom": 0,
"max_zoom": 4
},
"trains": {
"label": "Trains",
"min_zoom": 0,
"max_zoom": 4
}
}
}
运行 /ctm reload(需要操作者权限)可在不重启服务器的情况下重新加载配置。
Create Track Map



Create Track Map (CTM) is a multi-loader mod that displays a track map of Create trains in your world, including all tracks, signals, stations, and trains. The signals and trains are updated in (practically) real time.

Usage
CTM is available for download on Modrinth. Please make sure you download the correct version for your loader, Minecraft version, and Create version. Below is the compatibility chart for Create versions:
|
CTM ≤1.3 |
CTM 1.4 |
CTM ≥1.5 |
| Create 0.5.0 |
✅ |
✅ |
❌ |
| Create 0.5.1 |
❌ |
✅ |
✅ |
Installation
Simply place the .jar file in your mods folder (or install with a modloader) like any other mod! CTM is intended to be a server side mod, but can also run in single-player worlds and LAN servers. It runs a web server on port 3876 by default, but this can be configured. You must forward this port if you wish to see the map. (How do I do this?)
The map itself is visible at the root (by default http://localhost:3876/). If using a proxy to serve the map, make sure to configure it to let Server-Sent Events through.
Singleplayer
The map is hosted on your computer so while Minecraft is open, enter http://localhost:3876/ into your browser.
Multiplayer
A) Local (LAN) server
The map is still hosted on your computer so while the game is open, enter http://localhost:3876/ into your browser.
Those in your household can see the map by entering http://[your computer's IPV4 address]:3876/ into their browser.\
B) The server is on my PC
The map is still hosted on your computer so while the server is open, enter http://localhost:3876/ into your browser.
Those in your household can see the map by entering http://[your computer's IPV4 address]:3876/ into their browser.
Those outside your household can see the map by entering http://[your public IPV4 address]:3876/ into their browser.\
C) The server is hosted with a hosting service
The map is hosted with the server on that service. You can see the map at [your server address]:3876/ while the server is up.
NOTE: YOUR SERVICE MUST SUPPORT EXTRA PORT FORWARDING. You can check with support/the docs for the service or just good old Google. If the service doesn't support this, you are out of luck. You can switch services or try hosting your own.
Just so it's clear: Do not include the brackets around your IPV4 address! For example: 192.168.0.0:3876
READ THIS BEFORE ASKING FOR HELP!
To use this mod, you must be able to open a second port, in addition to your Minecraft server, which CTM will run its web server on. If you are using Aternos, this is not possible. If you are using a shared hosting provider, please contact your host for assistance in opening a port. No support will be provided to open a port or to diagnose issues which are not caused by a bug in the mod.
Advanced Usage
CTM API
CTM provides the following API, also accessible through the same port:
/api/network, /api/network.rt: List of all track pieces and train stations
/api/signals, /api/signals.rt: List of all train signals, including their states
(green, yellow, red)
/api/blocks, /api/blocks.rt: List of all signal control blocks, and whether they are occupied or reserved by a train
/api/trains, /api/trains.rt: List of all assembled trains, including their names and
positions
/api/style.css: CSS style sheet generated from configured colors and fonts
/api/config.json: Map configuration
The .rt versions update in real time with Server-Sent Events (SSE).
Configuration
CTM's config options can be found at create-track-map.json in your server's config directory. It is automatically created at startup if it doesn't exist.
The following options are available:
{
// Whether to actually start the watcher and the server.
"enable": false,
// How long to wait between track data updates.
"watch_interval_seconds": 0.5,
// The port the internal web server listens on.
"server_port": 3876,
"map_style": {
// Font to use for the map's UI. Must be a valid CSS font stack.
"font": "ui-monospace, \"JetBrains Mono\", monospace",
// Colors for individual components of the map. Must be valid CSS colors.
// Any CSS color format will work, such as named colors and rgb().
"colors": {
"background": "#888",
"track": {
"occupied": "red",
"reserved": "pink",
"free": "white"
},
"signal": {
"green": "#71db51",
"yellow": "#ffd15c",
"red": "#ff5f5c",
"outline": "black"
},
"portal": {
"primary": "purple",
"outline": "white"
},
"station": {
"primary": "white",
"outline": "black"
},
"train": "cyan",
"lead_car": "darkturquoise"
}
},
"map_view": {
"initial_dimension": "minecraft:overworld",
"initial_position": { "x": 0, "z": 0 },
// Zoom levels must be integers, but may be negative.
// Each zoom level is twice as big as the previous.
// 0 is a decent minimum but may be impractical for large networks.
// 3 is the sensible default for viewing double-tracked networks.
"initial_zoom": 3,
"min_zoom": 0,
"max_zoom": 4,
// Whether a zoom control should be visible on the screen.
"zoom_controls": true,
// Which side of the track a signal should be displayed on.
// Valid values are LEFT or RIGHT (all uppercase).
"signals_on": "RIGHT"
},
"dimensions": {
// Dimension names must be namespaced.
"minecraft:overworld": {
// Label that shows up in the layer switcher.
"label": "Overworld"
},
"minecraft:the_nether": {
"label": "Nether"
},
"minecraft:the_end": {
"label": "End"
}
},
"layers": {
"tracks": {
"label": "Tracks",
"min_zoom": 0,
"max_zoom": 4
},
"blocks": {
"label": "Track Occupancy",
"min_zoom": 0,
"max_zoom": 4
},
"signals": {
"label": "Signals",
"min_zoom": 0,
"max_zoom": 4
},
"portals": {
"label": "Portals",
"min_zoom": 0,
"max_zoom": 4
},
"stations": {
"label": "Stations",
"min_zoom": 0,
"max_zoom": 4
},
"trains": {
"label": "Trains",
"min_zoom": 0,
"max_zoom": 4
}
}
}
Reload the config without restarting the server by running /ctm reload (operator permissions required).
评论 0
登录后参与评分
还没有评论,来抢沙发吧