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

    Helmi74

    thanks for the update again, bergerkiller.

    Some thoughts about the grouping multiplier: Would it be possible to alway get a well balanced amount of each item in the group? Let's say we have a group 'food' defined in the config that contains chicken, fish and pork and i tell traincart to take out '5 food' from the chest so it "loops" through the group at takes one of each, until it reaches the overall amount? Alternatively it could take 5 from each which would probably be also useful sometimes. Maybe both is possible somehow?

    Just a thought... :)
     
  3. Offline

    bergerkiller

    Helmi74
    It's a bit impossible with the current set-up. Right now it just merged all chest minecart's inventories together into one inventory and sends that to a function to transfer items from/to. There is no real way to 'loop' through all items and take one from it. (yeah, unless I write such a function, but it's not that useful I think)
     
  4. Offline

    Helmi74

    hmm well ok. I don't know how others use that plugin but i find that item grouping to useful to not have amounts/multipliers in that.

    Otherwise i can always only take all of the (for example) food out of a chest (at least all that fits in my carts chest) and wouldn't have any room left for other stuff. The alternative would be to write every single thing on signs which makes it go like 20 signs below one chest - gotta find out if this works. :)

    Maybe my usecase is just too special.
     
  5. Offline

    bergerkiller

    Helmi74
    Isn't it a bit of the opposite? If I remove items one item per cart at a time, you would eventually end up with a lot of carts with one or two items in there. If I remove all items from one cart, then the next, and so on, eventually the carts would be empty and only a few carts would be left with a lot of items.
     
  6. Offline

    Helmi74

    bergerkiller

    ok probably we're just talking about different things. So to be sure i try to explain the situation where i am currently just in case i didn't do that correclty before (sorry, english isn't my maiden language):

    I've got kind of a storage facility with lots of big chests in there. these chests contain somehow sorted items (one has wood, the other iron, and so on). These item's get there via a sorting line (a circuit of rails with a storage minecart that delivers items to furnaces, takes them out, puts them into chests). Now a second line should take out some stuff out of the chests and deliver them to other locations. Therefore i need to have a mix of items in the storage cart(s) of this line - lets call it delivery line for now.

    The item grouping works fine until this point. The sorting line just takes out everything "food" (defined in the config) of the furnaces and other sources and puts "chest in / food" into the chest for food. great so far. Now for the delivery line i'd want to take out a defined amount of food without having to specify each product again. The reason that this amount should be defined rather than taking out all is the train would be full of food but there should be enough room to take other stuff too and deliver it to the receivers. Also i want the receivers to be able to take "5 food" or something like that.

    I can imagine 4 solutions for this problem:

    - writing "5*food" on the sign gives a random amount of each item in the group "food" but the overall amount would be 5 of course.
    - writing "5*food" would take one from the first item in the group, one from the second (and so on, the looping stuff i wrote above)
    - writing "5*food" would take 5 of each items in the group. (That would at least be the way i would have to do it with one sign for each item :eek: )
    - writing "food-5" would take a group named "food-5" that has amounts setup in the groups list in the config.


    Basically the last solution would be kind of unhandy i think. You said looping isn't possibl due to technical reasons so the second one also dies. Maybe the first would be possible? Or at least the third?

    Hope you got my point. I think building storage facitlities and production chains with train carts is something lots of people do and having such a feature should be helpfull not just for me - at least i think so.

    Best,
    Frank
     
  7. Offline

    bergerkiller

    Helmi74
    Hmm and what if you add a new shortcut for '1ofwood' or something that contains this:
    And whatever food names you got. Then it would take one of each and put it into the cart. Only issue is that it doesn't limit it to 5 items then, it could end up with 7 depending on the amount of types in the cart.
     
  8. Offline

    Helmi74

    bergerkiller

    that already works? If yes than it's strange cause i suggested that already and it isn't documented. It would be a usable solution but having one group for all amounts and giving the amount on a sign like "10*food" would still be better.

    The exact 5 item thing isn't that important - the important thing is that i can take a few things out without having to take it all.

    I don't know if you missed it in an older post but as i got no reaction i'm gonna copy it here:

     
  9. Offline

    bergerkiller

    Helmi74
    This is now in the final 1.72.1 version:

    http://dev.bukkit.org/server-mods/traincarts/files/54-v1-72-1/

    I recommend using the newer BKCommonLib build, as it fixes issues with item stacking:

    http://dev.bukkit.org/server-mods/bkcommonlib/files/16-v1-37/

    I added a 'grouped multiplier', which looks like this:
    This will transfer all of the items in the food constant 4x. In short, if the cart contains 4 bread and 2 pork, and you use 3_food, it will put 3 bread and 2 pork into the chest. This does mean that there could be more than 3 items being transferred over. I can't limit this, because that would result in some items not getting transferred over at all.

    And to do this selectively, put a switcher sign underneath each transfer sign (chest in/out) that power it. On this switcher sign, just put the tag name to check against on the third line. It will power the sign if that specific train (or cart) has the tag set.
     
  10. Offline

    Helmi74

    bergerkiller

    this is awesome - thanks so much. This will help a lot.

    Just to be sure: _ is the multiplier for groups? So the group is still named food and 3_food means "up to amount 3 of any item in the group if available", right? So the one you suggested above (having a group named 3food with 3xbread;3xsteak in it wouldn't work, right?

    you wrote [+train] in your example - i didn't know that [+train] so far - is this something special or just a typo?

    I'll try the switcher sign with the tag of the train - that is awesome, too.

    Thanks for your hard work - you're really doing a great job.

    P.S. did you see my comment on the dev-page of redstone mania? think it gets overlooked but don't know where to post... http://dev.bukkit.org/server-mods/redstone-mania/
     
  11. Offline

    bergerkiller

    Helmi74
    I've been a bit busy so I probably overlooked. Anyhow, 3_food means that it will go through the entire 'food' items list 3x. You will get 3 bread, 3 steak and so on.
     
  12. Offline

    Helmi74

    bergerkiller

    one more thing i just came up to: is there a way to fill items into a storage cart via chest out or into a chest via chest in that allows to fill only a defined amount no matter how much is in there yet?

    example: i want a storage cart to alway contain 5 iron_hoe but not more as i need the space for other stuff. My currect workaround is do "chest in / iron_hoe" when driving by the iron_hoe storage chest and under there "chest out / 5xiron_hoe" - this way i'm quite sure the storage cart always contains 5 iron_hoe as long as the chest has enough.

    Problem is: when the chest is full of iron_hoe the first sign fails to put in the iron_hoe that are still in the storage cart and if there are already 5 it would put another 5 with the next sign. What would be great is a command that only fills a chest/storage cart to a set amount. Probably there is something yet that i have overlooked?

    Thanks for helping!
     
  13. Offline

    bergerkiller

    Helmi74
    There is no good way to do this other than this I think:
    • One chest is full of iron hoes
    • One sign to transfer all iron hoes from the cart into the chest
    • One sign to transfer 5 iron hoes from the chest into the cart
    In this order. So the cart -> chest is above the chest -> cart sign. There is no way to 'transfer until x amount of item y' right now.
     
  14. Offline

    Helmi74

    But cart -> chest would be ignored if the chest is full or would it still work if it's just on the same piece of rail?

    Apart from that... having such a "fill up to amount x" feature would still be great :cool:
     
  15. Offline

    bergerkiller

    Helmi74
    Yeah that's the only downside to it. I think I can actually write such a thing to do that, it's just that I don't know of any syntax rule I can use for it...
     
  16. Offline

    Helmi74

    how about 3^food or ^3 food (for "(fill) up to 3 food") - the first one sounds less logical but saves a character. apart from that i think any syntax is okay as long as it is documented.

    P.S: Regarding Redstone Mania it now doesn't seem to work at all anymore. see my comment here http://dev.bukkit.org/server-mods/redstone-mania/
     
  17. Offline

    ichat

    he im runnin bkcomonlib 1.37 and trancarts 1.71.9

    the trains seam to be formed - but i can not interact with the furnace minecart, even thouh i apply coal, it doens't power up and its not running... i can still enter normal carts, add items in the chest cart... just no more 'steam trains' and i happen to hate redston for any other thing than signalling it just makes the game less authentic..

    minecraft server is: #2483.

    there is no error messages in my bukkit lol (using bukkit guy)
     
  18. Offline

    bergerkiller

  19. Offline

    Helmi74

    bergerkiller

    I updated to the latest 1.4.5 bukkit server beta today and it seems like i'm having trouble with train carts. chest out signs without a parameter following (so chest out all) doesn't work anymore. If i for example add "cobblestone" in the third line it fetches all cobblestone but without a 3rd and 4th line it doesn't touch the chest.

    I've just downloaded the Dev version but that doesn't change anything. I've also updated to the BKCommonLib which you uploaded yesterday but that all doesn't seem to change anything.

    Apart from updating the server i've installed WorldGuard - may there be a conflict here? I've disabled chest protection in WorldGuard so i don't think there should be conflict potential.

    Any idea? Thanks!

    Edit: the same seems to go for "chest in". :(

    some addition: I did try around a bit, disable some other plugins, tried using [train] instead of [!train] (then with a redstone torch of course) but couldn't find anything that changes this weird behaviour - so i guess it's a bug? :(

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

    bergerkiller

    Helmi74
    Redstone Mania is updated, I had to do that first. Now I am free to work on TrainCarts and NoLagg again, *yay*. Got a bit tired of the TrainCarts code all the time so I decided to update the other plugins first if you don't mind.

    I know of the chest in/out bugs and how it's not working for all-empty lines-signs, I will fix this up as soon as possible. (tomorrow)
     
  21. Offline

    Helmi74

    no need to apologize :) Thanks for the great work - i'll update redstone mania next - that didn't work either :)
     
  22. Offline

    bergerkiller

  23. Offline

    Helmi74

    great, thanks. Will give it a try ASAP.

    EDIT: Looks like it's working again - great, thanks.

    i'm not quite sure but it looks like there's another bug that completely empties chests no matter what i put under chest out :(

    all of my chests are empty now that have anything like "chest out" on a sign - looks like a horrible bug because those stuff isn't in the mine carts chest then but just dissapears to nothing :S

    ok did some more testing on a dev server. looks like now only "chest out" works and all arguments after that get ignored. On my test server the stuff at least was in the cart. on the production server carts were empty. don't know where this comes from - will check some more.

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

    Helmi74

    again some more testing :)

    Chest in/out seem to have the same bug - all filters in line 3/4 are ignored which means a chest with a sign like "[!train] / chest out / 20xcoal" gets completely emptied and a chest with "[!train] / chest in / wheat" gets filled with everything that is in the storage mine carts chest.

    didn't check furnace in/out.
     
  25. Offline

    march75

    bergerkiller
    I can confirm the problem with chest in/out and this is a huge problem for us.
    Do you have an idea when you are working/fixing traincarts again?
     
  26. Offline

    bergerkiller

    Looked over the source code, and I know what's wrong. It interprets:
    As:
    And splits that up into 20xcoal and <empty> again. The <empty> is interpreted as 'all items', invalidating the other. I'll fix it pretty soon, and upload a beta version today.
     
  27. @bergerkiller

    We are experiencing some issues with the eject sign, we cannot put negative numbers in to eject the player
    5/0/0 and -5/0/0 will put the player in the same spot also 0/0/5 and 0/0/-5 will put the player in the same spot, it does not matter what direction the cart is travelling.

    We also notices that when in a train that the cart visual effect client side is very jerky but the ride is smooth

    TC: v1.7.2.1
    Lib: v1.38
     
  28. Offline

    Astrae

    bergerkiller

    I just updated my server to the latest traincarts and commonlib, and I'm seeing some trouble with the addon as more and more trains are automatically spawned. Things start out ok, but over time, I start getting thread exceptions and my /train destroyall stops working:

    error log here: http://pastebin.com/zJwAyPMA

    Eventually, the whole server locks up and I have to restart it. I've turned off all of my automated spawners and that seems to be avoiding the issue for now.
     
  29. Offline

    bergerkiller

    Lexion
    Astrae
    Test version is here:

    https://dl.dropbox.com/u/3681706/TrainCarts v1.72.2 TEST1.zip

    • Allows additional signs to be placed under announcer signs to extend the message
    • Fixes the error of member being unloaded
    • Fixes the problems with the item transfer signs
    About the ejector sign - it is a pretty severe bug in BKCommonLib. It will be fixed in the next versions of that library, which will also include new permission handling. Test version includes the BKCommonLib dev build that fixes this problem.
     
  30. Tested eject sign now working with negative numbers

    Thanks for the fast fix

    @bergerkiller

    Cant seem to remove a sign with eject on it, once placed cant remove sign at all. Tested on a world with just TC installed and default TC config

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

    bergerkiller

    Lexion
    Working on that one. After the second interact at a given interval you are allowed to break it.
     

Share This Page