TrainCarts
TrainCarts Development has moved to SpigotMC.
You can get the new versions at the following URL:
https://www.spigotmc.org/resources/traincarts.39592/
This page is no longer being actively monitored, please seek for support on SpigotMC.
Plugin: TrainCarts - Linked Minecarts, sign-redstone systems, easy to use and realistic
Version: v1.73.0
Build: 1.7.2 R0.1/R0.2
Incompatible with: RailCraft
Description
This plugin looks for suitable Minecarts and links them together if possible. When two Minecarts are being "linked", the Minecarts will act as one single moving train.
Once carts are successfully linked, an effect is played and their velocity is shared in combination with an individual factor for each Minecart, which is used to remain a steady gap between carts. This gap is adjustable, the force at which this happens as well.
End result: a train! You can move it, make a roller-coaster out of it, split it in half, watch trains collide, whatever you want to do with trains. :)
As for 1.21, it is also possible to safely exit your train by setting an exit offset with a (sideways) push factor for the train. This feature is disabled by default. (only affects dropped items). If you want to display arrival times on signs (see redstone circuit part) you need SignLink, see the downloads on the bottom of the page.
As for 1.35 you can set train properties to make 'special' trains, or to 'finalize' a train

Links
For configuration, permissions and how-to's, see the Wikipedia page (it is rather long):
Note that I would prefer having comments, bug reports and others in the main Bukkit page, since I visit that site the most. :)
Addons
Special Addons for TrainCarts
Features
- Link minecarts using collision: no commands needed to make a train
- Move trains as easily as you would with single Minecarts
- Store trains to file for persistence during reloads and server restarts
- Use sign-redstone circuits for subway systems, complete railroads and much more
- Station to gracefully stop and launch trains
- Spawn
- Teleport
- Property setters
- Tag systems to switch certain tracks based on tags on the train
- Destination systems to make your train travel to far-away lands all on it's own
- Supports Minecart Mania's features
- Infinite minecart speeds are possible
- Push-away: Push mobs, players and items away from your trains to keep them running
- Everything is configurable, if something proves not to be, I will make it that way
FAQ
When players are near, trains reach their destinations. With no one near, they don't. What do I do?
By default trains do not keep chunks loaded, and they will unload once they move into unloaded chunks. To make trains keep the chunk area (and themselves) around them loaded, set the 'keepchunksloaded' property to True. This can be done using the /train keepchunksloaded true command, using a property sign or by changing it to true in the DefaultTrainProperties.yml file. For more information about train properties, see here.
Why not boats?!?!
Incompatibilities
If you have another plugin that performs similar Minecart replacement techniques, it is likely that TrainCarts will not function or function poorly. For the 'chunk persistence' part of this plugin, other plugins that unload chunks without firing events result in this feature failing. Minebackup is known for having this problem.
Metrics
This plugin sends server count statistics to MCStats.org. You can (globally) opt out in the PluginMetrics/config.yml file.







-
View User Profile
-
Send Message
Posted Nov 28, 2012@Dinastya Mh yeah it is taking a bit too long. I will add some simple teleportation sign similar to the elevator in the next version then, but I have to work around permissions first. I want all my plugins to use the same permission system so PEX/permissions 3/Group manager are automatically supported. I have several tickets lying around that request support.
@Etsija One problem is that I need to know a 'start' position. In the case of how it is now, it has to do it on the main thread, because the minecart that reaches a switcher sign needs to know (instantly) where to switch to. I think asynchronous is a good idea, but then it needs to be started manually. I consider using /train reroute to collect all switcher sign positions and do stuff from there on. Only issue is that I have to prevent chunk loads on my async thread, as it can cause server crashes.
-
View User Profile
-
Send Message
Posted Nov 27, 2012bergerkiller, the more I think of it, the more I believe the pathfinding initiation in TrainCarts should be implemented to be done "offline", that is, in its own (asynchronous) thread.
Meaning this: when a player (admin) issues the command "/train reroute", the plugin would create a separate thread and start finding all nodes, ie. places with destination signs and intersections, since I believe that's what constitutes the "graph" your plugin then would use when sending the carts around.
The thread would schedule this calculation over a longer period of time, say, doing only one node/connection per tick, for example (this actually could be parametrised in config.yml). Periodically it would then report to the admin who issued that command via a chat message about how many paths it has found, the newly found destination names etc. When the thread finishes its job, ie. has found all nodes and marked all connections between them, it closes with a final message.
It does not matter that this process could take several minutes; it is a very small price to pay for a smoothly running server while doing the calculations in background. And, this approach has the benefit of not having to sit on a minecart while the routing calculations are being done -> no crashing the server at the first intersection as it is doing at the moment!
When a train network changes, ie. new switchers/destinations are being added, the admins could easily schedule running the recalculations to a quiet time at the server, possibly also notifying other players that the train network is temporarily out of use, until it has been recalculated.
What do you say?
EDIT: If I haven't totally misunderstood your code, the calculations that would need to be put in its own thread are related to the explore() method in class PathNode. But I haven't looked deeply into this.
-
View User Profile
-
Send Message
Posted Nov 27, 2012Just gonna ask a last time.
Will you add the train portals?
I have been waiting for like 2 months now and there have been a lot updates but still no portal.
I hate it to be asking this a lot but because you keep saying you will add it.
I keep checking this page every day almost and still no good news :/
-
View User Profile
-
Send Message
Posted Nov 26, 2012@lagoboss
No prob, glad to be of help. And no, you're definitely NOT a "total noob" - you took NoLagg into good use and solved your problem :) I have used NoLagg several times to investigate situations like yours. Been able to identify problems with plugins many times. NoLagg is another great plugin by bergerkiller.
- - -
As for myself, I think I might try and patch-fix the server crashing problems (due to pathfinding calculations being too much for the server) on my own...in case I find a simple fix, I'll do a temporary build and share it, in case someone else has some use for it.
-
View User Profile
-
Send Message
Posted Nov 26, 2012@Rob2222
I find typing "/train maxspeed 0" stops the train
-
View User Profile
-
Send Message
Posted Nov 26, 2012@bergerkiller: Is there a command to just stop the train you drive? Would be nice to have that ability for all track building work where you wanna stop between stations. Should have its own permission.
BR Rob
-
View User Profile
-
Send Message
Posted Nov 26, 2012@Etsija
thanks for the reply.
I saw that you answered some other questions and thought that you could help and you have. In addition, I wanted to compare my usage patterns to others to see if I was possibly abusing this plugin by making a sudo-realistic transportation system lol
TrainCarts is my favorite plugin thus far!
With the "lag peaks" every 5 minutes on my server, I think it happens when the trains are destroyed and the TrainProperties.yml file is updated haphazardly. Before a "lag peak" /train list will state that I don't own any trains and then when I run the command during the "lag spike," it will say that I own like 10-15 trains that probably don't even exist because they already reached the destroyer sign.
I'm going to use Nolagg to test this theory and use a system to organize the naming of trains and the properties that each train has; maybe this will alleviate the problems that TrainProperties.yml is experiencing.
again, thanks for your input.
Edit: My issue is solved thanks to NoLagg. I analyzed the server and found that rollingminecarts was taking up the most resources because it was keeping chunks loaded. Traincarts was keeping chunks loaded too and it was too much for the server. I removed rollingminecarts and the server warning messages and "lag spikes" are gone. Still, I find it strange that CPU usage did not increase nor did ram usage in order to attempt to compensate for this issue. Nevertheless, I am thrilled that the problem is gone.
Thank You for suggesting NoLagg!
-
View User Profile
-
Send Message
Posted Nov 26, 2012All of a sudden, I'm the expert on this plugin...it is quite funny, considering we've used it for not more than 3 weeks now :D bergerkiller, I think it is about time you step up.
Anyway, here's my 3 cent's worth: the "server can't keep up" is the most annoying message Minecraft has. Also, it is the most vague: generally it means the server had too much to process at the given time, so it got left behind somewhat. As for the reasons of this: they can be numerous.
Certainly, as leagris has reported some "leaks" coming from the persistent trains, that could definitely to my view be a reason for those "lag peaks". But if you want real proof of that, you should install NoLagg and use "nolagg examine" to monitor the processing of different plugins for some time.
As for me, we do not have trains on our server, we use only single carts. What's more, our carts are not persistent, ie. they get created when a player starts his ride and destroyed when he stops at a station. So, I'm sorry but I cannot help you further with your problems.
-
View User Profile
-
Send Message
Posted Nov 26, 2012@Etsija
Hello Etsija,
I am a total noob. What are processing leaks? Would they cause the server can't keep up error? I've been getting it every 5 minutes; when it happens, the server freezes for a few seconds and then it speeds up back to normal. My CPU usage never maxes out and the server never uses over 300mb of ram out of 2GB available.
I think I may have been overdoing it it at first with like 25 10-cart trains at a time, but then I cut it down to an average of 20 4-cart trains and I still get the server freezes/warnings every 5 minutes.
I used to manually create trains but they would get bunched up and I would end up with a 30 cart train between server restarts and resets. Manually creating a whole bunch of trains never resulted in these server warnings.
Now, I use the a train spawner every 2:00 minutes and a destroyer sign; this causes the server warnings.
I'm sorry for the rambling, but I wanted to give some background info.
Do you get the warning server can't keep up messages and do you spawn more or less trains?
thanks for your time.
-
View User Profile
-
Send Message
Posted Nov 25, 2012bergerkiller, it would be extremely nice to hear what's happening with this plugin...since you do seem to update your other plugins. Our server transportation is crippled until the pathfinding is fixed. At leagris's server, I think things are quite bad as well with the memory leaks.
-
View User Profile
-
Send Message
Posted Nov 23, 2012@leagris
Bump on this very annoying bug still plagging my server with required frequent /train removeall and sometimes all server restart due to all the messy minecarts data and processing leak.
-
View User Profile
-
Send Message
Posted Nov 23, 2012@NeoRichards
I can answer your last question: this station sign should do what you want.
This makes your carts to sit on the track above that sign, wait for 30 seconds, then continue.
-
View User Profile
-
Send Message
Posted Nov 23, 2012Managing Trains - a few questions!
I love this plugin!!!
Hello, I have several tracks in my World - like circles that come close to each other - central, north, south, east, west. I have named my trains accordingly. However, how I do Manage each train? When I set the train up, and give it a name like /train setname SOUTH... then how do I get control of the NORTH train to change its options?
More so, in the trainproperties.ymp file, I see MANY trains with the same name (history of my failed attempts and train crashes?). How do I know what trains are in my world now and cleanup the ones I don't know?
And one last thing.. I LOVE this mod (a train geek myself). Is there anyway to have a train pull into a station.. sit for 30 seconds.. then leave? I will play with that!
-
View User Profile
-
Send Message
Posted Nov 23, 2012@bergerkiller
You do know that comment section here has it own rss feed? I'm following several plugins here that way.
-
View User Profile
-
Send Message
Posted Nov 23, 2012OK, maybe I'll test it out, while waiting for the pathfinding thingy to work again. I'll let you know then - if it works, could be a nice addition to Wiki!
EDIT: OK so here are the results.
and
do work together.
BUT: when the cart runs over the trigger sign, which is now in record more as you see, the same thing happens as with the pathfinding: the passenger and cart freeze at the position of the sign indefinitely, until the server crashes (becomes totally unresponsive). I don't think the proglem is with linking %test1% to the announcement sign, as the same happens with the trigger sign only.
So, to add to your work: trigger signs set to record mode freeze and crash the server!
-
View User Profile
-
Send Message
Posted Nov 23, 2012@Etsija It doesn't really hold anymore, but the fact of the matter is that the notification system of dev-bukkit sucks. At least on bukkit.org I get an alert when someone posts, here I have to cycle through all of my pages daily. Often I can end up missing something.
And yes, I think that is already possible though. I believe that variable values are replaced in messages, by putting the %varname% in the text. But I'm not entirely sure about that, could be I only included conversions for the message shortcuts.
-
View User Profile
-
Send Message
Posted Nov 22, 2012Meanwhile, I added one enchancement proposal to tickets.
...and, one question: would it be possible in any way to use SignLink to do this: when a passenger's cart exits a station, the passenger would get a chat message which would tell how much time until the next station is reached? I couldn't think of a way currently, but we don't (yet) use SignLinks, so haven't really been trying for real...but I think this would be WAY cool feature! :)
EDIT: BTW, I am blind. Did not notice your message about you preferring to get comments and discussing on the main Bukkit thread instead of this one. Does it still hold, ie. should I start using the Bukkit thread instead of this?
-
View User Profile
-
Send Message
Posted Nov 22, 2012Well I sincerely hope you fix the pathfinding asap - to us, using vertical rails is a marginal issue, but 60% of our metro network uses destinations, so in practise, 60% of our server's transportation network is completely broken atm, and has been for almost a week now.
-
View User Profile
-
Send Message
Posted Nov 22, 2012@leagris Client bug unfortunately. Mojang (Jeb?) removed all entity smoothing logic for minecarts, I think to 'prevent' the glitches in corners. Hopefully they will fix this very soon.
This version fixes vertical rails and restored 3-4-line empty transfer sign (transfer all) functionality: (same link, updated file)
https:dl.dropbox.com/u/3681706/DEV%20TEST%201.4.4%20VERSIONS%20OF%20PLUGINS.zip
Still have to look at the destination path finding stuff, but the bugged vertical rail->slope and item transfer issue had priority.
-
View User Profile
-
Send Message
Posted Nov 22, 2012@Etsija
:)
I garantee, at 1.2 blocks per ticks, it is a quite disturbing effect. Maybe I could add a nausea effect on top of it ;D
Well, more seriously, It look like one of the annoying fixes Mojang did to client-side of 1.4.5, like the client-side message of not finding signs handled by signlink.
I will tell about the Optifine workaround for those that complains of eye pain, until bergerkiller can find a fix, hopefully.