Inactive [MECH] TrainCarts v1.71.2 - Link minecarts of different types together to form trains [2222]

Discussion in 'Inactive/Unsupported Plugins' started by bergerkiller, Aug 3, 2011.

  1. Offline



    After a request from Marius A. Winsjansen I started to work on linked Minecarts. On the first day I already managed to make multiple carts move with the same speed, but a long list of bugs was to be expected. After fixing lots of bugs, adding lots of (complicated) Minecart handling functions and after hours of testing on my local server, this plugin is finally ready for a stable release! :D

    Also, special thanks go to @Shamebot for helping me out several times. :)

    For a lot of information about TrainCarts see the WIKI page!

    Configuration and permissions

    All configuration nodes can be found in config.yml and contains a description with it. Permissions can be found in PermissionDefaults.yml, combined with a description.


    Early development video (Photobucket)

    Video displaying version 0.6 of this plugin (YouTube)

    Video displaying version 1.0 of this plugin (YouTube)

    Video displaying version 1.1 of this plugin (YouTube)

    Video displaying version 1.2 of this plugin (holy...)

    A tutorial video in German explaining various sign-circuitry of TrainCarts

    PhotoBucket Sign system tutorial videos (also linked in the WIKI pages)
    Train spawner / Stations / Stations2 / Arrival signs / Train teleportation / Track switcher based on tags / Destinations / Blocker
    Video of how the switcher, station and destination signs work together

    Side information:

    It works best on straight lines with not too much elevation changes followed up by sharp corners. As long the cart gap can be adjusted, everything goes fine. It had some collision issues in the past, but I fixed all of that by manipulating the actual Minecraft server native code. I added links in the source where this was appropriate. Sharp 'U'-turns cause individual carts to lose perceptive of their direction. Keep at least one piece of track in between corner sections! Trains are stored on-disk when reloading and stopping the server, so expect trains to be there when you return.

    Important when updating: do one reload to save all trains, then replace traincarts.jar, and then do another reload. This next reload will probably cause a noClassDefFound exception (since the old jar got replaced), this is why a pre-reload is required. Replacing the jar without reloading is a very bad idea: it will cause a lot of runtime exceptions. Best is of course to stop the server and start again, but this is not always possible.

    This plugin is made compatible with Minecart Mania. If you notice a certain feature of Minecart Mania is not compatible with TrainCarts, notify me and I'll fix it. :)

    Known bugs:
    - None.

    - Train-sign message handling using SignLink (low priority)
    - Minecart use permissions (for individual carts?) such as Storage Minecarts


    If you encountered a bug, post exactly what you had done and in what order. Even a slight wobble can help fixing bugs. When posting (long) errors I recommend you to post everything, don't cut it off. I work with native methods, so in my case these lines are important. For comments on the media content see YouTube, it also contains a description with the music name when music is used.

    Bug reporting (extend)

    1. Post the Craftbukkit version you are using (the first info message in the console)
    2. Post the log from where the first plugin gets enabled to the 'done'.
    3. Post possible errors in this log too (don't cut them short)
    4. No error? Still post the log. Also explain how I can reproduce it, you can use screenshots
    5. Before reporting, remove ALL plugins other than TrainCarts and try again. If it works then, find out what plugin is interfering and post that here. I can add support.
    6. ALWAYS use the latest recommended Craftbukkit build with this, or my methods may just fail because of renamed functions.

    Important links:

    Request thread
    TrainCarts on BukkitDev for download and more
    TrainCarts source and more on GitHub
    TrainCartsBlocks add-on source and more on GitHub
    SignLink Bukkit page (required to use Arrival signs)
    MyWorlds Bukkit page (required to use Portal train teleportation)

    notice: try to keep SignLink/MyWorlds up-to-date to prevent compatibility issues.

    Installation for those that don't know how

    1. Download and install the latest craftbukkit version
    2. Download the latest TrainCarts version
    3. ^ Save the archive (zip file) to your computer
    4. ^ Open the archive you just downloaded
    5. In the folder your server sits in, create the plugins folder if it doesn't exist
    6. Open the plugins folder
    7. Move the TrainCarts.jar file found in the archive into the plugins folder
    8. Run your craftbukkit server and look in the console/log for possible errors, and/or if the plugin is enabled.


    Show your appreciation for my plugins by donating
  2. Offline


    My detailed procedure is setting a minecart onto the track (both outside and inside the detector region were tested), setting the tag via console command and then pushing it into the detector region.
    Should I get a message when building the signs (similar to station signs etc.)? And are detector signs implemented in version 1.54 or are they a feature of the current beta version?
  3. Offline


    @Sg1team they are in the latest beta version only (see GitHub)
  4. Offline


    Ok this explains why they don't work ;) then I will use switcher signs instead. Thanks for your help!
  5. Offline


    i must be confused about how this works, i placed a destination sign below the track, however if a player hops in it stops after like 10 blocks why is this?
  6. Offline


    Destination signs do NOT act like track switchers, so if you need to switch tracks to go from A to B, place switcher signs for that.
  7. Offline


    hey @bergerkiller any suggestions on how to fix my problem?
  8. Offline


    I had @Thulinma on my test server to help find the problem. He spend 1-2 hours on the server to find the problem.

    If the distance between signs is to long the signs (TAG signs) cant copy its knowledge to the next one. Thulinma promissed to tweak the destination/route system so it was possible with larger distances.
  9. Offline


    @xcanner ah yeah the 10K block cap, that must have to do with it...
  10. Offline


    Erhm, not sure what you 2 call it :)
  11. Offline


    @xcanner How long is your track?! The current maximum path a cart can travel is 100000 blocks...and this is too short? ...


    Uploaded beta version 8, fixing issues with players being able to stop launched trains at stations (somewhat), fixes slowdown property not preventing trains from slowing down, train property signs now set cart properties too (in batches) and I did a serious re-write of all native physics coding. (renamed variables, used custom functions and improved for both performance and readability)
  12. Offline


    maybe my alast post wasn't clear i went two places with it. when i enter a minecart and hit a button to power a booster rail i go about 10 blocks and then stop. what am i needing to tweak to be able to ride?
  13. Offline



    Nope the longest is around 10.000 block, but as i said @Thulinma was on the server and he knows the details.
  14. Offline


    beta8 seems to have solved all of my open issues. Thanks for the updates!
  15. Offline


    The distance between signs isn't the issue, at a T intersection, I've got multiple destinations to the left or the right.. for example, to the left there might be 6 destinations. I'm trying to make the tag switch for example, left, if the destination of any of those are chosen. So I put under the tracks to the left of the tag 6 destination signs. But the tag only seems to be able to see the 1st destination sign it encounters. I'm not sure what to do about it.
  16. Offline


    @hiro24 ooow I get it, so when browsing the tracks it stops at the first destination sign it can find, instead of only stopping at THE destination sign.


    What is on the fourth line of your destination sign? The fourth line is now used to set the new destination to put on the train once a train enters it, it could cause the old destination to get removed.
  17. Offline


    I'm having the same issue as moose517. Normally after hitting a powered rail an occupied minecart will travel 30 or so blocks. This used to work fine but when I updated to the new version it doesn't make it 10 blocks. Am I missing a new setting?
  18. Offline


    @LinkDude80 do you mean a single minecart or a train? Because an entire train obviously requires more power to bring to full speed; it has more friction and 'weight'. That's basic physics.

    Also, single minecarts travel 50 blocks or so when I tested it.

    Also, use the latest version, the .7 beta had issues with the forward force, it was losing velocity with every physics update.
  19. Offline


    It's not that it stops at the first destination, in fact, none of my destination signs have a 4th line. The problem is coming up to a tag switch, I need to say.. turn left for destination C, but to the left I have 4 destination signs in a row, A B C and D, w/ D closest to the tag. The tag only seems to read D, doesn't see C, so doesn't know to switch the track left. That's my problem, and I don't know how to fix it.
  20. Offline


    @hiro24 ooooow now I get it - again. It's a bug with how it finds out about the world, because it 'assumes' it is not needed to find the connected rail sections of C, since it equals out tag and destination signs. Truth is that the destination sign never gets the neighbours updated, resulting in it never getting to know c-d.

    Just wondering though...why have 4 destination signs in a row?

    Well, no other option, time to let destination signs 'toggle' rails too.
  21. Offline


    error in server.log 1.6 beta v8

    Could not pass event VEHICLE_COLLISION_ENTITY to Train Carts
    at org.bukkit.plugin.RegisteredListener.callEvent(
    at org.bukkit.plugin.SimplePluginManager.callEvent(
    at net.minecraft.server.EntityMinecart.collide(
    at net.minecraft.server.World.entityJoinedWorld(
    at net.minecraft.server.WorldServer.entityJoinedWorld(
    at net.minecraft.server.World.playerJoinedWorld(
    at net.minecraft.server.World.tickEntities(
    at net.minecraft.server.MinecraftServer.w(
  22. Offline


    @MechanID Ah that error, I just keep on forgetting to fix it xd

    Also, I found out why destination signs are failing. Simple cause: destination signs do not have a location. So, I'm adding a 'block location' property next to the name.
  23. Offline


    Ok, here's a rough example layout of my railway:


    For example, if I am at station F, I might tell it I want to go to station B. So the train gets to the T intersection and... what? From F, I want to be able to go to A-E, and G-K, so the intersection needs to know which way to switch the track at the tag. That's why I had multiple destinations to the left of the tag. I would have for example, a destination for A, B, C, D and E, so the tag would know to turn left if the destination was for any of those. But the tag only sees destination E, being the closest sign to the tag. The destinations behind E seem to be invisible to the tag. But I put them in the row like that thinking that would be the only way I could have the rail know to turn left for any of the 5 possible destinations. I hope that explains a little better the problem.
  24. Offline


    one more bug in 1.6 beta v8
    i have issue with stations, sometimes when inputs to station changing state, and train is moving on station, result - train not reach center of station and can not be launchet in any direction. i can make a quick video on youtube if needed.
  25. Offline


    It sounds like your putting destination signs to the left and right of all your T intersections? It doesnt need to be told at each intersection which way one destination is vs the other, it will automatically figure that out. Sounds like whats happening is itll hit that first destination sign, and think its arrived.
  26. Offline


    Ok your destination sign issue has been fixed. You may have to perform a reroute beforehand to get it to load properly. It now stores the location of the destination nodes and optionally a name if this was set, which guarantees that it can find out the rail location of a node. Now properly makes the trains travel past multiple destinations with ease.

    @MacGyver420 no this is not what was happening. It simply didn't know where the 'destination' signs were, it only knew the name, therefore it failed to traverse further than a destination sign. (and that is useless if you have destination signs in between two other destinations.)
    Now looking at the NPE.


    Fixed the NPE and destination sign issue. Also made trains less vulnerable for weird detachments.
  27. Offline


    Hi bergerkiller!
    Our server sometimes crashes when I ride on a train into a new chunk. The crashes occured with the last stable 1.54. We are currently installing version 1.6 beta 9.The Error was:

    Could not pass event CHUNK_LOAD to Train Carts

    and the stack-trace:

    at java.util.ArrayList$Itr.checkForComodification(
    at java.util.ArrayList$Itr.remove(
    at org.bukkit.plugin.RegisteredListener.callEvent(
    at org.bukkit.plugin.SimplePluginManager.callEvent(
    at net.minecraft.server.ChunkProviderServer.getChunkAt(
    at net.minecraft.server.PlayerInstance.<init>(
    at net.minecraft.server.PlayerManager.a(
    at net.minecraft.server.PlayerManager.addPlayer(
    at net.minecraft.server.ServerConfigurationManager.c(
    at net.minecraft.server.NetLoginHandler.b(
    at net.minecraft.server.NetLoginHandler.a(
    at net.minecraft.server.NetworkListenThread.a(SourceFile:94)
    at net.minecraft.server.MinecraftServer.w(

    The error looks quite similar to the one from MechanID. However you are the expert so I wanted to post it here.

    Okay, with version 1.6 beta 9 we get the following warnings in the server log, that are leading to a server crash:

    [WARNING] Can't keep up! Did the system time change, or is the server overloaded?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 14, 2016
  28. Offline


    I am also getting this error with version 1.54 when restarting the server after a clean stop. It seems as if the error only occurs when trains were moving while the server was stopped. I did a quick test with a train standing in a station and the server startet without this error. When the train was moving I got this message.
  29. Offline


    Ok first of all, remove ALL other plugins but TrainCarts. Does the error then occur? Secondly, install all plugins again and NoLagg (disable all features if you like). Does it show an error/warning with a 'Synchronized code access error'? Since I haven't seen this error occur EVER I am pretty sure this is another plugin messing around with threads.

    @BadKarMa could you post your plugin list?
  30. Offline


    w00t, beta 9 fixes problems! :D
    err... did anything change with portal signs though?
    IIRC it was:

    but that doesn't seem to be working (I do have MyWorlds)
  31. Offline


    I followed this suggestion and disabled all plugins except MyWorlds and TrainCarts and am still getting this error. The trains are also split up and driving in various directions. Here you can view the error log: without NoLagg, with NoLagg

Share This Page