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 have attempted to run the new v1.66 with the new common library v1.9 and v1.8. The same result each time: the server locks up right away. As soon as it is done loading, it no longer responds to any commands or any requests to log in. I have removed all of your other mods and tried again with both version of the BKCommonLib, but no go.

    1.65 appears to work however.

    When redstone current changes near a traincart sign (possibly only transfer?) using wireless redstone:

    03:48:47 [SEVERE] Could not pass event BlockRedstoneEvent to Train Carts
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
            at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredLi
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
            at net.minecraft.server.BlockSign.doPhysics(
            at net.minecraft.server.World.k(
            at net.minecraft.server.World.applyPhysics(
            at net.minecraft.server.World.update(
            at net.minecraft.server.World.setData(
            at net.minecraft.server.BlockLever.interact(
            at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.j
            at net.minecraft.server.NetServerHandler.a(
            at net.minecraft.server.Packet15Place.handle(SourceFile:39)
            at net.minecraft.server.NetworkManager.b(
            at net.minecraft.server.NetServerHandler.a(
            at net.minecraft.server.NetworkListenThread.a(
            at net.minecraft.server.MinecraftServer.w(
    Caused by: java.lang.NullPointerException
            at com.bergerkiller.bukkit.common.utils.BlockUtil.getTileEntities(BlockU
            at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            ... 18 more
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 14, 2016
  3. Offline


    CommanderGizmo ugh that error again, though I fixed it...


    Fixed it here, but since it's not too 'dangerous', just make sure collect signs and deposit signs have a rails connected when using it.
  4. Offline



    Which error are you referring to? I'm not sure I understand as all of my signs are below tracks as they should be.

    W=WirelessRedstone Sign
    Would you prefer that we created tickets in the dev pages?

    I can't run v1.66 for some reason, but I don't see these bugs noted in the changelog:
    1. Putting sulpher as a transfer item causes all items to be moved.
    2. It would seem that if a listed item fails to be recognized it acts like all items instead of no items.
    3. Putting plank on a sign when using plank: wood in the config shortcut section does not seem work for wooden planks. From what I can tell, the bukkit material name for them is wood.
  5. Offline

    CzY Horse

    Question on "Transfer".

    I was wanting to have the mine cart circuit through the auto farms and top up to a maximum number of a stacks, then circuit through town and top up stacks where required.

    I have a cart picking stuff up, but every time the cart goes by chest it grabs another stack of 64. Is there a way to set a limit on the amount a storage cart or chest will hold of an item?

  6. Offline


    CzY Horse You can now do that using statements yes. Add a switcher sign (with a lever powering the transfer sign) with the statement:
    Not sure if this works, but you can try:
  7. Offline


    Can you help me? I made a route for the train and when the train gets out of my view, it stops!
    Please help me!
    Thx :D
  8. Offline


    fbs1997 set the train to keep chunks loaded:
    Or set it to true by default in DefaultTrainProperties.yml.
  9. Offline


    bergerkiller Any news on the 1.66 hang issue? I'd love to be able to load 1.66 on my server.
  10. Offline


    CommanderGizmo no nothing yet, but um, when exactly does it start to hang? In other words; what exact plugins cause this hanging? All of the plugins that use BKCommonLib?
  11. Offline


    tonight i added a new SignAction "Ticket" which will remove / add / check the Money of each Player in a train/cart , i'm just asking if i can now use it or do i have to need some rights from you to use it on my Server ?!

    This is what the Sign should look like:
    money (default = 30)
    If the Passenger can't afford the Money/Ticket he will gets auto-ejected with a Message.

    If you want i can also provide you the Code.

    If you add the new Statement and Money check what we have talked about before i will of course use your build.

    Thanks in advance.

  12. Offline


    reeZZer Well of course, if you can PM me the code (or a link to the REPO) I'd be glad to pull it in. Right now very busy with NoLagg, preparing it for a stable new version. Almost done there. Past days I've been busy with Spout haven't had much time to spend on Bukkit programming ... so very happy someone did have time for it :)
  13. Offline



    I have a problem with train speed : my carts slow down over a short distance (it never happened in the 1.8.1 version of MC, the plugin and the trains worked well, and I did not change anything in my rail structure). I've tried to :
    - Set both normal and slow "slowDownMultiplier" to value 1.0 (instead of 0.9XX)
    - In game, set "/train slowdown false"

    But it has not resolved my problem.

    I have the default configuration excepted that I changed "keepchunksloaded" to true.

    Did I miss something ? Did anybody noticed the same problem ?
    Thanks for your answer, and thanks for working to give us one of the most usefull plugin of bukkit

  14. Offline


    alright thanks, i just sent you the Source and hope you like the idea :)
    The Code is not the best because it was my first time.

    But anyways , your Plugin rocks ! haha

  15. Offline


    I removed all of your plugins except trancarts 1.66 and tried both BKCommonLib versions 1.8 and .19. In both cases the server console refuses to process any command once the loading of the server is completed. I can type commands, but they do nothing.

    Here's the end of the log. Note the commands which do nothing no matter how long you wait.
    22:32:22 [INFO] [Train Carts] Enabling Train Carts v1.66
    22:32:22 [INFO] [Configuration] File 'plugins\Train Carts\PermissionDefaults.yml
    ' has been generated
    22:32:22 [INFO] [Configuration] File 'plugins\Train Carts\config.yml' has been g
    22:32:22 [INFO] [Train Carts] SignLink detected, support for arrival signs added
    22:32:22 [INFO] Train Carts version 1.66 enabled!
    22:32:22 [INFO] Server permissions file permissions.yml is empty, ignoring it
    22:32:22 [INFO] Done (3.116s)! For help, type "help" or "?"
    22:32:22 [INFO] [Configuration] File 'plugins\Train Carts\DefaultTrainProperties
    .yml' has been generated
  16. Offline


    CommanderGizmo and if you completely rid all worlds from all minecarts and delete the trains.groupdata file? Or load a world without trains? I suspect a cart replacement bug somewhere...
  17. Offline


    Thank you sooo much :)
  18. Offline


    bergerkiller I removed the Train Carts folder prior to the test. A fresh install of the plugin.

    Yes, it loads properly in a fresh world. Presumably this is not too hard to fix since you know what is causing it. I'll try to replace all the trains. They don't load when I restart the server with 1.65 anyway.

    [EDIT 2]
    Attempted to remove all minecarts using command in 1.65, then upgraded to 1.66. When placing the first minecart the server immediately went unresponsive as before. I am no longer able to give console commands and the client drops out with error.
  19. Offline


    CommanderGizmo Ok I'll first downgrade (who knows what I fixed without even noticing it) and see if I can reproduce this locally. I really want this fixed, no one likes replacement freezes...

    Just in case..what craftbukkit build do you run it on?
  20. Offline


    After completely clearing all traincarts related data + .jar file, and re-installing the plugin - I continue to have a problem where train spawner signs will correctly spawn a cart on to the track above, but the cart does not move at all (It worked correctly before recent versions)

    There are also issues with path finding ignoring the blocker signs.

    Have there been any updates recently that change the layout of the spawner sign?

  21. Offline


    andrewpo Spawner bug fixed locally (index out of range bug or something weird...)

    The blocker sign syntax kind of changed. All signs can now specify the directions to affect. For example:
    The third line should actually be the direction to launch to (option direction), but it is the fourth line right now.

    The third line isn't used right now, instead this directional system has been added as part of the first line for all signs.
    andrewpo likes this.
  22. Offline


    i just found out, on the Version 1.66 (with or without Ticket) the SignLink Trigger Sign doesn't work anymore, it doesn't record anymore or raise the timer, do i need something other now ?

    Tested 1.65 - works
    Tested 1.66 - doesn't works

    I'm using this Sign syntax:

    Thanks in advance.
  23. Offline


    reeZZer you might have to power the sign now (or put ! in front of train: [!train]
    I believe I fixed a bug where redstone power wasn't read; it was a requirement for it to function.
  24. Offline


    This plugin shuts down my server everytime ..
  25. Offline


    bergerkiller I'm running build 2149 (latest afik). I'll attempt to run it on a blank world and place a cart.
  26. Offline


    Tigr3tap CommanderGizmo Just in case, I uploaded a temporary 1.67. I need to know if this still happens on this build or not. >>GitHub Link<<

    I'll try to make a quick 'thread reader' plugin to log all threads that are halting on the server. This way I can let you tell me what function is causing it.

    CommanderGizmo since I can't know this anymore, I wrote a plugin to do this for me. Install this plugin.

    Put it in plugins and run it alongside TrainCarts. You'll know when the thread is locked once it starts spamming stack traces of the current thread. Send me ALL of these traced. :)

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



    Here you go, the log you requested. I ran this with the 1.67 you linked to above, though it still says 1.66 in the log for some reason. Hope we can get it sorted!

    Oh yea, and BKCommonLib v1.19 fixed the issue with using plank on the sign, but sulpher still moves all items. I'm still running TC1.65 of course.
  28. Offline


    CommanderGizmo this is of great help, as I think I know what is going on. It is loading chunks from within the constructor...whcih can only mean it is loading the wrong chunks as it shouldn't resolving this issue right now...

    this.blockx = this.blocky = this.blockz = Integer.MIN_VALUE;
        public Block getBlock(int dx, int dy, int dz) {
            return + dx, this.blocky + dy, this.blockz + dz);
    2012-05-05 13:09:35 [INFO] [TLN] at org.bukkit.craftbukkit.CraftWorld.getChunkAt(
    2012-05-05 13:09:35 [INFO] [TLN] at org.bukkit.craftbukkit.CraftWorld.getBlockAt(
    2012-05-05 13:09:35 [INFO] [TLN] at
    2012-05-05 13:09:35 [INFO] [TLN] at
    <insert huge facepalm here>

    CommanderGizmo ok I fixed the error (see above...).
    It is called 'sulphur' and not 'sulpher', so that can explain why it transfers all items then. (not found = no material set = all)

    CommanderGizmo thanks for helping me out here. The bug was too obvious to miss, but without an error I am real big thanks :)

    New 1.67 is up which fixes this freeze problem. If you didn't have a 'problem' do check your world region data folder and remove a possible 'bugged' region file. It is called this:
    It was caused by TrainCarts getting a block (and thus chunk) at an infinitely far away position in the world.

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


    bergerkiller Thanks! I'll test it in a few hours.

    Ok, tested. I can finally load the server, so yay! However, logs are no longer being placed as a smeltable item. I'm guessing that making them usable as a fuel as prevented their use as a burnable item. They do get placed properly as a fuel.

    Also, this setup no longer works:

    The issue seems to be the double track. If I remove the far track in the picture the signs work again. Any way to fix the signs in the image so it works?

    Thanks for all the hard work!
  30. i too would like to know how to make a effective and space saving empty train destructor.

    tried the setup pictured below but now ALL trains arriving at the sign get destroyed. how do i set this up in a way that only empty trains get destroyed while others continue straight ?
  31. Offline


    g_BonE you have to attach a lever to the block the switcher sign is attached to. This will get toggled based on the properties of the train and the statements set. This power is connected with the destroy sign, either with redstone or by having a sign right underneath/besides it.

    CommanderGizmo I know what it is, let me fix it. You can temporarily fix it by setting left and right on the sign:
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 14, 2016

Share This Page