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

    bergerkiller

    [​IMG]

    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. :)

    Description:
    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.

    Media:

    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.

    TODO:
    - Train-sign message handling using SignLink (low priority)
    - Minecart use permissions (for individual carts?) such as Storage Minecarts

    Commenting

    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.

    Changelog

    Show your appreciation for my plugins by donating
    [​IMG]
     
  2. Offline

    SinCalChewy

    I'mma test it out now! Woop:)
     
  3. Offline

    bergerkiller

    Ok the first steps to updating all of my plugins are done. BKCommonLib has a dev-bukkit page, and I made a banner that even the half-blind here should see and read prior to downloading my plugin...
    [​IMG]
     
  4. Offline

    SinCalChewy

    I'm loving the pickup()item already! I made a rail that grabs eggs from 5 egg farms that spawn fast amounts of eggs, then drops them off at a transfer chest area. Then another rail takes them from the transfer chests to dispensers that spawn chickens, and then another that shares the same station takes the rest to a egg bank. Now I have mad amounts of chicken. haha :)

    As for the detector levers, so far so good. I've rode back and forth a bunch and haven't had any problems. The only thing I did notice, was that if they were stuck on from before I updated, they were still stuck on after. Then I would flip the switch manually to turn it off, and ride the track, and it resets it and works after that.

    I haven't been able to test the syncing stuff yet, as most of my fellow players on my world play at night, and no one has been on this morning since the update. I'll let you know how that goes when I mess around with some other players later today.

    All and all, good stuff! I have a lot of new farm ideas in mind now that you added pickup()item :)
     
  5. Offline

    CommanderGizmo

    So what is the sign format for the ground items?
     
  6. Offline

    bergerkiller

    CommanderGizmo
    There are also drop items and pick up aliases. The same radius like for chests and furnaces apply. (though it is not a column)
     
  7. Offline

    Johnny Crazy

    bergerkiller
    The Updated Version wont work with the Bukkit Beta Build... the server hangs up when he has finished loading all Stuff...

    Any Fix? :D
     
  8. Offline

    bergerkiller

    Johnny Crazy
    Strange...that build is especially made for the beta build...
    Not sure what is going on.
     
  9. Offline

    CommanderGizmo

    bergerkiller, so it collects/drops in a sphere rather than a circle?
     
  10. Offline

    bergerkiller

    CommanderGizmo
    Yep. Dropping will first check for items inside this sphere, if it can't stack there, it will spawn a new item above the tracks.
     
  11. Offline

    CommanderGizmo

    bergerkiller Does pickup work in a sphere too? Does the range setting on the sign control the size of the sphere for pickup and dropoff?
     
  12. Offline

    bergerkiller

    CommanderGizmo
    Yes, the pickup is also in a spherical range. The size is in ints (so 2, 3, 4, 5, etc.). It does have a limit (which is also in the configuration), so you may have to increase this limit. By default this range limit is 3 blocks.
     
  13. Offline

    marksc

    I don't know what's happening or why but whenever I try to use it with my server, an error keeps coming up. It starts only when I activate a sign (in this case, the spawner)

    The log file is attached (sry for that, but with it it exceeds the limit)

    Also, I am not sure if it is my fault but the sign links don't seem to be working well. Since there is no wiki page of the Sign Links, I can't check.

    1. I am placing the trigger naming it "test1" (without the inverted commas) under the track facing one the side I want it to trigger from (AKA the side the train has to come to trigger it)
    2. The time I'm leaving black for record mode (I don't know if I need to do something else for record mode though)
    3. Then I place another sign with just the tag (for this test) "%test1%" (without the inverted commas).
    But the time isn't being displayed. It just displays "%test1%" (I'm ure you get it that it is without the inverted commas by now!)

    So what am I doing wrong?? I'll be very grateful for your help.

    Edit: Attachment link: http://forums.bukkit.org/attachments/log-txt.11219/
     

    Attached Files:

    • log.txt
      File size:
      65.8 KB
      Views:
      8
  14. Offline

    bergerkiller

    marksc
    The attachment thingo in Bukkit is a bit bugged, can you add a link to this attachment in the post? (they no longer show up underneath the comments)

    Anyhow, the record mode basically means that you have to place a minecart, let it drive over the sign to make it start recording, and once the minecart stops, the recording stops and the sign is updated. But often it is easier to just put a time on that line directly, instead of recording. It can be useful to measure travel times, though.
     
  15. Offline

    marksc

  16. Offline

    bergerkiller

    marksc
    Well for one, you have to use CraftBukkit 1.3.2 R0.1, the beta version. All of my plugins now support this build, as people need the development versions to fix the massive tick lag problems in 1.3.1.
     
  17. Offline

    CommanderGizmo

    Ok, just loaded the new traincarts. Thanks for the update! I like the new pickup and dropoff options.

    However, I did notice that a sign with "station 1" no longer accelerates the trains in one block, but it appears that the number is ignored now. Did the sign format change?

    [EDIT]
    Also, it seems that my regular "collect c 4" sign is no longer picking up items in nearby chests. What gives?

    I also now have phantom carts that can't be interacted with in any way, but still block my carts.

    I broke every cart on a small track and then placed two back. When the train ran a full loop it came back with 8 carts! The plugin is now duplicating carts at load as well as while the carts are moving.

    Sorry, this update seems to have broken everything that did work.
     
  18. Offline

    bergerkiller

    CommanderGizmo
    Strangely, I do not have any of those issues. But I'll look at the station sign to be sure of it all.

    Anyhow, I will re-upload (it wasn't approved yet anyway) 1.71.7 soon so I can fix this and some other problems, too.
     
  19. Offline

    Desmulator

    Hey there!

    On transfere sings the range parameter is not working.

    Code:
      [!train]
      chest in 4
          dirt
    The plugin uses always the defaultTransferRadius-value given in the config.yml.
    The problem seems to be the parsing:
    In your class SignActionDeposit.class on line 176 there is something like that:
    Code:
    int radius = ParseUtil.parseInt(info.getLine(1), TrainCarts.defaultTransferRadius);
    info.getLine(1) would return "chest in 4". parseInt is unable to parse this as 4 and so your ParseUtil.parseInt returns the default value. In this case, this is TrainCarts.defaultTransferRadius.

    I have no idea how to fix that especially because of the different command length. On station sings your doing the corrent thing:

    Code:
    // class: com.bergerkiller.bukkit.tc.Station;
    // line: 64
    double length = ParseUtil.parseDouble(info.getLine(1).substring(7), 0.0D);
    Hope you can fix it. :)
    Maybe you could get the command-string length and do a substring() like the station code.

    anyway nice plugin! ;D
     
  20. Offline

    CommanderGizmo

    I've been away for a few days with other matters. How's this coming along?
     
  21. Offline

    apriumben

    Apologies, couldn't find anywhere else to post problem...

    Finally got carts to link together, after removing all other plugins from the server. Was about to start reintroducing them when I noticed that my trains 'disappear' on unloading from server. As far as I can tell am using the latest release of craft bukkit, trains and BKCommmon and very simple track setup, powered rails at either end, 1 powered rail in the middle, and 1 detector rail as it seemed to want to link when I stuck that in. I can ride in the carts back and forward now reliably, but if I exit the game, stop the server, all is lost. Log from server attached, thanks.
     

    Attached Files:

  22. Offline

    apriumben

    _couldn't see where the attachment had gone, so as file is small
    -6547100770947890571)
    2012-09-26 23:36:10 [INFO] Preparing spawn area: 40%
    2012-09-26 23:36:11 [INFO] Preparing start region for level 1 (Seed: -6547100770947890571)
    2012-09-26 23:36:11 [INFO] Preparing spawn area: 40%
    2012-09-26 23:36:12 [INFO] Preparing start region for level 2 (Seed: -6547100770947890571)
    2012-09-26 23:36:12 [INFO] Preparing spawn area: 0%
    2012-09-26 23:36:13 [INFO] [Train Carts] Enabling Train Carts v1.71.7
    2012-09-26 23:36:14 [INFO] [Train Carts] 0 Trains have been loaded in 0 worlds. (0 Minecarts)
    2012-09-26 23:36:14 [INFO] [Train Carts] Loading chunks near trains...
    2012-09-26 23:36:14 [INFO] [Train Carts] 0 detector rail regions loaded covering 0 blocks
    2012-09-26 23:36:14 [INFO] Train Carts version 1.71.7 enabled!
    2012-09-26 23:36:14 [INFO] Done (4.952s)! For help, type "help" or "?"
    2012-09-26 23:37:17 [INFO] apriumben[/192.168.2.188:60163] logged in with entity id 357 at ([world] -964.9047048093438, 72.0, -134.39151661308273)
    2012-09-26 23:39:48 [INFO] apriumben issued server command: /home
    2012-09-26 23:45:16 [WARNING] Can't keep up! Did the system time change, or is the server overloaded?
    2012-09-26 23:48:58 [INFO] apriumben lost connection: disconnect.quitting
    2012-09-26 23:48:58 [INFO] Connection reset
    2012-09-26 23:49:10 [INFO] CONSOLE: Stopping the server..
    2012-09-26 23:49:10 [INFO] Stopping server
    2012-09-26 23:49:10 [INFO] [Train Carts] Disabling Train Carts v1.71.7
    2012-09-26 23:49:10 [INFO] Train Carts disabled!
    2012-09-26 23:49:10 [INFO] [BKCommonLib] Disabling BKCommonLib v1.27
    2012-09-26 23:49:10 [WARNING] DSCT: socket closed
    2012-09-26 23:49:10 [INFO] Saving players
    2012-09-26 23:49:10 [INFO] Closing listening thread
    2012-09-26 23:49:10 [INFO] Saving worlds
    2012-09-26 23:49:10 [INFO] Saving chunks for level 'world'/Overworld
    2012-09-26 23:49:12 [INFO] Saving chunks for level 'world_nether'/Nether
    2012-09-26 23:49:13 [INFO] Saving chunks for level 'world_the_end'/The End
    2012-09-26 23:49:14 [INFO] Stopping server
    2012-09-26 23:49:44 [INFO] Starting minecraft server version 1.3.2
    2012-09-26 23:49:44 [INFO] Loading properties
    2012-09-26 23:49:44 [INFO] Default game type: SURVIVAL
    2012-09-26 23:49:44 [INFO] Generating keypair
    2012-09-26 23:49:45 [INFO] Starting Minecraft server on *:25565
    2012-09-26 23:49:46 [INFO] This server is running CraftBukkit version git-Bukkit-1.3.2-R0.1-b2352jnks (MC: 1.3.2) (Implementing API version 1.3.2-R0.1)
    2012-09-26 23:49:47 [INFO] [BKCommonLib] Loading BKCommonLib v1.27
    2012-09-26 23:49:47 [INFO] [Train Carts] Loading Train Carts v1.71.7
    2012-09-26 23:49:47 [INFO] [BKCommonLib] Enabling BKCommonLib v1.27
    2012-09-26 23:49:47 [INFO] BKCommonLib version 1.27 enabled!
    2012-09-26 23:49:47 [INFO] Preparing level "world"
    2012-09-26 23:49:47 [INFO] Preparing start region for level 0 (Seed: -6547100770947890571)

    2012-09-26 23:49:51 [INFO] [Train Carts] Enabling Train Carts v1.71.7
    2012-09-26 23:49:51 [INFO] [Train Carts] 1 Train has been loaded in 1 world. (3 Minecarts)
    2012-09-26 23:49:51 [INFO] [Train Carts] Loading chunks near trains...
    2012-09-26 23:49:51 [INFO] [Train Carts] 0 detector rail regions loaded covering 0 blocks
    2012-09-26 23:49:51 [WARNING] [Train Carts] 3 carts of group 'train1' are missing! (externally edited?)
    2012-09-26 23:49:51 [INFO] Train Carts version 1.71.7 enabled!
    2012-09-26 23:49:51 [INFO] Done (4.315s)! For help, type "help" or "?"
    2012-09-26 23:50:29 [INFO] apriumben[/192.168.2.188:60454] logged in with entity id 372 at ([world] -982.1367814187914, 68.5, -142.06257409026153)
    2012-09-26 23:51:42 [INFO] apriumben lost connection: disconnect.quitting
    2012-09-26 23:51:42 [INFO] Connection reset
    2012-09-26 23:51:52 [INFO] CONSOLE: Stopping the server..
    2012-09-26 23:51:52 [INFO] Stopping server
    2012-09-26 23:51:52 [INFO] [Train Carts] Disabling Train Carts v1.71.7
    2012-09-26 23:51:52 [INFO] Train Carts disabled!
    2012-09-26 23:51:52 [INFO] [BKCommonLib] Disabling BKCommonLib v1.27
    2012-09-26 23:51:52 [INFO] Saving players
    2012-09-26 23:51:52 [WARNING] DSCT: socket closed
    2012-09-26 23:51:52 [INFO] Saving worlds
    2012-09-26 23:51:52 [INFO] Closing listening thread
    2012-09-26 23:51:52 [INFO] Saving chunks for level 'world'/Overworld
    2012-09-26 23:51:55 [INFO] Stopping server
    2012-09-26 23:52:24 [INFO] Starting minecraft server version 1.3.2
    2012-09-26 23:52:25 [INFO] Loading properties
    2012-09-26 23:52:25 [INFO] Default game type: SURVIVAL
    2012-09-26 23:52:25 [INFO] Generating keypair
    2012-09-26 23:52:25 [INFO] Starting Minecraft server on *:25565
    2012-09-26 23:52:25 [INFO] This server is running CraftBukkit version git-Bukkit-1.3.2-R0.1-b2352jnks (MC: 1.3.2) (Implementing API version 1.3.2-R0.1)
    2012-09-26 23:52:26 [INFO] [BKCommonLib] Loading BKCommonLib v1.27
    2012-09-26 23:52:26 [INFO] [Train Carts] Loading Train Carts v1.71.7
    2012-09-26 23:52:26 [INFO] [BKCommonLib] Enabling BKCommonLib v1.27
    2012-09-26 23:52:26 [INFO] BKCommonLib version 1.27 enabled!
    2012-09-26 23:52:26 [INFO] Preparing level "world"
    2012-09-26 23:52:26 [INFO] Preparing start region for level 0 (Seed:
    2012-09-26 23:52:29 [INFO] Preparing start region for level 2 (Seed: -6547100770947890571)
    2012-09-26 23:52:29 [INFO] Preparing spawn area: 40%
    2012-09-26 23:52:30 [INFO] [Train Carts] Enabling Train Carts v1.71.7
    2012-09-26 23:52:30 [INFO] [Train Carts] 0 Trains have been loaded in 0 worlds. (0 Minecarts)
    2012-09-26 23:52:30 [INFO] [Train Carts] Loading chunks near trains...
    2012-09-26 23:52:30 [INFO] [Train Carts] 0 detector rail regions loaded covering 0 blocks
    2012-09-26 23:52:30 [INFO] Train Carts version 1.71.7 enabled!
    2012-09-26 23:52:30 [INFO] Done (4.382s)! For help, type "help" or "?"
    2012-09-26 23:52:44 [INFO] CONSOLE: Stopping the server..
    2012-09-26 23:52:44 [INFO] Stopping server
    2012-09-26 23:52:44 [INFO] [Train Carts] Disabling Train Carts v1.71.7
    2012-09-26 23:52:44 [INFO] Train Carts disabled!
    2012-09-26 23:52:44 [INFO] [BKCommonLib] Disabling BKCommonLib v1.27
    2012-09-26 23:52:44 [INFO] Saving players
    2012-09-26 23:52:44 [INFO] Saving worlds
    2012-09-26 23:52:44 [INFO] Saving chunks for level 'world'/Overworld

    2012-09-26 23:52:47 [INFO] Stopping server
     
  23. Offline

    bergerkiller

    apriumben
    Small?! Please use pastebin.com or pastie.org, the people making these long-ass comments are steadily increasing. I even had to take measures and put friggen banners on dev-bukkit stating this. [zombie]

    For some reason it failed to find the train after loading up. I suspect this has to do with the chunk-based mapping it uses to bring trains alive. For some reason it thought the train could be restored but the chunk(s) containing the train weren't loaded yet. Now important bit: Does this happen all the time, or was it only this once? I did have to change the chunk coordinate 'type' of the minecart stored, that could be to blame for this problem. (I may have to use lastLocX/Y/Z again)
     
  24. Offline

    apriumben

    Sorry, it did look small on my screen - looks a lot bigger up here. I could have trimmed more out but didn't know which bits were relevant so erred on the safe (Large!) side.
    Anyway, to answer your question, yes it happens every time I have tried it, not yet ever had the train in place when I returned, and also re-crashing the carts into each other seemed to have no effect. I suspect if I deleted them and recreated they would link back together but am fully aware of the uselessness of suspecting things, if I get time to get back in before you next reply I'll test that properly
     
  25. Offline

    bergerkiller

  26. Offline

    apriumben

    Many thanks, how will I know when it has been updated, will it be shown as a separate download option?
    btw, I have deleted a few lines from the first log. I've also just looked at pastebin so will use that if I need to upload again- I can delete the rest of the log from the 1st post and replace with a link if thats a good thing to do

    edit:Was that link in your post there before? well I'll download now and try and post back.
     
  27. Offline

    bergerkiller

    apriumben
    The version with this change is in my previous post. I often make test versions with small changes to see if they fix bugs. If this proves to fix it, it will be in v1.71.8 of course. (or you can keep using the test build)
     
  28. Offline

    apriumben

    Great news, with test version no errors on start and stop server, and when I went back my 3 cart train still existed. I have a message now about updated craftbukkit, and no other plugins at all running so will gradually put back others, update etc and test as I go along. Full marks for updating so quickly!
     
  29. Offline

    CommanderGizmo

    Has anyone else exprienced any of the issues I did? Perhaps there is some strange conflict on my server or the new version didn't like the old data files?
     
  30. Offline

    bergerkiller

    CommanderGizmo
    Not sure if I replied, anyhow I did some tests with it a while back already...

    You are correct about this one, have to fix it. Not sure if that value is read at all...

    Seems fixed in 1.71.7...if it was a bug at all. Still happens?

    Latest version fixes this entirely.

    Still happening in 1.71.7? (I recommend using that test version I uploaded...)

    EDIT

    I uploaded v1.29 of BKCommonLib which fixes both the station and the collect/deposit bugs you mentioned. It wasn't reading the numeric values correctly.
     
  31. Offline

    CommanderGizmo

    Thanks for the quick fixes!
     

Share This Page