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


    PenzRules as stated in the PM: You need to use the [portal] sign underneath the tracks on both ends. I can't allow mid-flight portal entering because I can't have parts of the same train on different worlds.

    I managed to fix the detector signs some more; they are now 100% the same as the switcher signs, difference being that they can detect for a region of tracks, allowing, for example, redirects to other tracks when a track is in use.

    Now taking a look at the wait sign once more. It needs some fixing (it still collides), and I want them to be used AT intersections instead of in front.


    Uploaded a new beta version (25). It fixes some path-finding related issues. Thinking of re-implementing the 'check rails above sign' system, only afraid it will require too much processing.

    Detector signs also got updated; they will now toggle appropriately when someone enters/leaves a minecart in a detected region, or if items are transferred, just like the switcher signs already did.

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


    Thank you. I totally missed the tutorials. I watched them half year before. :)
    So at the moment it's not possible to teleport to another world inside a cart?
    I noticed the player not teleporting as long as in minecart so it shoud be easy to code.
    Why not just let the cart teleport as usual and teleport the player by a forced tpp and link him back to the cart?

    I'm testing this on my neighbour's server maybe tomorrow. He's alraydy ordered me to build him a new train system so I'll show him this tutoral and begin to get myself used to the [train] signs. Good night.

    Carts really don't teleport to other worlds. I could swear I saw carts once.
    Will you add support for multiple worlds?

    I don't know nothing about how this works but I see no argument in Train IDs seperated by worlds if a minecart's known position includes worldname, waggon number and movement.
    The Train IDs may be reset at 0 speed while in different worlds.
    Sorry for asking to much, what exactly has to be done to make it work?
    Is it possible to place a cart in any loaded world?

    I guess I'll try the other nice features served by the signs on my server right now. :)
    Oh, Yeah! Speed and station are perfect.
    I'll give Transporter 7.6 a shot for teleportation issues. It runs beside TrainCarts. So far, so good.
    EDIT: There are teleportation problems with player in minecart and I get disconnected from the cart. I like to use these stations AND to teleport. Any idea, what's next?
    Whether TrainCarts is on or not, there are some weird errors. Most weird without TrainCarts.
    Flying and stuck carts this time withput your plugin. By the way I could just wonder, why minecarts can move in the game if not able to be correctly placed. :oops:
  4. Offline


    PenzRules Teleporting entities around is not easy, I had to write a separate function for it to not cause endless glitches. If you want to teleport trains, do NOT use the portal-block-like thing from MyWorlds. Instead place the [portal] signs underneath the tracks and power them. Then, when a minecart travels on top of it, it will teleport the train as set on the portal sign. Teleportations only function for trains on rails.
  5. Offline


    I tested this method again and it worked fine. Even with player inside. As long as not leaving the world.
    So I guess the best way would be stations near the portals.
  6. Offline


    I'm trying to update my server to the latest suggested build 1938. TrainCart keeps crashing with the following error.

    Using the TrainCarts 1.6 BETA v25

    2012-02-22 12:32:44 [SEVERE] Error occurred while enabling Train Carts v1.6 (Is it up to date?): com.bergerkiller.bukkit.common.uti$
    java.lang.NoSuchMethodError: com.bergerkiller.bukkit.common.utils.MathUtil.limit(III)I
            at com.bergerkiller.bukkit.common.PluginBase.onEnable(
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(
            at org.bukkit.craftbukkit.CraftServer.enablePlugins(
            at net.minecraft.server.MinecraftServer.t(
            at net.minecraft.server.MinecraftServer.a(
            at net.minecraft.server.MinecraftServer.init(
    Anybody else with the same issue?
  7. Offline


    artsitan Use the latest BKCommonLib version with this plugin. (see the included version in the download)
  8. Offline


    I've found an error:
    When a train receives a maxspeed signal while parts of the train still being teleported, one of the carts (don't know which of them) acts somekind abandoned somewhere between the anterior carts of the train causing it to slow down until it throws the cart out of the track (if not completely stopping due to insufficient powerrails). I'm not sure how to repair the train without completely removing it.
    Maybe I should turn of the "animation" setting in the config? How ecatly does this work?
    Does this animation make the carts fly between the 2 points instead of really teleporting, only make it visible or it it for siomething else. This fly-mode would also be a cause of additional multi-world-teleportation problems, I suppose.
  9. Offline


    PenzRules the animation is played when items are getting transferred between train <> chestfurnacedispenser. See the wiki; transfer signs.

    Could you post a screenshot/video of some kind to show me what you mean?

    PenzRules Trains will not stop above destinations, use a station sign for that. And yes, you can place tag names on the 3rd and 4th line of the switcher sign. It then toggles the rails left/right respectively based on the train or cart entered. This way you can, for example, make some trainsgo a different direction when pressing a certain button. Can be easier than destinations some times.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Sep 9, 2018
  10. Offline


    There you go:
  11. Offline


    PenzRules I the carts recover after a while? It looks to me as if one part of the train didn't use the right max speed and started to run into the carts in front...though no idea why.
  12. Offline


    You seem to be making good progress! I need to somehow stop myself playing minecraft to focus on my final exams :/

    Did you have any luck searching for infinite loops/possible causes of TC crashing the server (occasionally the server loaded, but the 'done' message said ~ >150 seconds) on start/reload?
  13. Offline


    andrewpo I know, but I am keeping it to a minimum :)
    (no longer start and end the day in Java eclipse for now)

    And no, I couldn't find it. There is no real infinite while thing I couldn't find (and recursion is not possible to happen without a stack trace overflow exception) Might find out about it one day...
  14. Offline


    I have some questions about tags:
    The train system I try to build contains some crossings. Will this work? If yes, does it matter if the track above the tag sign is not a curve? I hope the search function ignores this, too.
    And finally - in the tutorial the destinations were deleter-blocks. The train must not stop on destinations. Will it continue to move? Or is it possible to use a train station as destination for example, by writing a name in the fourth line? Sorry for asking, I still have this feeling of "there is no readme".

    Lets take a seat in chicken express. :-D
  15. Offline


    Thank you, sounds like the system will work as expected. ;)

    There is another problem:
    If I am OP, I can build any type of sign, but as admin I cannot.
    I entered:
    /permissions player setperm PenzRules
    /permissions player setperm PenzRules
    /permissions player setperm PenzRules
    /permissions player setperm PenzRules
    But I cannot set the maxspeed. I have no permission.
    Please start answering by adding an info about the used permission type in the Permissions Wiki.

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


    PenzRules open up the 'DefaultPermissions.yml' File generated in the TrainCarts folder. It contains all possible permissions. (with description)
  17. Offline


    just started to use this plug. seems pretty much awesome as it would allow me to nice railway system around my server.

    however, i seem to be having some trouble with the station sign.
    when i stop a train larger then 1 cart on any kind of station with any parameter (stopping as in supplying power to both sides of station) the train no longer responds after it has stopped. it won't move and won't launch (no hissing sound either) when i change the signals, however when powering to only one side as it arrives it stops, waits and launches normally.
    so it only happens when i actually stop it.

    anybody else has this problem or a suggestion on what may cause it?

    Im using Bukkit 1.1-r4-b1938
    Traincarts 1.6 B25(issue was first noted in B24, just updated)
    using the BKCommon lib that came with traincarts.
    im using no other plugs that should affect the carts

    things i tried:
    -Remove train carts folder
    -Remove all other plugs except for Train,BKcommon,Dynmap,Essentials and Multiverse
    -Alot of different parameters for station.
    -reloading/stopping server.
  18. Offline


    Riven it makes sense, I can't allow the passengers to move the train out of the station. When a station is holding the train above the sign, it can not possibly be moved. If you remove power from both sides, it will clear this state and you can move it freely.
  19. Offline


    but the problem is that once it stopped the train stops permanently. its state doesn't get cleared when i remove power from both sides and it won't launch if i remove power from only one side. the train just gets stuck in that one state
  20. Offline


    Riven Confusing, as I can't seem to find out what is wrong. I checked it locally, but the trains stop and move at stations perfectly fine...
    Guess I need a screenshot of the setup (note: press F3 so I can see where the north is)
  21. Offline


    ok. here's a zip with some screens (attached). the first 2 depict it working normally. the rest of the problem im having.
    and the last with the sign.

    these where taken on my server where this time only Traincarts,BKcommons v1.08 and PermissionsExtended
    where active. This problem is very confusing as it happens wherever i try. im thinking of creating a new server next to mine to test it out there.

    Attached Files:

  22. Offline


    Riven don't forget to put a manual download link, the general attachments thing of Bukkit is flawed. (left-click on the attachment to put it into the text field)
  23. Offline


  24. Offline


    akrieger but it doesn't let me cancel the event...kinda weak tbh. Is the developer of Nethrar still active?
  25. Offline


    since i can't seem to get this attachement thing working ive uploaded it to my webserver.

    ive also tried it on a blank server with the latest minecraft server and bukkit and nothing else but traincarts and the bkcommon that came with it and it still happened. once stopped it won't do anything anymore despite removing power from station.

    Attached Files:

  26. Offline


    akrieger is the developer.
  27. Offline


    Oscarius *facepalm* and I thought this wouldn't happen to me a second time, well thanks for pointing this out to me :)

    akrieger Could you make the event implement Cancellable and allow the event to be cancelled this way?
    Oscarius likes this.
  28. Offline


    This works perfectly :)
  29. Offline


    Riven I think I know what happened. The cart is 'just' not above the station sign, which causes the sign to never find this cart, and thus the train. I'll have to add a more sophisticated minecart member 'get' logic, so it will also look at the two connected rails. If both contain a minecart and both are of the same group, it will treat the minecart that is closest, as it is technically above the sign.
  30. Offline


    Sure, I'll include it in the 1.2 update.

    In terms of default behavior, do you think it's acceptable to make a 'bounce' effect which makes minecarts hitting a portal (and have the teleport cancelled) move slowly away from the portal, at some minor speed? Or just stop short?
    Oscarius and Don Redhorse like this.
  31. Offline


    akrieger well they will simply insta-teleport...only problem is that I need to find a spot to teleport the train to. So..I need to know the destination portal + the rails to 'paste' the train.

Share This Page