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. 1.49.1

    Took the train, spawned correctly. Came to the train station, got ejected correctly, train got destroyed. OOM a minute later

  3. Offline


    @Psychokiller1888 reuploaded it, it should work fine now. It was removing the member in the block change event, causing the next getGroup to return null (it has no group any more)
  4. For the people that use the 1.0.0 link from the main post - I've just updated it to include all of bergerkillers latest fixes. Same URL, just re-download to get the new version.
    robxu9 likes this.
  5. First train was ok. Then, a minute after

  6. Offline


    Need more information such as bukkit version.

    This currently does not function on 1.0 CB dev builds, I don't expect anything to be done until Reco but this is just a heads up. Also I have suggestion/request for nlagg but will post it on your thread for it.
  7. Offline


    @Psychokiller1888 CB build is OK I guess, since it called the s_ function. But you may have to update TrainCarts itself, since it has a NPE on an impossible spot. (could be a previous version had that, check Github)

    @ledhead900 Request? :)
  8. Offline


    My bad I wrote it all in this thread and then decided to split it up into the correct threads as the request was for nolaggs :) , sorry about the confusion I will edit my post.
  9. There's a build that I made for 1.0.0-based versions of CB, linked in the main topic. It works on all the latest dev builds of CB :)
  10. Offline


    There is too!. Thanks I will look on main thread of the others and see if they have them as well :)
  11. Welll, it's the 1.49.1 second version, the one you reuploaded. So gonna redownload it and try again...
  12. Offline


    its just that when i place some trains, how shud i remove them? when i remove them by breaking all with hand they leave some green lines that are moving and i don't know how to remove em! help please :(
  13. Offline


    @tomas1523 say whut? Green lines...? (screenie plox)
  14. Offline


    il try, but theyr not there anymore... when i get one, i will send it to you

    those lines are gone but if you find anything like that, they were moving around and following where the carts were destroyed, and also... new problem :(
    21:25:24 [SEVERE] Unexpected exception
    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(
    21:25:34 [INFO] Connection reset

    sorry for wasting your time but please help :oops:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 18, 2016
  15. Offline


    Probably another case where getGroup returns null...


    @tomas1523 updated version is on GitHub.
  16. Offline


    Using "/train slowdown false" doesn't seem to work reliably. It seems to work about 50% of the time (usually have to push a train 2-3 times before the speed gets "locked in") but ultimately ends up failing at random. Sometimes it will go 20 minutes before slowing down, other times it's lucky to last 20 seconds.

    Happens the same way on both the 1.9pre5 builds and the 1.0 builds linked in this thread.
  17. Offline


    @Serejai don't forget that corners and elevated (sloped) parts do slow the cart down, not sure if I should change this behaviour because of rollercoasters and realism...
  18. Offline


    Ah ok, that would be why (though it also seems to slow down if an animal boards the train).

    Perhaps this could be a setting somewhere? As it stands now the infinite speed is exactly what I need, but I can't really use it because my tracks have inclines and stuff. Was hoping to avoid having to use any ugly powered rails as I would need hundreds of them :/

    Also having issues with trains randomly disconnecting. I've tried adjusting the cart distance and that doesn't seem to help. They just randomly split apart (even on straight tracks).
  19. Offline


    @Serejai if that happens, try increasing the max cart distance. At this distance carts auto-disconnect. Note that setting it too high can cause weird behaviour during (partly) derailments.
  20. Offline


    I like how it does that, I only had one issues with carts disconnecting on server stop and or chunk unload :confused: and that was with the current (CB L33T) Build. Prev version or two did not disconnect trains like it is doing now, You still remember our test server details as it happens on a single corner every time server stops or chunk unloads. I have not tested this with the 1.00 version yet but I have that one installed currently.

    The train has no reason to disconnect as the corner only has one bend before a straight section. I do try very hard to build the tracks using trains to keep a straight before and after the bend.
  21. Offline


    This is so frustrating. I did the exact setup as the video. train stop for 5sec and continue to left. It's a cart of 5 and it stop at the middle of the cartlink. after 5 seconds, it moves and stop on the 4th cart... It gets locked from the cart behind and the whole system just jammed.
  22. Offline


    @ledhead900 Could you make a screenshot of the setup and post the configuration you used? Then I can go and replicate it. In the screenshot, define which direction is North or make a screenshot while looking into a certain direction with F3 active. In these cases direction (NORTH/WEST/SOUTH/EAST) are very important. You can use the fact that clouds move north.

    @DJRiful Interesting...that means that it notices the last cart when it just left the station. I'll make it exclude the last (tail) cart when using GROUP_ENTER.


    Now prevents the last cart from activating signs for the group. Also throwing in yet another large batch of performance and general improvements to make everything more understandable, and thus decrease the chance of it failing.
  23. Offline


    Sure thing, I will get to that after work.
  24. Offline


    Hello, could you please make dev version which is compatible with 1.0.0 and latest Bukkit build? Thanks in advance.
  25. Offline


    Here is the image you wanted for the track design to test.

    # In here you can change the settings for the TrainCarts plugin
    # Please note that the default settings are usually the best
    # Changing these settings can cause the plugin to fail
    # To reset the settings, remove this file or set 'use' to false to ignore these settings
    # ======================================================================================
    # cartDistance is the distance kept between normal/turned carts in a group
    # cartDistanceForcer is the factor applied to adjust this distance, too high and it will bump violently
    # nearCartDistanceFactor is the factor applied to the regular forcers if the carts are too close to each other
    # removeDerailedCarts sets if carts without tracks underneath are cleared from the group
    # maxCartSpeed is the maximum speed to use for trains. Use a value between 0 and ~0.4, > 0.4 can cause derailments!
    # maxCartDistance sets the distance at which carts are thrown out of their group
    # breakCombinedCarts sets if combined carts (e.g. PoweredMinecart) breaks up into multiple parts upon breaking (e.g. furnace and minecart)
    # spawnItemDrops sets if items are spawned when breaking a minecart
    # exitOffset is the relative offset of where a player is teleported when exiting a Minecart
    # pushAway settings are settings that push mobs, players, items and others away from a riding minecart
    #    atVelocity sets the velocity of the minecart at which it starts pushing others
    #    force sets the pushing force of a pushing Minecart
    #    pushMobs sets if mobs are pushed away
    #    pushPlayers sets if players are pushed away
    #    pushMisc sets if misc. entities, such as boats and dropped items, are pushed away
    # keepChunksLoaded sets if chunks are loaded near minecart Trains
    use: true
    It appears It may be a different issue, I been following the carts around the path tonight and I realized that each time they stop they became unconnected as when I push them back into a train again the steam comes out and the whole thing works like clockwork.

    I think it may not be the track at all but instead the train stops due to disconnecting.
  26. I just updated the download link for 1.0.0 in the topic to be a 1.49.3 build for 1.0.0. - that includes all of bergerkiller's latest changes :)

    Edit: @bergerkiller - is it just me, or did all signs under tracks stop working in 1.49.3 for single carts? Stations, tags, property changers - none of them work for me now unless my train is at least 2 carts long.
    Edit2: I think because you're skipping the "tail", and with single carts, the only cart IS the tail, single carts stopped triggering signs. :)
  27. Offline


    @Thulinma let me trace it back, could be an issue in the MinecartGroup doPhysics coding, at the point I distinguish grouped physics and single-mc physics.


    Ok updated it (.4) I'll commit the changes so you can put them in the 1.0 version.
  28. K, 1.0.0 link updated to 1.49.4.
  29. Offline


    At WebConn, we are using mine carts as a "subway" system if you will and wanted to know if there was support for forcing one way on a given section of track or something. If this isnt already a part of the plugin, it would be a great feature.
  30. I've been having issues with "one way" rails as well, so I've been thinking about adding something like this. For right now, we're using a system of roundabouts with two lanes of rail attached for every connecting direction. This works almost always, but sometimes the destinations system decides that going the wrong way is faster (which it is), reversing the train on the roundabout - which is obviously not wanted behaviour...

    One way can be "forced" though: make a straight rail, but have a bend going to the side somewhere in the straight part (off into "nothing"). This rail is then "automatically" one-way, since all trains coming from one direction will derail and from the other direction they will not. The destinations system can "see" this and will make sure your trains do not derail and take the other rail. Not very pretty, but it works for now.

    I'll see if I can add something more... subtle :)
  31. Offline


Share This Page