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


    I did it like in the video lol
  3. Offline


    @1994mat I can't think of the problem you're having in 1.2.3...sorry for that. Most of the times it ends up the asker made a mistake somewhere and I have to find out the hard way (reading lines after lines and then asking the questions and him realizing the mistake after 10 questions) so for now I can only say: do exactly as the tutorial, the same text, the same circuitry and the same environment and try again. If it still fails it must have to do with the plugin itself (I am throwing in some fixes here and there atm) and you'll have to wait for a version where this feature is working out for you...

    Updated to v1.3, fixing the bug mentioned by @DonDav (also thanks for the good report) and a 'pretty severe' bug of minecart trains duplicating during server reloads. (create event was firing while undoing replacement, was basically copying the minecarts)

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


    Yay for awesome plugins
  5. Offline


    Really awesome how fast you fix the bug and release a new version. Thanks for this. I tried v 1.30 and my station is usable again. :D

    • But while i test it on my station, another problem seems to be since 1.28.

    On my station, both sides of the sign are powered always, so they act as break, until a special button is pressed.
    I have made three buttons(train-spawner), where you can call minecarts to add it to the train.
    The minecarts come from east to the station and connect to the existing train. Meanwhile the station-brake is on and the train stays at the station or just move a few centimiter.
    But since v 1.28 the train seems to lost the connection to the station-brake, when a new minecart connect, because it push.
    I made to new videos for that, because of bad english knowlegde.

    The first vid is v1.27 - The brake is ok and i can construct an individual big train. (Accidentially i made the first video at night, i can make a new if the sight is to bad.)

    The second vid is v1.30 (but testet also with 1.28 & 1.29) - Most times the train will push away. I made a automatic comeback of the train only for testing purposes.

    • Another problem i found:

    When you put the leaver in front of the station-block, it shows when a train is on top. When the train leaves the leaver turns off. But when i remove the train from the trail or use the "destroy"-sign the leaver stays on and i had to manually turn it off.
    Made two videos again, one on my station, one on my testrack:

    • Last
    i need help with the powered minecart. Most of my tracks are with booster-trails, so no powered minecart is needed. But i was testing it today and see that the powered minecart is not moving, when i put some coal.
    Can you explain me the "poweredCartBoost" value in the config?

    Best regards, DonDav
  6. Offline


    You need to put coal into the powered minecart 'facing' towards the direction you want to go. If you want it to go forwards, stand behind the powered minecart and put some coal in it. The boost value is basically how fast it will go, added it since the standard speed is ridiculously slow.

    I see I need to add checks for the station sign if a minecart group is destroyed, this could be done by sending a group_leave event to onSign. (this toggles the lever off in the end) I'll see what I can do about that. *fixed*

    The station-locking issue can be resolved, I'm sure of that. My guess is that, upon linking, the station target is lost. I'll add a little bit more code to 'lock' the group so it can't possible move. *fixed, trains will re-active the station when linking*

    Also going to add (cross-world) train teleportation using MyWorlds. It will use the portal defined there to teleport the trains when driving over a [portal] sign. *added*


    Fixed the first two issues. I am glad I already had a sign-framework to start with, else this was pretty much impossible...

    Huge plus: you can now make trains cart-by-cart by using a station and train spawner. When in brake-mode it will automatically centre the train above the sign. Pretty awesome. :)
  7. Offline


    I seem to be having issues with the station signs. Every time I try to add the sign it says I do not have the permissions. My account is an admin account.
  8. Offline


    @kinkinhood you need to add permission nodes to yourself, only possible if you use Bukkit permissions. (see main page) If this proofs impossible make yourself an OP, ops can use all TrainCarts signs.
  9. Offline


    My account is actually an admin account. I'm using group manager with permissions 2.7
  10. Offline


    TrainCarts doesn't support the permissions plugin (because it is supposed to die off, will probably become unusable after 1.8). You can try a few things:
    - Open the plugin in Winrar and edit the permission nodes (bottom part) of the plugin.yml to set them all to true
    - Use Bukkit permissions (alongside)
    - Make yourself an OP (/op <playername>)
  11. Offline


    That works, thanks!
  12. Offline


    I am still having the problem with my minecarts dissapearing. Only trains dissapear, not regular minecarts. Does anyone else have this probelm. When my server restarts, all trains dissapear. In the server log it says that they are loaded, bu the minecarts are gone.
  13. Offline


    @jeremytrains try doing a global world save and then reloading, and see if it makes a difference. Also, update to v1.3, since single-minecarts are also trains now. The newer version could fix this.


    Ok good news, all TODO's are done. Train teleportation using MyWorlds works too, with MyWorlds' permissions and messages, and completely autonomous. Can also be activated using redstone.
  14. Offline


    Ok, lemme go and try it now
  15. Offline


    @DonDav Updated to v1.31 fixing the station bugs you mentioned, also adding train cross-world teleportation using MyWorlds. Reason I don't use my own sign system for TrainCarts is that:
    A. Requires yet another settings file and workload
    B. Requires me to clone MyWorlds permission system, it now uses MyWorlds permissions

    I'll make a video for this later on.

    Also: IMPORTANT. The newer version uses SignLink version 1.01, not updating SignLink will cause arrival signs to fail.
  16. Offline


    Getting this error when a cart goes over a trigger.
    22:42:23 [SEVERE] Could not pass event VEHICLE_MOVE to Train Carts
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
            at java.util.ArrayList.RangeCheck(Unknown Source)
            at java.util.ArrayList.get(Unknown Source)
            at org.bukkit.plugin.RegisteredListener.callEvent(
            at org.bukkit.plugin.SimplePluginManager.callEvent(
            at net.minecraft.server.World.entityJoinedWorld(
            at net.minecraft.server.WorldServer.entityJoinedWorld(
            at net.minecraft.server.World.playerJoinedWorld(
            at net.minecraft.server.World.cleanUp(
            at net.minecraft.server.MinecraftServer.h(
    I've tried deleting my configs for both TrainCarts and SignLink, the jar's themselves, and everything inbetween. Any suggestions as to what I'm doing wrong?
  17. Offline


    Ok I'll look at it. Also, thinking of adding player-specific text features. For example, show specific messages to specific players. It is possible, only not sure how I can do this...
  18. Offline


    The problem seems to have fixed itself after changing the variable name. Apparently it didn't like j1 or j2 as a variable name
  19. I'm having an interesting problem with this plugin:

    If I have a station that has tracks going in both directions (not an "end" station, so to speak), I can't seem to be able to stop trains on it at all. Powering both sides of the station sign does freeze carts on top in place (they cannot be walked into anymore) and I am able to launch them by removing the power on one of the sides, in either direction, no problem. However, if a train arrives at the station while both sides are powered, the train goes right through the station without stopping or slowing down, then several squares after the station (about 5 or 6 or so) the train suddenly reverses direction, going through the station again in reverse. About the same distance on the other side, the train will reverse again, etc. This keeps going on until I remove the tracks, station, or carts. This has been reproduceable on my server 100% of the time, no matter where I make the station or what is around it. "End" stations do not seem to have this problem for some reason, and incoming trains stop just fine in those stations.
    Weirdly enough, this only happens if the station sign is powered by redstone. If I am powering the sign with two torches instead, trains stop 100% of the time. Even weirder though - launching no longer works when powering the sign with torches. So: launching only works with redstone, stopping only works with torches. Confusing/strange, right?

    I already tried:
    - Changing station size to very small, very long, several sane sizes and leaving it off (auto). Same effect in all cases.
    - With and without a delay set. No changes.
    - Several options on the last line (no option given, continue, stop), all have the same issue.
    - Removing all other plugins leaving only TrainCarts, doing a clean shutdown of the server, restarting it. Same effect still.
    - Also same effect after repeating the above and deleting the TrainCarts config dir, letting it re-create the default on load.
    - And destroying and re-creating the station and train in between all of those, just to be sure.

    I am extremely confused and can't explain what is going on here... It's definately not a lag or server load issue: I'm playing on a LAN and the server has never been above 20% total CPU usage during these tests.

    I was using 1.29 when I first started experiencing this issue, and my first response was checking for updates, and before all other tests I first updated to 1.31.

    Any ideas as to what I can try to make this stop happening? Obviously it must be something in my config, or everyone would have this problem. I just don't know what I haven't tried yet, I don't think I missed anything... Help?
  20. Offline


    Hm as i said with the signs link its hard for me to time it all it would take days because i am going to have a massive sub way sytem so is it possiable some how you can make it it self times or somethink?, idk but it would be hard thanks :)
  21. Offline


    @Thulinma thanks for the good explanation. I may have a clue where this issue lies. Blocks have to types of powering: indirect and direct powering. I use indirect powering for the brakes, but that is for the SIDES of the sign. I also use indirect on the sign itself, which could be an issue in this case. I'll see if a combination of indirect and direct powering rules can fix this issue.

    *fixed by checking all 4 directions for power, instead of the sign itself

    @King_KYl3 I can make it start calculating a time when a train drives over it for the first time and stop the timer once the train stopped. I'll see if I can come up with something...

    *now possible to do this using a stopwatch:
    - drive minecart over it to start, stop or destroy the minecart to finish
    - Power the sign to start, remove power to finish

    Now updating both TrainCarts and SignLink. (since SignLink got changed, got to keep TrainCarts compatible)
  22. Hey I just tried to make a self sustained train, with the coal in chest thing, it works so far but when it reaches a station it can barely stop the train for a few seconds no matter the delay set on the sign :/ is there a way to fix this ? Because I don't want to use powered rails every few blocks just to keep the cart going.
  23. Offline


    @Digi Never thought of powered carts at stations...very good point. Can only think of ignoring the powered carts when the 'group' is in a station...may prove hard.
  24. Well, if you can stop the powered minecarts with code do it when the station is reached and when the carts are beeing pushed just activate the powered minecarts in the group :}
  25. Offline


    Wish it was this simple @Digi hehe :)
    Problem is all this 'pushing' is in the physics coding, far away from the actual group coding. It's like telling a fly how to get to another fly on the other side of the Earth...
  26. Yup, fixed the issue for me!

    I should note though, that using torches to power signs instead of redstone, I am still unable to make the station do anything besides stopping carts. When using redstone to power signs, it works perfectly now :)
  27. Offline


    @Thulinma yeah I noticed that you need a delay when the redstone is off. It would be far better to launch and ignore the next 'brake' redstone command. Problem is that this conflicts with the 'next station principle'. I have to use station-specific settings on the trains then, so only the station that previously launched the train will ignore the brake. Also, powered minecart issue 90% fixed (powered rail brake issue (possible) with it)

    I'll see what I can do...
  28. Offline


    @bergerkiller Just want to say that i have tested 1.31 on weekend and my station runs great now. Thanks for the good work.
  29. Offline


    @DonDav no problem. :)
    Btw if anyone spots some other issues (that are not in the known issues part) feel free to ask so I can look for some more fixes for 1.33.

    Ok updated to v1.33, fixing the bug @Thulinma mentioned (I hope) and makes the default settings 'better'. (I noticed a lot of minecart bouncing, forcer was set too high)

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


    The maxCartSpeed: 0.35 has no affect on cart speed as of 1.33. Please advise when this is resolved.
  31. Offline


    @dockter in combination with Minecart Mania I disabled the maxCartSpeed setting to allow full use of max speed signs. However, I could make it less strict in that. (set the max speed of individual minecarts upon creation and leave it alone afterwards)


    Good catch anyway, it indeed did not use the maxspeedsetting. I thought I added an else in there, setting it, but that was not the sets the max speed upon creation. *uploaded v1.34 fixing this*

Share This Page