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


    @Celtic Minstrel I uploaded it there since it would look bad on GitHub. I'd have two TrainCarts.jar files there, people could get confused. Until a RB for 1.8 is out I keep it there.

    @LinkDude80 Unfortunately no. It will de-link when the cart is wandering off though. (4-block distance)
    Reason I didn't add an 'unlink' or 'train split' sign is that the minecart could link again instantly if the cart is near the cart it got de-linked from. I do see a potential there, I'll see if I can implement something like it. (disallow linking when ontop/near a delink sign?)
  3. Offline


    that worked!
    Last edited by a moderator: Nov 13, 2016
  4. Offline


    I have a question since I will be removing minecartmania for this as this essentially would be more fun and it has eject and stop and station signs so its all goood, but I would like know if you could bind the cart placement to a user so that as we place down a minecart onto the track other people cannot simply just destroy it.

    That is a pretty big thing for me as imo what is point creating trains if others are just going to destroy them.
  5. Offline


    @ledhead900 easily possible, but what happens when two minecarts of different owners connect? Disallow linking? Set a group of players for the entire train? What if one player has permission to link (use TrainCarts) and the other not, and the minecarts collide? Allow linking then or not?

    I few logic issues I'd need to get around first. Also, train owners would not be persistent over server reloads (or I need to change the save file again to contain owners) If you got some idea of how it should work, go ahead. :)
  6. Offline


    Alright then another question, You claim its compatible with Minecartmania tho your having a hard time working out the request, Minecartmania already has an option to bind the placement of the cart to the user who placed it. So how exactly does that not effect the situation you are telling me ?

    My solution would be a simple one just have one more command that toggles future placement of carts as linkable then I would store this data along side the train data then the train data would would be linked to the user who initially pushed them together, This would stop the other users simply doing it as the carts placed are already saved and bound to the user who placed them. This would also stop carts merging with other carts that the user did not place.

    I would probably also add a selection command separate from the other request where by sitting in one end of the cart and using a special command will tell the train to not connect anymore carts effectively making max train lengths and stopping the joining of any more carts to the group until the command was toggled again inside the same group additionally by allowing this to happen I would also need to code in a chat display msg alerting the user what group number they are actually riding in so that they can actually remember and tell what group of carts they are sitting in.

    I don't actually know any code but that's just an idea I put forward that is far from 100% plausible
  7. Offline


    In other words: minecarts must have the same owner if you want to link them.

    Not sure about the second request...a command to disable train linking of the train you are in. Rather use the first one to set groups.

    Only one issue: how to set multiple owners? I could go and make a list of 'friends' that can share and edit a train, but it is not really straightforward.

    I guess I'll do this for simplicity:
    - By default: train can be pushed, removed, and linked by anyone (no owner)
    - By using /train setowner <names...> you can set owners
    - Owned trains can only be pushed, removed and linked to minecarts placed by the same owner(s)
    - Owned trains CAN NOT attach to trains spawned by the train spawn sign (no owner)

    Also, adding a list of train owners is simple. But how to respond to it can be a bit harder. :)
  8. Offline


    Are you going to update this plugin? I hope so.
  9. Offline


    @Sixosable update for what craftbukkit build? I'll export a 1.73 and one for the latest build ofc, but builds change. :)

    Also: trains now have owners, you can set/display owners through two commands, and trains that don't have matching owners will not link. Now adding an option to auto-generate groups upon placement.
  10. Offline


    Well, if you need to base the idea off of something, use LWC's multiple owner system. It allows the original owner of "x" container to add people to a list of people who can access "x" container, as well as removing them from a list. Admins have the ability to force an ownership change, to modify any list bound to "x" container and such. Also, there is no chestcart protection, so that would be a nice addition.

    Merging carts could be handled as such: 1. Player A adds Player B to the list, using a command such as /tc buddylist [name] 2. Player B does the same.

    Now that they are on each others lists, they have the ability to merge carts, becoming a train. Any admin can use a command such as /tc unlink [name A][name B] which allows them to unlink the carts of the 2 "buddies". Let's say that the 2 buddies don't want all of their carts to be merged together. You could make a sign function (with the first line saying [train cart], the second line saying Player A's name and the third line saying Player B's name), that, when both players pass over the brick with the sign under it, any carts in the respective trains they are in then have the ability to merge with each other. This wouldn't need to be a permanent list, therefore no need for it to be persistent.

    Just some food for thought.
  11. Offline


    Cheers, So is this in the dev build for 1.8.1 or your git up ?

    I'm using the daily builds on my test server getting ready for 1.8 as I'm building the maps on there and testing plugins out and things, Tho I'm currently waiting on BananaSpace Gen to update, This works perfectly fine in 1.8.1 on " Craftbukkit version git-Bukkit-0.0.0-1058-g66cb6f6-b1169jnks"

    I did not notice some slight imperfections tho, I am running on a clean server only have
    Actually I am better of showing you what I am running.
    " 2011-09-22 02:24:51 [INFO] Plugins: BorderGuard, Essentials, EssentialsProtect, FalseBookBlock, FalseBookCore, FalseBookExtra, FalseBookIC, LazyRoad, Multiverse-Core, Multiverse-Portals, NoLagg, SignLink, SkylandsPlus, WorldEdit, BananaSpace, Train Carts"

    I must your TNT plugin ROCKS, I detonated sky limit worth of TNT in 4x4 squares not even a pause :). Anyway I build I coaster and when I logged out and came back in one 2 carts become none connected to the what should have been a 6 long train.

    My assumption was that as u might have noticed the Chunks are SOOO slow to load in 1.8 for some reason it takes for ever and you can see thru them for like 2mins.

    I assume this caused the train to un connect. Otherwise its working fine. This is just my test server I am using to build the worlds for my main server while I wait for bukkit reco.

    Question about your implementation of owners that's seems perfectly fine to me as that is all I wanted to do was make groups that would not merge with everything it hit, anyway How exactly does one claim such a group ? I read the /setowner part but when do you use the command, Do I hop in the train group and use it or does it know I created the group to start with ?
  12. Offline


    @DeathQueen ai that becomes rather complicated that way...requires me to set train names too.
    Aw well it was inevitable. :)

    I'll add a name property so players can set names to trains, possible adding a broadcast message too. Remaining bit goes through Bukkit permissions.

    TODO for this idea:
    1. Set train name and store in groupdate
    2. Auto-generate name upon placement (train<number> format)

    2. Set train owners (admins can override it) *done*
    3. Train properties
    4. Automatic train name generation
  13. Offline


    Lol I wouldn't know. Just suggesting a method, though, i still think the whole temp buddy list-sign thing would be a rather good thing to add.
  14. Offline


    Do you have a list of all commands and everything
  15. Offline


    There are none, as far as I can tell.
  16. Offline


  17. Offline


    Why don't you add a spoiler listing the To-Do List?
    Show Spoiler

    TODO for this idea:
    1. Set train name and store in groupdate
    2. Auto-generate name upon placement (train<number> format)

    3. Set train owners (admins can override it) *done*
    4. Train properties
    5. Automatic train name generation
  18. Offline


    So 1.8.1 CB 1175 is out now fixing orbs as best as they can go for now apparently and I just watched 1176 be built :p.
  19. Offline


    When I see 'add' I mean 'add in my Eclipse project'. As soon I say updated in big black text you can know it is added. :)

    (why update a version that has no noticeable changes?)
  20. Offline


    No reason Orbs seems like good fix, anyway Im using your NOlag plugin right now testing it out its freaking sweet I set tnt to 5 and wow I set a whole chunk to tnt its gonna take at least 1hr to explode it all, but NoLag good job :).

    and oh ok so its not released yet :(. I just noticed another bug btw this time when I restarted the server one of the carts had derailed.
  21. Offline


    Is it possible to set an owner of an entire track? So no one can put their carts on the track and screw up other carts or remove carts on tracks they dont own? Or is this only for the trains themselves?
  22. Offline


    @Omen only for the trains themselves. For track protection it would be wiser to use a some sort of world region/guard plugin. Not sure if 'place minecart permission' is added in there plugins, you could request it.
  23. Offline

    Celtic Minstrel

    I would say that, if possible, you should have a way of setting owners without using commands. For example, in SimpleSignEdit, you right-click a sign with a feather, and then either punch the new owner or enter their name in chat (no command; just chat). Of course, that doesn't allow for multiple owners, so it would be a bit more complex for you.
  24. Offline


    @Celtic Minstrel I could use SignLink of course. (add an onSignEdit event and handle it in TrainCarts)
    For now I will keep it simple. You can manage your own train as you wish, add owners, add passengers, anything. Admins can do this for all other trains too. To change a train, enter it and perform the command. No minecart to enter? Right-click it and it will remember the train.

    All still TODO of course. I am now improving some general coding, of which forcing a group and MinecartMember on all minecarts to make the code a bit more slink.

    Status update: got the 'core' working. You can do the following atm:
    - set a train name with auto-name generator
    - set individual train owners and allowed passengers
    - set train enter messages train-specific
    - set if mobs can enter the train
    - set if the train allows further linking
    - show all the above in a nicely formatted /train info command

    - Edit a train by entering/right/left clicking the minecart, all calls in the future will use this minecart

    - Permissions:
    - Setting node for config file:
    Other than all this, did some serious reworks of older code to make it all a bit simpler and solid. Main changes at that point are member<>group binding: adding a member automatically sets the group on the member. All members ALWAYS have a group, even if they are single. This makes some code a lot simpler. :)

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


    Considered moving this thread to BukkitDev ? The ticket system is nice there. I think bukkit expect everyone to move to it at some point. most people have the plugin on there full time and just manage chat about it here. anyway I just stopped by to check progress and I like it :), This is an amazing plugin.
  26. Offline


    Maybe it's an idea to give stations names?
    With a alert like:
    Hello, you're now on station (Name)
    and you can make other text?
    And... maybe with IConomy so people have to pay for it (optional offcourse)
  27. Offline


    HEY :)
    With the lateste bukkit build (1185) I got this:

    2011-09-22 11:58:16 [SEVERE] java.lang.NoSuchFieldError: br
    2011-09-22 11:58:16 [SEVERE] at
    2011-09-22 11:58:16 [SEVERE] at net.minecraft.server.EntityMinecart.s_(
    2011-09-22 11:58:16 [SEVERE] at net.minecraft.server.World.entityJoinedWorld(
    2011-09-22 11:58:16 [SEVERE] at net.minecraft.server.WorldServer.entityJoinedWorld(
    2011-09-22 11:58:16 [SEVERE] at net.minecraft.server.World.playerJoinedWorld(
    2011-09-22 11:58:16 [SEVERE] at net.minecraft.server.World.cleanUp(
    2011-09-22 11:58:16 [SEVERE] at net.minecraft.server.MinecraftServer.h(
    2011-09-22 11:58:16 [SEVERE] at
    2011-09-22 11:58:16 [SEVERE] at
    2011-09-22 11:58:16 [SEVERE] Unexpected exception
    java.lang.NoSuchFieldError: br
    at net.minecraft.server.EntityMinecart.s_(
    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(
    at jline.ConsoleReader.readLine(
  28. Offline


    Did you download te 1.8.1 Development version of this plugin from the other link on this thread, Or you can get it <Edit by Moderator: Redacted mediafire url>
    Last edited by a moderator: Nov 13, 2016
  29. Offline


    I avoid development build most of the time, but i'll try this time to check if I still have it ;)

    Ok, no more error.
    Thanks for the time and sorry :)

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


    Berger refuses to put it there because it is messy, annoying to set up, and a terrible file hoster. If you wanted an update checker, look for one in the Bukkit Tools sub-forum. I personally support his decision, because the last time I tried to upload a plugin there, it was such a jumbled mess, I just gave up ~_~

    There are already plugins for both. Use CraftBook for the arrival sign, and another plugin which name is out of my mind at this moment.

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


    Ok I'm home now, now time to port TrainCarts, SignLink and some others for 1185. :)

Share This Page