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


    Are you going to add vanishing carts? :)
  3. Offline


    @AuZor what do you mean with 'vanishing'? There now is a /train removeall and /train destroyall command if you mean that.
  4. Offline


    @bergerkiller: I've come across a minor bug when using Train Carts with a Portal sign.
    Mainly that the train will go through the portal without a hitch - unless there is a passenger.
    Then it ignores the portal and flies off the end of the track.
    Server Configuration:

    Version: 1.8.1 - Bukkit build: 1240

    BananaChunk 4.6 - Bedrock 0.7 - bLift 1.1 - BlockDoor 0.062 - ChatManager 1.14 - CreativeGates 1.3.1 - dynmap 0.23 - Essentials 2.6.2 - FenceStack 1.13 - LWC 3.53 - MinecartManiaAdminControls 1.2.7 - MinecartManiaChestControl 1.2.5 - MinecartManiaCore 1.2.8 - MinecartManiaSignCommands 1.2.8 - MinecartManiaStation 1.2.5 - Modifyworld 1.14 - ModTRS 2.1 - My Worlds 1.15 - NoLagg 1.28 - obuShutTheHellUp 0.3 - PermissionsEx 1.14 - PluginInfo 0.1.4 - PorteCoulissante 1.2.5 - ScrollingMenuSign 0.8.1 - SignLink 1.05 - Spout - Train Carts 1.39 - VanishNoPacket 1.6.9 - WorldBorder 1.4.3 - WorldEdit 4.7 - WorldGuard 5.3
  5. Offline


    Well, as states earlier, the trains stops in unloaded chunks. Berger, as far as I remember, suggested them to vanish/destroying themselves, as they just stop up in unloaded chunks unless there's a player.

    Nvm, the properties works again. It used to stop in unloaded chunks, but now it seems to keep on going.. I'll test some more. Sorry for wasting your time.

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


    @glarter Yup something is definately wrong with the portal system. For one, I had to update it (MyWorlds changed, portals with same name possible). Also, the initial direction is not correct. And some weird server freeze when teleporting to a non-directional sign. However, passenger teleportation worked just fine...

    Does the player get teleported outside the minecart or not?
    Also, teleporting cross-world/far away?
  7. Offline


    Player is still sat in the minecarts which have unlinked and run off the end of the track.
    Teleporting only a few blocks as it's in a specialised test chamber.

    Walking through a portal works fine otherwise.
  8. Offline


    oh. my bad. You should plase setdefault at thirdline. goddamn. this thing almost killed me!
  9. Offline


    Just done an update:
    SignLink 1.06 - Train Carts 1.40 - My Worlds 1.18

    Now the [portal] signs are completely non-functional. They're facing the direction of the oncoming minecart and powered by a redstone torch ... train runs right past and off the end of the track.
  10. Offline


    @glarter as mentioned, the new MyWorlds uses a different portal storage system, didn't update the reference here yet. You probably get 'onMove not passed' errors in the log too, where it points to a method not found.

    I'll do a simple update (might fix some issues, not sure), since I got a huuuuuuuge project going on right now. (Virtual Redstone)


    Done, updated to 1.41

    It should at least make them work now, not sure if it fixes the passenger issue.
  11. Offline


    You're right, here's the stuff from my server.log:
    2011-10-16 15:24:05 [SEVERE] Could not pass event VEHICLE_MOVE to Train Carts
        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.tickEntities(
        at net.minecraft.server.MinecraftServer.h(
    Downloading ... I'll let you know.

    @bergerkiller - that's fixed both the problems.
    The trains are now teleporting between the signs, both with and without passengers.

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


    Not sure if this has happened to anyone else, but in one particular segment of track my screen shakes violently while riding the train, side to side. I made that track using worldedit. The shake seems to go away after the train turns or stops. Has this happened to anyone?
  13. Offline


    @darxler it must be a client issue where the player camera is 'just' at the 180-degree spot between front and back. The minecart-change-camera feature is then acting up, I've seen it too. Nothing I can do about that, sadly.
  14. Offline


    The videos do not work with the examples. Does anyone could fix it or upload it to Youtube?
  15. Offline


    @Laguna I should upload them to YouTube...I know...but they are so many D:

    I'll try to move 'em to youtube tomorrow...
  16. Offline


    That is not the same! I want to detect if there are no tags on the train and not to unset all tags.
    I was refering to a "null" in programming-sense like "no values found" - not a tag named "null"
    It's difficult to explain. I imagine something on the sign like:
    Train goes left if it has no tag.
    Train goes straight forward if it has any tag except "atlantis".
    Train goes right if it has the tag "atlantis".

    Maybe I get it wrong, but didn't find a way to detect if there are no tags.
  17. Offline


    Shouldn't setting it to "null" as a string work pretty much the same.
    Setup like:


    This would make it go left if the tag was null
    Right if the tag was atlantis
    Straight for any other tag

    It's a little different setup than you want, because you would have to switch straight and left, but you get the same function.
    You would likely want to set the default properties file to tag all trains as "null"


    I cannot get pushing of player to work in SMP at all now. I believe this has been the case since 1.40
    I am now running TrainCarts 1.41, craftbukkit 1317, and tested with no other plugins

    Train is created via spawner (5 carts long), then immediately dropped on station with a delay of 10 which then pushes right.
    Train then enters another station and waits 10, the pushes right.
    I then have the carts whip around across a powered rail and stop at a wall(just for testing, normally they would chug on off to another station at this point)

    I have tested standing in front of the train at the first station, and when the station pushes the trains, they get blocked by the player and just bounce back.

    setOwnerOnPlacement: true
    removeDerailedCarts: false
        cartDistance: 1.3
        cartDistanceForcer: 0.1
    use: true
    maxCartDistance: 4.0
    spawnItemDrops: true
    keepChunksLoaded: true
        cartDistance: 1.6
        cartDistanceForcer: 0.2
    maxCartSpeed: 0.35
    useCoalFromStorageCart: false
        z: 1.0
        y: -0.5
        x: 0.0
    breakCombinedCarts: false
    poweredCartBoost: 0.1
    nearCartDistanceFactor: 1.2
    pushAwayForce: 0.2
        tags: []
        passengers: []
        allowPlayerEnter: true
        slowDown: true
        trainCollision: true
        allowMobsEnter: true
            atStation: true
            mobs: true
            players: true
            misc: true
        allowPlayerExit: true
        owners: []
        allowLinking: true
        tags: []
        passengers: []
        allowPlayerEnter: true
        slowDown: true
        trainCollision: true
        allowMobsEnter: true
            atStation: false
            mobs: false
            players: false
            misc: true
        allowPlayerExit: true
        owners: []
        allowLinking: true

        tags: []
        passengers: []
        allowPlayerEnter: true
        slowDown: true
        trainCollision: true
        allowMobsEnter: false
            atStation: true
            mobs: true
            players: true
            isPushing: true
            misc: true
        allowPlayerExit: true
        owners: []
        allowLinking: true
    Three other things, in the order I would love to see them addressed if you are so kinds as to address some or all of them.

    1.) I've noticed an issue with stations that have a delay.
    If you shutdown the server while a train is at a delayed station, when the server comes back online, the station clock does not seem to resume, resulting in the train essentially getting stuck at the station.

    2.) It would be great if we could get the train exit offset as a property so we could change train exit points as it travels. For instance, I might have a train hit a station with a wall on the left, then later with a wall on the right. If we want the player to exit to the side, we need to be able to control the offset as the train travels.
    Another super nice option might be a SmartExit, that could be set to left or right or top, and it would automatically check if the left or right were blocked, and if they were, it would try the opposite side, and then the top.

    3.) I built a looping track that travels to the top of the world, drops the train off the track at a high speed, then catches the train on another track far below. Most of the time, the player gets killed as soon as the train leaves the track, not when the train hits the ground, but as soon as it is in the air, player dies with a message saying the player hit the ground too hard. On some occasion that I can't quite figure out, it doesn't kill the player...

    Thanks for the awesome plugin.

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


    i got a very strange bug happening once a while on my server, if a player is inside a cart while the server shutdowns(using /stop) the train disappear that affects the cart, i belive this is a very bad bug as it works entirely fine in bukkit without the plugin :)

    i hope this helps you
  19. Offline


    When i restart server the carts are gone, why andhow to fix this please
  20. Offline


    No it isn't! When the train contains the tags "null, babylon, camelot" it would go left in your example. But there are still other tags on the train ("babylon" and "camelot"). There is no detector when to set it to "null" as I can't detect "no tags left".

    The example is maybe a little bit more clear, when you leave "atlantis" out: Go one way, if the train has any tag (no matter which one), go the other way, when it hasn't got any tags.

    Remember that I want to use it to direct the train to a destructor! So a train goes in circles until there is no tag left (as I remove tag "atlantis" in Atlantis and so on).
  21. Offline


    @BadKarMa With setting it to 'null', I mean instead of having no tags, have it only the tag 'null'. For exampe, set default train tags (defaultflags.yml) to [null]. In property signs, use settag null to clear the tags. Instead of no tags, you habe only one tag: 'null'.

    I'll look at the other issues too. Remember to use /stop when closing the server, or traisn are gone!
  22. Offline


    thats exactly what im doing bergenkiller.. which gets me all confused, could be a save bug maybe?
  23. Offline


    First of all thank you for this great plugin comes.

    I wanted to ask if there are ways that players can not stop the train, since when is on the way if a player crosses U_U stops.

  24. Offline


    @Laguna sure is. After you made the train, do this:
    Now it will always push all players away (except the owner) and won't toggle pushing off after leaving a station.
    You can also disable train collision in it's total:
    Now trains will pass through other trains and all other entities (except the owner).
  25. Offline


    In reference to the issue I mentioned earlier. Pushing doesn't seem to be working any more, at least it wont push my player. The spawner is creating the trains, and according to the yml, the train has no owners. Though, the /train info seems to indicate everyone is an owner(though I thought that meant everyone can be an owner). I did try to set the owner to "monkey" which is not the player, but it still won't push the player.

    Dude, chill with them !'s

    I see what you are trying to get at now. You are adding tags dynamically, and want the train to keep popping off tags as it travels, and once there are no tags left, you want it to get destroyed.

    You COULD accomplish that by creating a series of switches at every station that covers every possible tag. Have each switch return the train to the main track, then if none of the switches hit, that was a [null] train. Though, that seems like a PITA to do.

    In which case, let me recommend a new feature that is a little different:

    Simple version would look like this:

    This would go left if the train had any tag.
    It should also have a ! option:

    This would go left if the train had no tags at all. (Taking care of BadKarMa's request)

    A more advanced version might look like

    Any train with a tag that starts with a would go left, any train with a tag that starts with b would go right, any train that has no tags that start with a or b would go straight.

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


    @mugekun if a train has no owner, everyone is owner. It is made this way so players can claim trains easily. Set the owner to sadsdsasadadsadsd or something to lock it up for good. (if you use /train info, you'll see that everyone is owner)
  27. Offline


    Thank you very much! =)
  28. Offline


    Like I said, I had tried setting to "monkey" which was not any player, and it still wouldn't push. I haven't been pushed since 1.39
    /train info confirmed that the owner was "monkey"
  29. Offline


    Sorry, I wrote the answer in a hurry and as English isn't my native language: It wasn't meant to sound rude.

    Your idea of a wildcard is excellent [exclamation mark] ;)
    Far more powerful than a null-tag.

    Please consider that one, bergerkiller.
  30. Offline


    It's getting late, it'll be tomorrow I can work on TrainCarts...
    Redstone Mania is one hellofa project :)

    I'll add a '*' tag (meaning any, !* is none)
    Not sure about the wildcarts, it gets complicated easily. Soon people start demanding:
  31. Offline


    At least we aren't asking for RegEx (^_^)

Share This Page