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


    Works fine for me - what issues are you experiencing?

    Tried that and it works
    1.6 beta 34


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


    Which version of CraftBukkit are you using? I am using the latest Dev build of 1.2.3
    I pretty much duplicated your set up... it works if I use only one cart, but if I link two or more, then it does not work.
  4. Offline


    1) switchers splits trains in half
    2) the command '/train destroy all' throws errors (see my post above)
    3) destination signs are a little bit wonky, doesnt really apply (possible cause: I used an dash in the destination. "cul-union")
    4) Detectors are not working (already confirmed by Berger)

    Mind you, this system worked fine before the upgrade to 1.2.3 I m not complaining, but pointing out bugs to squash as we all know this is still in beta.
  5. Offline


    CB Breaks this at around 2070, any chance for fix, as 2070 has a lot of fixes for missing events.
  6. Offline


    Bukkiiiiiiiit why don't your notifications show uuup??!?



    Yeah I'll be working on the detector bit today, the latest build I uploaded was just to fix some errors in the collector and dispenser signs. I'll look at your error (my guess is that I forgot to add an 'is dead' check before a certain sign action was executed. (may cause the group to return nothing)

    ledhead900 I won't support unrecommended builds YET, but I'll first make sure it supports _02 properly.
  7. Offline


    Alright I understand, I only use those as it has the wolf damage event fired properly and its needed for class plugin I use else you probably cannot turn into a werewolf.
  8. Offline


    The issue with signs not detecting power to the block below them has returned =/
    (in beta 34)
  9. Offline


    andrewpo this problem persists in build 35? (see github)
  10. Offline


    Uploaded a new version (B36). BKCommonLib wasn't properly disabling all plugins, which caused TrainCarts to never save Trains, detector regions, properties and path finding info. (pretty severe issue)
  11. Offline


    Can confirm detectors works now, along with destinations in b36-- Still am getting the errors when typing /train destroyall, though. Error Log follows, hastebinned..

    On another note: I am not sure, and am aware of the picky nature of Detector Signs, but can detector follow tracks on a S curve? for example:

    -------------------D (d = detector sign - = track)

    My problem is that I am trying to make a timed system that detects tracks between two stations to determine whether to send a train or not. But detectors seems not to be working.

    Thank you.
  12. Offline


    _frozen yup, just like path finding, detector signs cover all tracks. It can even cover quick-to-slope-jumps :)

    I'll look at the error, seems to be an easy fix.


    Easy fix; it was previously blocking trains LEAVING the blocker sign. This is also fired when the train dies, so this explains the error in the IsHeadingTo check.
  13. Offline


    Great plugin, works well as a replacement for minecart mania. Two interesting features that would be nice to have are
    1) Allow trains to be broken up automatically with switcher signs. Example: I have a train of minecarts and storage carts, and i want to split off the storage carts into another area, so i set the switcher to switch minecarts right and storage left. It works, but the carts are still linked, so the train stops.

    2) Allow transfer items to be search for all items, a range of items, or not certain items. Example, maybe I want a chest to collect all but wool, so I put could say all!wool.

    Anyways, its working well on my server, even with a bunch of destinations and sets of two one-way tracks.
  14. Offline


    Cuitpoisson thought off;

    1.) you can use [cart] switcher signs to split trains into multiple carts.

    2.) combine a 'cart transfer' with a 'cart switcher'. You basically connect the output (lever) of a cart switcher with a 'cart transfer'. Then items are only transferred if the switcher sign allows it.

    Misread. Yeah, I understand your idea, but it is a bit hard to currently has multiple parsers which it goes by one by one transferring all items. Having a NOT is a bit impossible, since there is no 'all' to choose from...

    Maybe something to consider. It will need some sort of 'ItemValidator' which would check items one by one, transferring them if allowed, otherwise not. This would make 'counters' easier to implement as well.

    For now, I recommend adding a return sign system. In your example:
  15. Offline


    my sign reads:

    And when I send a minecart+storagecart to it, the two go opposite ways but are still linked so they stop.
    Hmm, but when i do this:


    They split correctly, is the first one unintentional? [As of now, this will work for my situation, I guess I didn't test around enough].

    2)Also, I noticed the ability to choose multiple items in the config file under a different name, which should work well. But is there a way to transfer all items? Would just leaving it blank do that?
  16. Offline


    Cuitpoisson yup, leaving it blank transfers all items. And it should always separate the train correctly...
  17. Offline


    Sounds good with leaving them blank, I updated the wiki.

    The carts don't separate under this condition: . The first run is without the sign, the second is putting the sign under the middle cart. No personal rush to have this fixed, I probably won't use this, but just thought you might care to know.
  18. Offline


    Cuitpoisson you HAVE to have the sign placed at a fixed 90-degree angle. So no sub-angles are allowed, as that can cause directional systems to fail.

    But it's a nice suggestion: I'll make it snap to a 90-degree angle on placement. (train/cart on the first line ONLY)


    mmh but there do seem to be some issues with carts doesn't de-link the two carts in some cases. Also, the switcher sign seems to ignore the train direction alltogether...

    Updated to beta #37.

    _frozen your error has been fixed

    Cuitpoisson your issue has been fixed as well; it now properly disconnects trains again. Was a directional issue. Signs now snap into place. Note that trains HAVE to see the text-side of the sign for switcher signs to respond. In your video, you make the trains see the back-side of the sign for them to respond, but this will no longer work then. On purpose, as it is impossible to make proper directional switcher systems otherwise.

    Also fixed some 'ghost carts' occuring when a train falls down the void. (that kills the train)

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


    I imagine this isn't a surprise, but with the newest build with 1.2.4 (build 2109) get a crash on startup.

    at net.minecraft.server.EntityMinecart.F_(
    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(
  20. Offline


    Please don't use the latest beta on 1.2.4 YET. I'll work on some resolutions later.
    Mycah likes this.
  21. Offline


    Awesome, thanks.
  22. Offline


    Updated it to beta 38 just to get rid of some odd switcher/destination bugs, and to get rid of the weird sign snapping. Expect beta 39 later today for MC 1.2.4. :)
    Mycah likes this.
  23. Offline


    Incredibly awesome! Can not wait.
  24. Offline


    Uploaded build 39 for 2116 and probably works on later 1.2.4 builds too.

    Just I have to add the 'block' versions of MM too? So far all features have been implemented, but it uses signs. I know that some of you are addicts to the block-method, like 'gold' block to boost and 'iron' block to eject...

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

    Celtic Minstrel

    I'm not currently using TrainCarts, so you're free to utterly ignore this, but... I dislike the use of magic signs for extended features in general, and would much prefer the use of special blocks instead.
  26. Offline


    Celtic Minstrel which block versions would you like to have then, and what 'modes'? Braker/Booster blocks, station blocks and ejector blocks are one thing...but I don't see it happening for stuff like item transfer.
  27. Offline

    Celtic Minstrel

    Um... I suppose I'd better go look at what's available before I try to offer suggestions...
  28. Offline

    Don Redhorse

    well there always was a problem with MM and the blocks.. and it is even with traincart and signs but less though..

    on servers where you do "normal" playstyle getting the resources for the blocks is almost impossible and leads to "griefing" if you don't use a logging system and it requires "cheating" to get the needed resources.
  29. Offline

    Celtic Minstrel

    Alright... I don't recall what block features MM had, but here's my analysis of how your sign features might be able to map into using special blocks instead. It's not so much a request list as an analysis of how well I think your sign-based features would be able to transfer to a blocks-based approach.

    Destructor blocks I think would be fairly easy.

    Ejector blocks I think would be fairly easy (it would eject in the default direction and perhaps try to be a little smart to avoid ejecting onto the tracks).

    Blocker blocks I think would be fairly easy as well; probably just block all directions. Not entirely sure on that.

    Switcher blocks I think would be fairly easy with the basic function of toggling the tracks whenever a train / cart rolls over them. (That's what switcher is for, right?) This does represent a fairly tiny subset of what a switcher sign can do, though...

    Waiter blocks I think would be fairly easy.

    Teleporter and trigger blocks I think would probably be impossible. Destination blocks would be both impossible and pointless; this is one thing for which I think a sign is actually the best choice. Spawner blocks might be impossible, but what about allowing dispensers to spawn minecarts? That is, if there's a track in front of a dispenser when it activates, and the item being dispensed is a minecart, make it create a minecart instead of an item.

    Property-changing blocks are probably impossible to do with the full features of the signs; you could however use the config to assign various properties to certain blocks (what I had in mind was using each colour of wool for a different property). Mostly this would only allow boolean properties, and perhaps add/remove tag, so some properties could not possibly be available.

    Station blocks I think are possible. I'm just not sure how you would decide on the behaviour (right, left, continue, reverse). I suppose you could use four different blocks with each one a different behaviour (or, four different types of wood or something!). That said, I think continue would be the most needed behaviour, except at the end of the track where you would want right or left; reverse feels like it'd be a relatively unusual behaviour, and left and right don't seem all that useful in the middle of a long track. So, two types of station block (one "continue unless track ends", one reverse) might be another option.

    Transfer/crafting blocks I think are actually possible, just not to the full extent the signs allow. Basically, you could have a collect block, a deposit block, and a crafting block that just puts everything in the closest chest or takes everything from the closest chest. (Or other container.) I suppose the crafting block might actually not be possible (or possible but just not worth the work).

    Detector blocks... I don't think these are possible in quite the way you've done the detector signs, but I wonder if you could use special blocks below a detector rail to affect what condition causes the detector rail to activate?

    Not sure there's any point in adding booster blocks... after all, we have booster rails now. I suppose maybe some special blocks beneath booster rails to affect their behaviour... perhaps make them only boost in one direction, for example.

    As for what I'd personally like... it's hard to say since I haven't done a lot with minecarts. Transfer, spawning, detection, and station feel like they're probably the most useful. Oh, and blockers I think would be essential. Switchers could be useful, but they'd be pretty limited as a block, so I'm not sure. I don't see much point in ejectors or destructors, at least for trains intended for passengers; I guess ejectors would be useful if you have mobs in your trains. Property-changing blocks don't seem terrible useful.

    That's not particularly hard to fix; just use easier-to-obtain blocks. Examples: logs, wooden planks, double slabs, stone bricks, wool, snow blocks, clay...

    Or make the iron/gold/etc blocks easier to obtain somehow.

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

    Don Redhorse

    well but if you take logs for example you can't built a wooden bridge.. that was the reason "rare" blocks where used.
    You could probably disallow breakage of those blocks and permit it only to certain permissions but one question:

    why do we need both? as you stated yourself the block system is by far more limited and only really useful in very limited scenarios... of course for people with a big mm or craftbook setup those would be live savers, but should we care?

    adding the old way of config means more code, more place for bugs.. I know some people are still keeping MM alive but are not willing to share..

    I would say stick with signs only, especially with the background that with the mojang api stuff will change again and mojang will nevertheless require you to create a new map in the future.
  31. Offline

    Celtic Minstrel

    True. My point however was only that there are plenty of less rare blocks that could be used.

    I just don't really like magic signs in general. Sure, you don't need both signs and blocks, but the blocks are nicer aesthetically and easier to use.

Share This Page