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


    Ok, after more testing and some quality time with the source code it looks like the only two issues left are the phantom carts when a chunk is loaded and golden_apple being returned as apple from ItemParser.

    And it would be AWESOME if you could give an error in the chat when placing a sign that tells us when an item name is not valid. This would cut down on a ton of false bug reports. Also, it would be nice if invalid item names didn't default to anything, but rather defaulted to nothing.

    Oh yea, and invalid data values item:invalidvaluehere = npe.
  3. Offline


    nvm I figured it out by reading! anyway! awsome plugin!
  4. Offline

    NOUS Vizuri

    As far as i understand pathfinding does not work for destinations in different worlds connectedby teleports?
    then i did the following : in world 1 there is a dead end and there in that dead end there are destination signs which are copies of destinations from world 2. and also there is a portal to world 2 on rails before thosedestination signs. so when a player choose some world 2 destination during train departure he actually is directed to the dead end and the cart is teleported to world 2 before it reach it's destination. however inspite of there in world 2 there is a station with the name same as current train destination - the train stops. as far as i understand it is because path was calculated when train has started to move. then i've added "/train reroute" command which is run after the train has been teleported to second world. in such case the whole thing works but unfortunatelly it is only for Ops as regular users haveno permissions for reroute command and somehow it is not possible to run the command on "console" level but only on user level. besides server loading is much higher with described config.
    please advise is there any better/simplier way to make traincarts move from one world to stations in another world? can we expect pathfinding will work for more then one world in the future?
    plugin versions : CB 2126 MC 1.2.4 R1.0, TrainCarts v1.62, MyWorlds v1.44. i've tried newer versions for TrainCarts and MyWorlds but it doesnt work anyway
  5. Offline


    NOUS Vizuri I recommend setting a slightly different destination name for in the other world, or the dead end, and switch between them. (you can use a directional sign for it, like, if direction A set to DirA else dirB. Cross-world *may* be possible if I extend the track iterator to allow cross-world iteration by reading portal signs, but I feel this is a bit weird. Maybe one day... :)
  6. Offline


    When restarting my server, the carts stop and no longer move. I can still start it by pushing it myself. I'm sure its already been discussed, but i've been away for the last few months.

    So... is there a way to automatically start / push the carts when the server starts back up?
  7. Offline


    any updates on it?
    at the moment all your new releases are a bit buggy :(
    - NoLagg / Non Drop Items, Memory Leak
    - My-Worlds "normal" Nether/End Portals
    - Train Cart portals

    Do you recommend to downgrade? Or is their anything we can do.

    best regards
  8. Portals are not working with trains yup, they are normally created, you get the server feedback it's been created, but the trains are not teleported, empty or loaded

    Ho and by the way, adding the item pickup/deposit is great. Would be even better if it could pickup loots on the ground, nearby the rails

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


    xMasterPx Got lots and lots of things to do, so development on my plugins is going a bit slowly lately...I guess it will resume next week when I'm done with the exams.
  10. Offline


  11. Offline



    Could I request some sort of optional buffering system for calculating routes?
    The network on my server is huge and whenever someone hits an intersection that hasn't been picked up by the plugin, the server grinds to a hault, kicks everyone, goes back to normal after a few minutes.
    To get an idea of how big the network is, go to in your internet browser - the red lines are the railways, the orange dots are stations.

    + Good luck with your exams, I'm almost done with mine.
  12. Offline


    With MinecartMania pretty much dead and without a developer, does this support MinecartRevolution? Anyone get issues using the two together?
  13. Offline


    andrewpo Craftbukkit is really bad with cross-thread access, so I can't run the calculation on another thread unfortunately. However, technically it should be possible to limit the maximum time spent on this calculation and simply stop searching at some point. But this will obviously cause the cart, which requests a search for the position, to go into the wrong direction.

    Zeathy some features in MinecraftRevolution only operate on single minecarts (for example, teleportation). When an entire train is used this will cause the train to split up, and break apart. But other than that, no, it will operate along nicely.
  14. Offline


    HawkEye manages to do all its database searching/etc in a way which doesn't lag the server at all - could you possibly look at how that works? Stopping the calculation before it completes wouldn't work in my favour =/

    Also I recall Minecart Mania used to do all its number crunching in another thread, but that project was discontinued.

    Thanks for the prompt reply.
  15. Offline


    Siehe Thread weiter oben /\
  16. Offline


    Hey, I noticed in versions 1.67 and 1.68 that the switcher signs works even without power.
  17. Offline


    me switcher not work at passenger sorted :mad:
  18. Offline


    DUDE!! sweet plugin its on my server but most of the tut videos are not there no more =[
  19. Offline


    @Chrisofffafa did photobucket close down or something? There still is the WIKI luckily, it also contains a lot of help on the features.

    Btw: Now my Spout related 'to-do's are pretty much done I can update my plugins again, starting tomorrow. If there are any problems, I will look at those then. Been very busy in the past 3 weeks...
  20. Offline


    i cant sit on the train/cart, it throw me out when it move a distance
  21. Hello,
    I'm trying to use the "wait" sign for a subway-system.

    How does it work in it's actual form (1.68)?
    Does it check the next 50 (or another number) fields or does it check the area to the next wait sign?

    And ist it possible to use it for controlling a line merger? So avoid trains from A and B colliding .

    Line AC an BC share the right part of the tracks....


    Hope my wishes are not too special ;)

    Kind Regards
  22. Offline


    MatthiasGue I still don't know how to go around the wait sign. The problem is that, if you do a 'check rails and ahead' check, it can still fail if both trains enter the piece at the same time. I decided to go with this solution, but it is slightly complicated (and not implemented either):

    1. You define the rails to detect minecarts on (clicking, works the same for detector signs)
    2. You place a wait sign underneath the junction
    3. The wait sign will keep track of trains inside the area and set what train to let through first (track map is already implemented, so that is easy)
    4. It will only let one train through at a time (waits until the previous train has left)
    This will basically make the wait sign wait the '2 or more' trains waiting to get through the area. Once that first train left the area, the next train enters, and this goes on like this.

    The difficult bit is: I actually don't want to force selection of the tracks, so I will have to find out some way to detect the nearby tracks to wait for. I guess a radius fits best as a default for now.
  23. bergerkiller

    Hello again,

    i thought a bit on the "wait" sign (I have no knowledge about Modding, so I don't know if it's possible):

    What do you think on this?
    View attachment 9912

    That would be a system like the 3rd and 4th line of the "destination"-sign.
    1. Line: declares if it looks for trains or carts (like on every other sign)
    2. Line: It's a "wait"-sign
    3. Line: The name of this sign (Other signs can target this sign with it's name)
    4. Line: The Name of the target sign

    -->this sign looks for carts/trains in the area between itself and the target sign.


    View attachment 9913

    The two tracks at the bottom end in the line at the top.

    The signs would look like this:
    View attachment 9914

    They have their name and both target the sign in the background (named Middle).

    The sign which has the shorter distance to the target comes first...
    (Sadly I have no idea how to code it)

    View attachment 9915

    View attachment 9916

    The sign in the front has two targets:
    Left, the sign on the left track and
    Right, the sign on the right track

    They are seperated with a ",".

    So this sign checks the whole T-Layout.

    The wait sign checks the path in the "destination"-direction (destination of the current train).
    If this should be used the text in line 4 is: "destination"

    (Something like path-based signals in OpenTTD :))


    (For thoe who like German, I can explain it, as well :))
    _frozen likes this.
  24. Offline


    There seems to be a small issue with TC... Not sure what the cause might be though...

    2012-06-06 10:06:05 [SEVERE] Could not pass event VehicleEntityCollisionEvent 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(
    Caused by: java.lang.NullPointerException
        at com.bergerkiller.bukkit.common.utils.BlockUtil.getBlockSteps(
        at sun.reflect.GeneratedMethodAccessor283.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        ... 15 more
    Latest RB, and latest version of TC.
    Thanks :)
  25. Offline


    I would like to request a Tool Repair sign. You place tools in a train and it combines them to repair them. Perhaps there could be a number at the end of the second line indicating the maximum damage value allowed for the result. So:

    repair 1

    All tools in the train are used to craft repaired tools up to a damage of one (a perfectly new tool is not made). The plugin will have to check that it doesn't waste damage value by combining tools that are only slightly worn. Perhaps this could be an option as well on the second line:

    repair all

    The 'all' representing repair all tools, even if it wastes damage.

    The third and fourth lines could be for listing what tools might get repaired.
  26. Offline


    Love the ability to use this. I've tried searching through the thread using the 'search this thread' option above, but for some reason, I get ALL threads on the forum when I search.

    I know that compatibility with MineCartMania / MineCartRevolution has been discussed in here in earlier posts. Has anyone attempted to use this with 'SimpleCarts?' That is the plugin that we have for our minecarts. While it work really well, I'm noticing that trains (more than one cart) will not stop at the blocks that are put down on the ground (such as obsidian for stations, bricks for intersections, etc.)

    Has anyone used these two together with success? I'm guessing they are interfering with each other, or maybe I have something wrong in the config. By themselves, the carts work just like they are supposed to. The only problem I have is when I try to run a train through these types of blocks.
  27. SimpleCart says:

  28. Offline


    Nadious the problem is that 2-or-more cart sized trains have something called 'torque'. SimpleCarts will halt the front cart completely but then leave it alone, while all other carts still have enough momentum to move the front cart forward. This is inevitable and can only be fixed at SimpleCarts' side, either by continuously stopping the cart until it no longer moves, or by hooking into TrainCarts, obtain the entire group the cart is in and stop all of them.
  29. Offline


    Hey bergkiller, in version 1.67 and 1.68 I have a problem with arrival signs. I had correct trigger signs in previous versions, but they don't display anything anymore. Sing Link reports that the signs are linked. Doyou have an Idea why they don't work?
  30. Offline


    what with my problem !! :'(
  31. Offline


    Happylosertempo Weelll I would first have to know what you used on your sign, a screenshot would be most useful.
    It should be this to sort carts with passengers:
    To sort trains:
    Or you can use empty as a keyword.

Share This Page