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


    kinkinhood the first number is always read as the count to transfer, for example:
    Will transfer 23 item stacks with material type 4. When '23 ' is left out, it will read the 4 as a count.
    To avoid this, add a space in front:
  3. Offline


    Ah alright. That helps a bunch!
  4. There is no way to do this reliably right now. Supporting tracks like these is not too complicated, though. I can probably code it in... assuming bergerkiller doesn't mind :)
  5. Offline


  6. Offline


    bergerkiller You're making the destination system even better? That's awesome!
  7. Offline


    kinkinhood well I am going to reduce the amount of Strings used. It will now use actual nodes mapped on a geological location in the Bukkit server. When requesting the 'PathConnection' to a certain destination, it will first check if this connection is present. If this is the case, it returns emediately, otherwise it will look at all not-explored nodes of the 'from' node and try to find it.

    Since all nodes are now globally mapped under a single name (the location to a string for tag switcher signs), it can perform these operations a lot quicker while using references to these nodes. Previously the memory was polluted with millions of String objects, not very efficient either as it has to calculate hashcodes all the time.
  8. Offline


    Will it still use tagsigns or will those need to be replaced?
  9. Offline


    kinkinhood no, the tag and switcher signs will remain present. I am only altering the framework behind it a bit to be more efficient and more versatile. BTW: it all works 100% now, even looks for alternative routes when a route got altered. (tag sign removed, going to do that real soon, to remove tag signs of which the track/sign got removed.)
  10. Offline


    As an odd idea, is there any way to set it up to set up a tag based on an item that's in a storage cart?
  11. Offline


    Sounds good :D
    Do you know if the path finding will be updated within the next week, and a new version released?

  12. Offline


    kinkinhood yup, there's a separate tag you can put on the sign:
    It will then turn left/right if the cart contains wood. It's a bit undocumented right now, it will probably become like MM had:
    Since I have limited space.
    Will eventually do the same for player inventories:
    Item in hand:
    And player names:
    But this is not yet added.

    andrewpo probably not this week, maybe in the weekend. Got lots of other things to do tomorrow :)

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


    bergerkiller alright, so no space between item and the type of item(itemwood, itemgold, etc)? and can it require a particular number of said item?
  14. Offline


  15. Offline


  16. Offline


    Is the newest beta compatiable with .. apparently they dropped the number system, but CB RB 1.1-r1?
  17. Offline


    It hasn't shown any issues on my server, so I'd assume yes.
  18. Offline


    I can't get it to work on CB 1818,

  19. Offline


    Ow let me just upload a temp. 1.18 version then. Use oneway on the second line to prevent train destinations made into that direction.
  20. Offline


    I posted my error above if it's at all helpful; and do one way signs work now? :D
  21. Offline


    andrewpo you need to use the Beta versions found on GitHub, the 1.54 version doesn't work the slightest.

    Thulinma (since I can't contact you anywhere else)
    I wrote a 'TrackIterator' class. The TrackMap now uses this iterator to generate it's contents.
    I made an iterator class so you can traverse the world without keeping a list of blocks behind. This is especially useful when calculating 'can reach' and 'find' operations. Where possible, a track iterator is used.

    Ok a new beta version is up: beta version 13. This one is completely built for CB 1818 (RB 1.1), complete with event handler support and whatnot. It also uses better path finding for the carts: instead of storing Strings it will store instances of nodes. Persistence is added as well. It still uses most of Thulinma's logic, but I did change a lot of things around in how it was all stored internally.

    This new system also makes it possible to reroute specific modified area's on the map, so this is done. :)

    Other than that, it adds several bug fixes, including an improved grouped entity tracker to enhance gameplay.

    It also contains the 'oneway' sign, but beware: it does not yet have build messages/permissions!

    It also identifies all words starting with these signs as the specific type. For example:

    All point to the north and will only allow carts traveling towards the north. l and r are for left and right and are relative to the sign. b and f are for backwards and forwards (forwards is the default if left empty or unreadable).

    If you place this sign after a piece of track has been mapped, make sure you use a /train reroute or that you break and place the tracks above a nearby (connected) tag switcher or destination. It is build so it will automatically reroute all connected nodes then.

    Also important to node: you can NOT have two of the same destination names on your server.

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


    BETA 1.6 v13 is working for me without error, or at least without any errors I've found. the server log is clean.

    There's a small graphic anomoly though, which I guess could be a bug in 1.1 that I haven't heard. When train carts are spawned they spawn about a 1/2 block above the tracks and continue that way until the train makes a turn, then they snap down into the correct position. they funtion normally otherwise.

    We only use the spawn, parameter, and destroy signs, but they seem to be working normally!
  23. Offline


    McGarnicle could be caused by the new grouped entity tracker; it probably uses the wrong location when first replaced. I'll look at it for a bit...
  24. Offline


    I'm excited to start making use of the one way signs to help make better crossroads.
  25. Offline


    kinkinhood Let me push out some final changes so it has proper build permissions and auto-rerouting.

    The entity tracker issue is now fixed (no more floating/in-ground carts)
  26. Offline


    Btw, meant to ask, do the one way signs need to be powered?
  27. Offline


    kinkinhood no, since these signs have to be final: once detected, it is always used in routing later on. Powering it will require too much processing to reroute all the time.
  28. Offline


    awesome. That makes me happy as a clam.
  29. Offline


    Crap, I think I know why chunks aren't staying loaded - it might be because of CB++... >_>
  30. Offline


    Note: I decided to stop using the name 'oneway'. It's simply too confusing.

    Instead it will be called 'blocker'.

    When powered, it will physically stop trains that try to cross it in the wrong direction. (not even reverse; just STOP)
    It blocks in the direction seen from the sign; you walk towards the text-face of the sign and you get blocked by default.

    Oneway is simply a bit confusing :)
  31. Offline


    I noticed that, it's really annoying. =/
    Thanks for the new release

    Update to beta v13 on the github (link in first post to github 'downloads')

    I'm having issues with cart spawners making them appear 1 block over the rail (instead of directly onto the rail) and at the wrong rotation, are you experiencing similar issues?

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

Share This Page