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


    _frozen That would basically mean 'display name', I could make the '%triggernameN%' this value instead. But it would require you to both set a destination and the new display name at once. That is why I came up with the destination display name, to make both change at once.

    isaacng1997 make sure to set 'keep chunks loaded' to true on the train so they don't unload.
    Do note that there are some issues with this when restarting the server. I gave a test build to someone that runs the server more extensively, if the fix works, I will publish it as a 1.71.

    Lexion thanks, I'll look into it.
  3. Offline


    Then that will work. All I want is the end result :D I ll leave the coding decision to you, good sir.
  4. Offline


    I added:
    • Fix upon starting server (proper chunk loading to prevent glitched trains)
    • Velocity statement (for example, velocity>0.2)
    • Switcher no longer switches when not powered (weird...)
    • Display names for trains, can be set using command and property sign and is used with trigger signs
    • Fixed detector sign statement parsing error (Thanks Lexion )
    I'll see if there is some more stuff I can do.

  5. Offline


    One MORE request and one question

    1) May I request a threshold limiter? If the total carts on the server goes over XXX, destroy all empty carts. (applies to automated systems.)

    2) I have a sign that is the following:

    facing the direction I want to block. Train ignores this, and the previous switcher. (Same location as you checked, though.)
  6. Offline



    1.) Problem with this is that it is a bit specialized. It is sort of like the trigger signs, that too should actually be in a completely separate plugin. Is a /destroyall [statement] system all-right as well? Basically, it would destroy all trains/groups that match that statement. For example:
    I think that is a bit more use-friendly, because automated train destroying gets problematic when user-placed trains suddenly disappear and people get sad. It is a global destroy system...

    2.) Did you use /train reroute? It is possible that it has to re-calculate the path finding of the train, because it detects these blocker signs while calculating. When placing a new one, it does not know it is there and assumes a simple connection.
  7. bergerkiller

    Hi, I have had a search through the forum and have seen that you have implemented a block breaker system. When we used MinecartMania we had wheat/sugar cane/tree farming where the storage cart harvested the farm and replanted the farm as long as items were in the storage chest.

    Have you added these features to TrainCarts?

  8. Offline


    Lexion yes, but only for 1-block radius.

    1.) Set the block types to break

    2.) Set storage minecarts to collect the dropped items
    I think the WIKI does not contain these yet because they have been mostly experimental. (people wanted 3-block break and also block placement added, but those things were a bit unrealistic at the time)

    There is also a demo video lying around somewhere (photobucket I think?) where I demonstrate this feature. Pikcup means that the storage minecarts will automatically obtain nearby items, just like how a player would.
  9. @ bergerkiller

    Ok thanks, do you plan on adding farming features to TC, we have a few player on our server that had them automated with MM and I was going to look at how to convert them to TC. More time for me to do my stuff :)
  10. Offline


    I'm using the newest version, 1.71.1
    isn't working anymore. A few versions ago (don't know number) it changes the speed directly, now it doens't.

    By the way, I think it's better to create the
    and that the sign will give redstone power. You can use every property, like
    So if the property playerexit is set to deny/false/0, it gives redstone power. That will be much better and more useful.
  11. Offline



    When should the waiter-sign be done? With that, my PLC for the rollercoaster doesn't have to be so huge.
  12. Offline


    rcth I don't think it will change much from what it is right now. A simplistic forward-rails check which waits and restarts trains.
  13. Offline


    It waits till a track (or a block for a rollercoaster) is clear, that is exactly what I need.

    By the way, is a switcher based on the trainname already implented?
  14. Offline


    rcth Nope, but I'll try to add a lot more property checks, as well as a proper readout for the /train i. (destination and others are all cart-specific...)
  15. Offline


    Bergerkiller, the following crafter sign configuration will thread lock the server:​
    Item number 114 is netherbrick stairs. We have a custom plugin on our server that allows for the user to craft these. Any time the above train configuration runs, the server will thread lock. Here's the Server error, confirmed by Afforess:
  16. Offline


    So you will use the readout with my check-signs idea??? (see that PM)
  17. Offline


    rcth I didn't bother adding too many properties for now, it's a bit annoying. I did add a name/mobenter/playerenter/playerexit/maxspeed statement for switcher signs. It would look like this:
    It does limit the name to 10 chars on the sign. I will add a 'n' statement as well to bring the max length to 13.

    dockter What do I have to put in the storage minecart to trigger this? I made the exact crafting set-up, but with empty storage minecarts nothing happens. (obviously)

    I am looking at a while-loop in the Recipe util which 'crafts the items while successful', but at some point it should definitely stop crafting...items run out at some point.

    I updated TC to 1.71.2. Changes include:
    • Adding of name/property statements
    • Fixes for the ghost minecarts people were experiencing
    • Addition of javadocs and general cleanup of the code so outsiders can understand it more easily
    • Info command more detailed
    • Fixed the NPE occuring (CraftSign<init> in the stacktrace)
    • Fixed default properties not always applied properly
    This should make TC a bit more stable now, which 1.71.1 apparently was not.

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


    How can I turn off ejector signs?

    &&&also the plugin says stations, and I was wondering if you had to build those in a certain way.
  19. Offline


    whenever i try to install the plugin in the plugins folder it doesnt make a traincart folder and doesnt start the plugin
  20. Offline


    Mammothskier Also put BKCommonLib v1.22 in there, it depends on it. If that fails, send the log so I can see what is going wrong.

    madmax516 You can set the permission to false so no one is allowed to build them. That pretty much disables it.
  21. Offline


    I have some trouble with blocker sign, I tried left & right but it's still block the 2 directions, I also couldn't figure how to make the 4th line work. Is there a known issue with it ?
  22. Offline


    When I do that it doesn't let me place regular tracks.
  23. Offline


    Algent the 4th line isn't used of the blocker sign. The syntax is fairly simple:
    For example:
    Blocks the back side when looking at the sign, and continues the train at the previous velocity when it no longer is blocking into the same direction. Just like stations, there is also the left/right/reverse system in use.

    You can use l and r for left and right, so [train:l] or both, [train:lr].

    madmax516 that seems weird, are you sure there is not another placement plugin involved? AFAIK I don't have permissions running to deny track placement in TC.

    All right the following bugs with 1.71.2 I noticed and have been fixed locally:
    • /Train destroyall will now also clean up bugged carts in chunks...needed to keep stuff rolling
    • Remote control was failing, is now working again. (artifact from previous properties refactor)
    Now setting up a test run to see what is causing the ghost carts. It could be those you still notice were stored in the chunk somehow, but that seems unlikely. I will find out soon enough...

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


    Thanks for the help berger, now it works :), I was trying to use it like on the wiki ^^.
  25. @bergerkiller

    Just updated to TC

    Tried using /cart info and it stuck in a loop and continues to give me the info, have to leave server to clear it
  26. Offline


    Lexion correct, fixes this, but I am in the middle of having a final pre-release test. It is going to fix that and a lot more stuff, including properties not being saved for still loaded trains...


    You can find a pre-release here for now: 1.71.3
  27. Offline


    Works it at 1.3.1??
  28. Offline


  29. Offline


    yeah does not work yet with 1.3.1.
  30. Offline



    I'm noticing some issues with the properties sign. It looks like collision=deny is not working anymore. Even if I tag my train with the pushing and no collision properties, trains will still stop if someone's on the tracks. Also; is there a way to force trains to travel at max speed all the time (even uphill)? I used to use minecart mania to keep the trains moving, and I don't want to have to retrofit my system to include powered rail on the uphill segments (I already set the slowdown multiplier to 1).
  31. Offline


    Astrae yes, you can use slowdown to keep trains moving uphill and so on. Slowdown is a train property you can set to true or false. When slowdown is false, uphill/downhill and regular movement have no effect on the velocity. The velocity is a constant basically. Only by hitting a block / pushing by player or unpowered powered rail can you change the velocity then.

    Pushing players is, by default, only for non-train owners. In the configuration you can set it to also push the owner of the train. It could be the same counts for collision, as I vaguely remember keeping that in so owners could still retrieve/stop the train properly.

Share This Page