Difference between revisions of "TrainCarts/Signs/Property/zh-cn"
(Updating to match new version of source page) |
|||
(15 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
== 介绍 == | == 介绍 == | ||
− | ''' | + | '''属性牌'''可以执行与指令相同的任务,但比指令更强,能够实现全自动化。属性牌需要红石激活才能运行,并且会忽略矿车的所有权,因此如果你只想定位某个你拥有的矿车,请与转辙器的检测矿车拥有者的功能相结合来使用。 |
Line 15: | Line 15: | ||
'''第二行:'''''property'' | '''第二行:'''''property'' | ||
− | '''第三行:''''' | + | '''第三行:'''''要更改的属性名称。'' |
− | '''第四行:''''' | + | '''第四行:'''''要设置的属性的值。'' |
+ | <div class="mw-translate-fuzzy"> | ||
=== 布尔语句 === | === 布尔语句 === | ||
− | [[File:Tc_property_statement.png|thumb|300px|属性 'playerenterexit' | + | [[File:Tc_property_statement.png|thumb|300px|属性 'playerenterexit'(玩家进出)由拉杆控制。]] |
布尔属性(如玩家进入和列车减速)可以使用[[TrainCarts/Signs/Statements|语句]]来判定 true 还是 false。这使得使用红石或基于列车的其他属性来打开或关闭某些功能时变得更加容易。 | 布尔属性(如玩家进入和列车减速)可以使用[[TrainCarts/Signs/Statements|语句]]来判定 true 还是 false。这使得使用红石或基于列车的其他属性来打开或关闭某些功能时变得更加容易。 | ||
+ | </div> | ||
=== 远程控制 === | === 远程控制 === | ||
− | [[Special:MyLanguage/TrainCarts/Signs#Remote_Control| | + | 你可以[[Special:MyLanguage/TrainCarts/Signs#Remote_Control|远程设置]]列车属性。假设你的列车名为 ''train01'',那么控制牌上应该这样写: |
− | |||
{{sign|[train train01]|property|maxspeed|0.4}} | {{sign|[train train01]|property|maxspeed|0.4}} | ||
Line 38: | Line 39: | ||
|- | |- | ||
! 属性 | ! 属性 | ||
− | ! | + | ! 示例值 |
! 释义 | ! 释义 | ||
|- | |- | ||
Line 71: | Line 72: | ||
| setowner | | setowner | ||
| Maxxue | | Maxxue | ||
− | | | + | | 清除所有的车主并设置车主为设置的玩家。 |
|- | |- | ||
| remowner | | remowner | ||
Line 99: | Line 100: | ||
| spawnitemdrops<br>spawndrops<br>killdrops | | spawnitemdrops<br>spawndrops<br>killdrops | ||
| true | | true | ||
− | | 设置矿车被销毁时是否掉落物品。<br>当设置为 false | + | | 设置矿车被销毁时是否掉落物品。<br>当设置为 false 时,运输矿车或漏斗矿车里储存的物品也不会掉落。 |
|- | |- | ||
| viewdistance | | viewdistance | ||
Line 108: | Line 109: | ||
只能使用 '''[train]''' 设置以下属性: | 只能使用 '''[train]''' 设置以下属性: | ||
+ | <div class="mw-translate-fuzzy"> | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! 属性 | ! 属性 | ||
− | ! | + | ! 示例值 |
− | ! | + | ! 释义 |
|- | |- | ||
| name<br>setname<br>rename | | name<br>setname<br>rename | ||
Line 196: | Line 198: | ||
| route add<br>route set<br>route remove<br>route clear | | route add<br>route set<br>route remove<br>route clear | ||
| destination_name | | destination_name | ||
− | | | + | | 为列车[[TrainCarts/PathFinding#Route_Manager|路线]]添加/移除/清除/设置目的地。目的地要最后添加。 |
|- | |- | ||
| route load<br>loadroute | | route load<br>loadroute | ||
Line 202: | Line 204: | ||
| 通过名称加载之前保存的[[TrainCarts/PathFinding#Route_Manager|路线]]。 | | 通过名称加载之前保存的[[TrainCarts/PathFinding#Route_Manager|路线]]。 | ||
|} | |} | ||
+ | </div> | ||
+ | |||
=== 设置名称 === | === 设置名称 === | ||
− | ''' | + | 名称属性会更改列车的名称。考虑到多列车重命名,且每列车都需要一个唯一的名称,因此会添加“#”来计数。例如,经过名称值为 ''Intercity#A'' 的属性牌时,第一辆列车将被命名为 ''Intercity1A'',第二辆列车将被命名为 ''Intercity2A'',以此类推。你可以与生成器结合,系统化生成并命名列车。之后还可以通过此命名,进行系统化远程控制,用于控制特定生成器或类别的所有列车。 |
+ | |||
+ | |||
+ | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
+ | === Keep Chunks Loaded === | ||
+ | Trains can keep chunks around them loaded like players do. This allows them to move through the world without unloading when there are no players nearby. This feature can be enabled per train using the <code>keepchunksloaded</code> or <code>keeploaded</code> property. This can be set with a legacy ''true/false'' value, or a load mode and radius. | ||
+ | </div> | ||
+ | |||
+ | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
+ | On modern versions of Minecraft a [https://minecraft.wiki/w/Chunk#Level_and_load_type chunk load type] is also active, which can be <code>full</code>, <code>redstone</code> or <code>minimal</code>. Full will tick entities in the chunks loaded, redstone will not tick entities but will simulate redstone physics, and minimal will not run either. To [[TrainCarts/Lag|improve server performance]] it can help to switch the mode to <code>minimal</code> with a lower radius when the train is driving long distances that don't require world simulation. | ||
+ | </div> | ||
+ | |||
+ | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Value | ||
+ | ! Description | ||
+ | |- | ||
+ | | false | ||
+ | | Disables the chunk loader. The train will now unload if no player is nearby. | ||
+ | |- | ||
+ | | true | ||
+ | | Enables the chunk loader with a radius of 5x5 full entity-ticked chunks. In effect this loads a 9x9 area of chunks. Equivalent to <code>full 2</code> | ||
+ | |- | ||
+ | | minimal 0 | ||
+ | | Enables the chunk loader, but only loads the chunks the train is inside of. Does not simulate entities or redstone (except for the train itself). This has the most performance and is suitable for long-distance travel. | ||
+ | |- | ||
+ | | redstone 2 | ||
+ | | Enables the chunk loader, loading and simulating a 5x5 block-ticked (redstone simulated) chunks, and an outer 7x7 layer of non-simulated chunks. Useful at stations when redstone has to be simulated, but entities at these stations don't need to be ticked. | ||
+ | |- | ||
+ | | full 10 | ||
+ | | Enables the chunk loader, loading a 21x21 area of chunks and simulating entities inside. A 23x23 layer around it is block-ticked, and another 25x25 layer around that is not simulated. So this is actually loading 25x25 chunks. If you're looking for a chunk loader that acts like a Player, this is it. | ||
+ | |} | ||
+ | </div> | ||
+ | |||
+ | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
+ | ==== Examples ==== | ||
+ | <code>/train keepchunksloaded true</code> | ||
+ | </div> | ||
+ | {{sign|[train]|property|keeploaded|true}} | ||
+ | |||
+ | |||
+ | <code>/train keepchunksloaded minimal --radius 0</code> | ||
+ | {{sign|[train]|property|keeploaded|minimal 0}} | ||
+ | |||
+ | <div class="mw-translate-fuzzy"> | ||
=== 等待属性 === | === 等待属性 === | ||
− | + | 等待属性控制列车的减速机制。当前方有列车阻挡时会自动减速。这项功能很大程度上会替代[[Special:MyLanguage/TrainCarts/Signs/Waiter|waiter 等待牌]],并且更加智能: | |
* 与前方列车保持距离。 | * 与前方列车保持距离。 | ||
− | * 减速靠近[[TrainCarts/Signs/Mutex| | + | * 减速靠近[[TrainCarts/Signs/Mutex|闭塞区间]]。 |
− | * 使当前列车减速靠近[[TrainCarts/Signs/Blocker| | + | * 使当前列车减速靠近[[TrainCarts/Signs/Blocker|阻挡器]]。 |
+ | </div> | ||
+ | <div class="mw-translate-fuzzy"> | ||
存在以下'等待'属性: | 存在以下'等待'属性: | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 234: | Line 285: | ||
| waitpredicted | | waitpredicted | ||
| false | | false | ||
− | | 预测并控制列车的路线。默认启用。如果启用,会考虑[[TrainCarts/Signs/Switcher| | + | | 预测并控制列车的路线。默认启用。如果启用,会考虑[[TrainCarts/Signs/Switcher|转辙器]]并检测列车预期路线上的障碍。 |
|} | |} | ||
+ | </div> | ||
它们也可以通过指令<code>/train wait <属性> <值></code>进行配置。 | 它们也可以通过指令<code>/train wait <属性> <值></code>进行配置。 |
Latest revision as of 13:18, 19 January 2025
介绍
属性牌可以执行与指令相同的任务,但比指令更强,能够实现全自动化。属性牌需要红石激活才能运行,并且会忽略矿车的所有权,因此如果你只想定位某个你拥有的矿车,请与转辙器的检测矿车拥有者的功能相结合来使用。
语法

第二行:property
第三行:要更改的属性名称。
第四行:要设置的属性的值。
布尔语句
布尔属性(如玩家进入和列车减速)可以使用语句来判定 true 还是 false。这使得使用红石或基于列车的其他属性来打开或关闭某些功能时变得更加容易。
远程控制
你可以远程设置列车属性。假设你的列车名为 train01,那么控制牌上应该这样写:

属性
可以使用 [cart] 和 [train] 设置以下属性:
属性 | 示例值 | 释义 |
---|---|---|
addtag | tag1 | 添加一个标签。 |
settag | taga | 设置一个标签。 |
remtag | a | 移除一个标签。 |
addticket | expresstrain | 为列车创建一个车票。 |
setticket | expresstrain | 为列车设置只允许的车票。 |
remticket | expresstrain | 为列车移除一个车票。 |
addowner | Maxxue | 为列车添加一个车主。 |
setowner | Maxxue | 清除所有的车主并设置车主为设置的玩家。 |
remowner | Maxxue | 为列车移除一个车主。 |
destination | station2 | 设置目的地。 |
mobenter | false | 设置是否允许生物进入。 |
playerenter | true | 设置是否允许玩家进入。 |
playerexit | yes | 设置是否允许玩家离开。 |
playerenterexit playerexitenter |
yes | 同时设置是否允许玩家进入和玩家离开。 |
spawnitemdrops spawndrops killdrops |
true | 设置矿车被销毁时是否掉落物品。 当设置为 false 时,运输矿车或漏斗矿车里储存的物品也不会掉落。 |
viewdistance | 10 | (只支持 Paper 端!)设置矿车/列车上的乘客有一定的区块/实体视野距离。可用来为世界减少高占用区块的卡顿。 |
只能使用 [train] 设置以下属性:
属性 | 示例值 | 释义 |
---|---|---|
name setname rename |
Intercity#A | 为列车设置新的名称。# 会被替换为 1 至无穷大的数字。 |
dname setdname displayname setdisplayname |
Trainname | 设置 trigger(触发器)控制牌显示的名称(%triggernameN%)。 |
exitoffset exitlocation exityaw exitpitch exitrotation |
2/0/0 200/45/-2333 30 0 90 |
修改玩家离开时的偏移、偏航、俯仰和旋转。离开位置使用绝对坐标,离开时的偏移则相对于矿车。 |
speedlimit maxspeed |
0.6 | 设置列车的最大速度。 |
false | 设置列车能否推动生物、玩家、列车和其他。 | |
true | 设置列车能否推动生物。 | |
no | 设置列车能否推动玩家。 | |
yes | 设置列车能否推动其他(如物品、船等)。 | |
playercollision mobcollision traincollision misccollision |
default cancel kill killnodrops push enter link |
设置列车与玩家、生物、列车或其他类型实体的碰撞模式。 |
slowdown | false | 设置列车是否因重力和摩擦力减速。 |
slowfriction | false | 设置列车是否因摩擦力减速。 |
slowgravity | false | 设置列车是否因重力减速或加速。 |
gravity | 1.0 | 修改重力加速度和减速度(乘数,默认值为1.0)。 |
linking | deny | 设置列车能否与其他列车相连。 |
collision | allow | 设置列车能否与其他实体发生碰撞。 |
keepcloaded loadchunks keeploaded |
true | 设置列车是否保持附近的区块加载。 |
default setdefault |
stat1def | 将 DefaultTrainProperties.yml 里其中一个默认属性加载到所填写的列车上。 |
banking | 1 0 | 修改列车过弯时的倾斜程度(第一个数字:强度;第二个数字:平滑度)。 |
godmode invincible |
true | 设置列车是否是无法破坏的,如果为 true,则玩家不能打掉矿车。 拥有 train.break.any 权限的玩家(OP 默认拥有)可以破坏矿车。 |
waitdistance waitdelay waitacceleration waitpredicted |
请参阅等待属性章节。 | |
route add route set route remove route clear |
destination_name | 为列车路线添加/移除/清除/设置目的地。目的地要最后添加。 |
route load loadroute |
my_saved_route | 通过名称加载之前保存的路线。 |
设置名称
名称属性会更改列车的名称。考虑到多列车重命名,且每列车都需要一个唯一的名称,因此会添加“#”来计数。例如,经过名称值为 Intercity#A 的属性牌时,第一辆列车将被命名为 Intercity1A,第二辆列车将被命名为 Intercity2A,以此类推。你可以与生成器结合,系统化生成并命名列车。之后还可以通过此命名,进行系统化远程控制,用于控制特定生成器或类别的所有列车。
Keep Chunks Loaded
Trains can keep chunks around them loaded like players do. This allows them to move through the world without unloading when there are no players nearby. This feature can be enabled per train using the keepchunksloaded
or keeploaded
property. This can be set with a legacy true/false value, or a load mode and radius.
On modern versions of Minecraft a chunk load type is also active, which can be full
, redstone
or minimal
. Full will tick entities in the chunks loaded, redstone will not tick entities but will simulate redstone physics, and minimal will not run either. To improve server performance it can help to switch the mode to minimal
with a lower radius when the train is driving long distances that don't require world simulation.
Value | Description |
---|---|
false | Disables the chunk loader. The train will now unload if no player is nearby. |
true | Enables the chunk loader with a radius of 5x5 full entity-ticked chunks. In effect this loads a 9x9 area of chunks. Equivalent to full 2
|
minimal 0 | Enables the chunk loader, but only loads the chunks the train is inside of. Does not simulate entities or redstone (except for the train itself). This has the most performance and is suitable for long-distance travel. |
redstone 2 | Enables the chunk loader, loading and simulating a 5x5 block-ticked (redstone simulated) chunks, and an outer 7x7 layer of non-simulated chunks. Useful at stations when redstone has to be simulated, but entities at these stations don't need to be ticked. |
full 10 | Enables the chunk loader, loading a 21x21 area of chunks and simulating entities inside. A 23x23 layer around it is block-ticked, and another 25x25 layer around that is not simulated. So this is actually loading 25x25 chunks. If you're looking for a chunk loader that acts like a Player, this is it. |
Examples
/train keepchunksloaded true

/train keepchunksloaded minimal --radius 0

存在以下'等待'属性:
属性 | 值 示例 | 描述 |
---|---|---|
waitdistance | 20.5 | 列车与列车之间保持的距离(方块距离)。列车会减速甚至在到达距离时完全停止。 |
waitacceleration | 20kmh/s | 当前方障碍出现或消失时列车的加速度和减速度。当指定两个数值时,第一个数值表示列车加速度,第二个数值表示减速度。没有设置等待距离也可以使用,并且列车减速接近 blocker(阻挡器)控制牌或 mutex(区间闭塞)控制牌时也会使用该配置。 |
waitdelay | 30 | 列车因前方障碍需要等待而完全停止时,障碍消失后列车启动的延迟(以秒为单位)。 |
waitpredicted | false | 预测并控制列车的路线。默认启用。如果启用,会考虑转辙器并检测列车预期路线上的障碍。 |
它们也可以通过指令/train wait <属性> <值>
进行配置。