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 22, 2012Just noticed this: jerky minecart movement happens with an unmodded 1.4.5 client, but I use a modded one (vanilla + OptiFine + LiteLoader etc.) and with that client, minecart movement is absolutely smooth!
-
View User Profile
-
Send Message
Posted Nov 21, 2012I can definitely verify leagris's bug report: the cart movement is jerky, and while it IS hard to catch evidence from it, it is very presentable while playing.
On the other hand, 1.4.5 seems to handle carts in general more "smoothly"; less random warping and damage to players while riding. Anyway, I think this should be investigated, although to me it isn't a showstopper, just an annoyance.
- - -
@bergerkiller: you have any ETA on your trials for pathfinding fixes? I'd be happy to test out whatever test builds you might have!
-
View User Profile
-
Send Message
Posted Nov 21, 2012Jerky mine-cart movement
This server is running CraftBukkit version git-Bukkit-1.4.5-R0.1-2-g3c054f3-b2485jnks (MC: 1.4.5) (Implementing API version 1.4.5-R0.2-SNAPSHOT) BKCommonLib v1.38 SignLink v1.28 Train Carts v1.72.1 (1.4.4 dev build) Train Carts Blocks v1.05
Client moving minecarts seems to get different entity location packets.
This cause the movement to appears jerky.
Having V_SYNC on or off does not change the issue.
Here is a screenshot of the jerky effect. Note, if you take a screenshot in-game with F2, it will only capture a full clean frame. I had to use gimp screenshot to get it. This look like a client bug triggered by how Train Carts handle movment. Possibly, the server entity movement event is not canceled and casts a corresponding packet to the client, while Train Carts casts it's own movement event and client packet for a different move. The side effect becomes more noticeable and eye painful as mine-cart speed increase
-
View User Profile
-
Send Message
Posted Nov 21, 2012While anxiously waiting for bergerkiller to work his magic on TrainCarts and fixing the pathfinding, I decided to write a little more thorough README file for my small TCGraph program. My fellow miners, here you are:
https://dl.dropbox.com/u/6411310/Readme.pdf
If you have your destinations.dat files available at your server, go ahead and install DOT tool and give this tool a try. I will do my best to develop the program into something which would really be useful, not only to the plugin users but also bergerkiller himself!
-
View User Profile
-
Send Message
Posted Nov 20, 2012@leagris
I do not - the program produces both the .txt AND the .dot files in one run from destinations.dat (or whatever your TrainCarts destination file is called).
-
View User Profile
-
Send Message
Posted Nov 20, 2012@Etsija Hello! How do you get a .dot from the .txt output of your progam?
-
View User Profile
-
Send Message
Posted Nov 20, 2012Here is a working version of my program called TCGraph, which produces a DOT output of the TrainCarts destinations.dat file. https://dl.dropbox.com/u/6411310/TCGraph.jar
DOT is a common description language for graphs and DOT files can be neatly output into graphical PDF format, for example. You do need the free DOT tool, which can be found here: http://www.graphviz.org/Download..php
The source code for my tiny program can be found from my GitHub account: https://github.com/Etsija/TCGraph
I hope this helps the users of this excellent plugin to pinpoint problems in their pathfinding! I will write a better manual for my SW when I have time.
-
View User Profile
-
Send Message
Posted Nov 20, 2012@bergerkiller
About the "command to perform path finding automatically": how would such a command work? I myself have no preference other than that the server doesn't crash at the 1st junction, so whatever is best to implement for you, is fine to me :D
Regarding my small program: it is ready, but I haven't been able to run it "from the command line", so far only from inside Eclipse's debugger. As soon as I find a way to run it just by clicking the corresponding jarfile, I'll share the code and jar on my GitHub account. Note that the tool does need the free "dot" program, however. I'm not planning on writing my own viewer, since dot does far better job at producing the graph than anything I'd be able to write.
As a pre-taste, here's the DOT my code produces atm: https://dl.dropbox.com/u/6411310/destinations07.dot
Then I just feed that file into dot (actually, neato), by writing to command line:
neato -Tpdf destinations07.dot -o destinations07.pdf
and voilá, I get the nice and neat PDF.
-
View User Profile
-
Send Message
Posted Nov 20, 2012@Schwarzmonch @MrKrisKrisu Well German speech/writing isn't too well, but I can read it. So in my reply to Schwarz: There is no difference between the switcher and tag sign other than the name. To KrisKrisu: I will look into the transfer signs today. I want to fix up TrainCarts for MC 1.4.5 anyhow, so every bugfix is welcome. I was stuck at some annoying physics problems with vertical->slope rails in the top. (it teleported the train, resulting in 'free energy')
@Etsija I really like your graphical representation! If you manage to write a really nice viewer, I'll gladly put it on the wiki. I can already see it is really useful for debugging it all.
And yeah, I now know why I had that continuous destination calculation in place. However, I think it is best if I include a command to perform path finding automatically. Some people requested multithreading, it is something I do want to try and build. This multithreaded version would execute when a no-destination minecart goes past a switcher sign.
If this multithreading doesn't work out, I'll try to spread the calculations over multiple ticks so it doesn't hang the server as much. I am considering to do one path per tick.
Another thing I will have to look into then, it shouldn't crash the server...
-
View User Profile
-
Send Message
Posted Nov 19, 2012I tried various things to get the path finding to work, but to no avail. I can once again verify that path finding is completely broken - it crashes our server 100% on the first junction the cart with a destination drives to.
EDIT: I even tried to remove the check from the code that checks whether the train has a destination set when it drives over a switcher sign, but probably my small change didn't make any difference. The server still crashes at the first junction.
-
View User Profile
-
Send Message
Posted Nov 19, 2012chest in and chest out doesn't work -.-
this and the path finding is most important for my server :(
P.S. bergerkiller can you speak german? :D
-
View User Profile
-
Send Message
Posted Nov 19, 2012@rcth
bergerkiller kindly provided me with a source code that converts destinations.dat into an ASCII file. I changed the output format into a DOT file, then just used the free (and great!) dot tool to create the graph. I will share my code when it's ready - it will maybe be of some use to other plugin users as well.
-
View User Profile
-
Send Message
Posted Nov 19, 2012@Etsija
How did you made that file with your network?
-
View User Profile
-
Send Message
Posted Nov 18, 2012Just an idea: some time ago, to reduce tick lag in normal train usage, you did remove the feature that a new switcher node was added to the node list whenever a train moved over a new switcher, right?
If that's the case, then fine - for the normal usage, when the train network is ready and people just want to use the system. Then the normal usage would be that only the carts with a destination set should trigger node- and pathfinding at switcher nodes.
But, I think you have at the same time introduced a huge problem. Let me explain:
This introduces a problem: what happens when a user sets "/train dest x", starts driving and arrives at the first switcher? I think now the plugin goes into a massive trouble of trying to find all switchers leading to a destination. That hangs up the whole server, and we get a severe crash on our server.
So, in the end, you did save a few ticks on normal usage by disabling switcher addition when trains with no destination set are driving on the server. But at the same time, you took almost all of that saved calculation and inserted it into one massive heap for pathfinding. And, as iKoze and I have found, that really is fatal to the server - or, you have a bug somewhere which is causing this.
My suggestion is this: why not implement another admin command, say "/train addnodes", which does this: whenever I take a cart and do "/train addnodes", the plugin would register each switcher I drive over, see if it is a new one, and if so, adds it into its set of nodes, maybe at the same time also connecting the new node into its corresponding neighbour nodes (ie. finding the egdes).
I think this could be a fairly good compromise: I (as an admin) would of course be the only one ever using that command, so the usual usage for the plugin would be as it is, but with the added functionality of "incremental pathfinding". So, if I ever would need to run "/train reroute" again, then I just had to do "/train addnodes" and then drive all of our tracks again. I know that is a bit of work, but at least it would be doable. (And, we have nice scenery on our server, so the job wouldn't be too dull, either :) )
I think actually this same command could be used for incremental building of a big network.
Example: our current metro network, as the plugin sees it, is this: https://dl.dropbox.com/u/6411310/destinations07.pdf
As you see, the destinations "komentola", "linnake", "louhos" and "traktori" are yet unconnected. To issue "/train reroute" would be an overkill, since that deletes ALL info. TO do it incrementally -> take a cart, issue "/train addnodes" and drive over new switchers connecting those new destinations.
(BTW, the picture linked also demonstrates the work I've done so far with the code I received from you. My code is almost ready to be published now.)
-
View User Profile
-
Send Message
Posted Nov 18, 2012@bergerkiller: as iKoze and me have noticed, /train reroute causes a situation, where in practise, using this plugin with route finding becomes quite impossible - since the server crashes in the first junction, when it starts to find the nodes and edges again after they have been resetted.
Please could you investigate and try to come up with a solution, since this is killing us now. We cannot use route finding at all on our server.
I think what you're saying is that on a massive system, this would be inevitable, but clearly, it is not an acceptable situation. I have numerous earlier destinations.dat files from our server stored in my PC. They implement a "subset" of the routes we now have, so why not implement some kind of an incremental way of adding new nodes to the system? I mean, I could feed the server our destinations.dat from three days back, and then the plugin would try to add to that when finding new nodes, rather than start all over again, which in a massive system is impossible in the way it is done now.
For reference, here's our metro system atm. It is quite massive, I must say. http://46.253.195.79:17965/
-
View User Profile
-
Send Message
Posted Nov 18, 2012So, the carts started acting up again. I think I found the actual issue. I don't know what was causing the issue with the speedlimit sign, but they seem to be working now. As far as the station signs go, whenever I put the launch "speed," the sign just wonks out and starts launching the carts either South or West. Always. When I don't put the launch speed, it works fine.
-
View User Profile
-
Send Message
Posted Nov 18, 2012@Etsija
Hi Etsija, thats exactly the same problem, i've mentioned some time ago: @iKoze.
@bergerkiller, this bug doesn't go out of my mind (since it's annoying me all the time ;) ). I'm looking for a solution for that. If I find a solution, I'll let you know. Would it be possible, to stop the train before the switcher, calculate the route in a separate thread and if finished, let the train move on? Could you please explain, why it's not possible, to load new chunks from another thread? (@bergerkiller)
Greetings, iKoze
-
View User Profile
-
Send Message
Posted Nov 18, 2012@ToddVee
der deutsche original text :D
Hallo Bergerkiller
erstmal ein dickes fettes lob für dieses plugin es ist einfach der hammer :D
so nun zum problem und zwar den pathfinder ich versuch schon seit einigen tagen eine solche strecke zu bauen aber die weichen wollen nicht das machen das sie sollen ob mit dem tag oder switcher Schild (es gab 1-5mal gute test für 1nen zug danach ohne was zu ändern funkionierte es nicht mehr)
um auf nummer sicher zu gehen hab ich sogar ein server gemacht nur mit Traincarts (und BKCommonLIB) ich änderte nix in den confys (=original) jedoch das selbe ergebniss :S
hoffe kannst mir bisle weiter helfen mfg Schwarzmönch PS: dies wurde in deutsch verfasst und mit googel übersetzt
-
View User Profile
-
Send Message
Posted Nov 18, 2012Route calculation with /train reroute crashes our server big time. I do "/train reroute", take a cart, start driving, choose a destination far away on the map with "/train dest" -> as soon as I hit the first intersection, the whole server crashes and "read timeout" is on the log.
Any ideas? This happened for three times in a row.
-
View User Profile
-
Send Message
Posted Nov 18, 2012@ Schwarzmonch
I volunteer as a translator here, please write the German text xD
Danke Todd