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

    Qi Xiang

    My console keeps spamming this. Is it normal??
    [​IMG]
     
  3. Offline

    bergerkiller

    Qi Xiang
    You have to update BKCommonLib or CraftBukkit. The missing 'chunks' field is either caused by BKCommonLib being outdated or you using the newer BKCommonLib with an older CraftBukkit. You need CB 1.3.2 R1.0 and BKCommonLib 1.30 in combination.
     
    Qi Xiang likes this.
  4. Was ist da los? Ich kenn mich bei dem nicht aus.
     
  5. Offline

    bergerkiller

  6. Offline

    Qi Xiang

    My trains keep disconnecting after some time which means like all the carts in a train disconnect fromt each other and the minecarts that disconnected behave like a normal minecart bouncing off each other... is it my server or the plugin??
     
  7. Offline

    bergerkiller

  8. Offline

    Qi Xiang

  9. Offline

    bergerkiller

    Qi Xiang
    Yeah I want to update TrainCarts at some point. Waiting for MyWorlds and NoLagg as they need possible BKCommonLib fixes
     
  10. Hi there! Thank you for the update making it working finally! Seems that everything's fine thanks to your work!

    Now, I just saw in the config that carts can break crops or other configured items... Could be usefull if they also could actually pick up, in storage carts, items on the ground and deposite them in storages when passing by...
     
  11. Offline

    bergerkiller

    Psychokiller1888
    They can. You can use the transfer signs to put storage minecart items into chests, and you can use the pickup property to make the train pick up items.
    They will then pick up nearby items and put them into storage minecarts.

    The transfer sign can also pick up ground items using the 'collect g'. 'deposit g' drops all the items onto the ground.
     
  12. Offline

    bergerkiller

    Great news! Next version will contain a 'vertical rail' for you to use. After pressure plates, you can now also let trains ride on ladders!

    2012-10-28_02.08.31.png

    The only bug that lets me from publishing it, is that it tends to fold together when the train reaches the bottom of the vertical rail. Only happens in one direction, so it shouldn't be too hard to fix.
     
  13. Offline

    Qi Xiang

    this looks very interesting.... can't wait :)
     
  14. Hey dude, great job! You might want to make them ride under blocks also directly, so we can build loopings...
     
  15. Offline

    bergerkiller

    Psychokiller1888
    One thing at a time, because the Minecraft client doesn't properly snap the minecart(s) to the rails then. I see this as a first essential step to make this a bit more possible.
     
  16. My plugin seems to be disabled by default, do I need to manually enable it?
     
  17. Offline

    bergerkiller

    Mazza101
    None of my plugins work on 1.4 yet, I will add 1.4 support tomorrow. The plugin most likely disabled itself because of a fatal error.
     
  18. That's likely to be why then, I am looking forward to this update :) Thanks!
     
  19. Of course bud, was just to point it out, not expecting it to be made like magic :)
     
  20. Just updated to the latest version, works a charm - what a brilliant plugin! Thanks bergerkiller :)
     
  21. Offline

    CommanderGizmo

    Thanks for updating this for 1.4 so quickly bergerkiller. I'm really enjoying the new features you've added. That ground pickup and vertical rails are pretty sweet!

    Unfortunately, the rest of our plugins are not quite so expediant. Would you be willing to release an update for the 1.3.2 version of your plugin that fixes the switcher signs? I am also experiencing lots of issues where carts get stuck when going around a 90 degree bend in the track which is lined with blocks or an S-curve using opposing 90 degree corners. I'm sure all that would be required is a quick merging of revisions in github.

    I'm using CraftBukkit 1.3.2-R3.0, TC 1.71.9 and BK 1.32. Thanks for keeping up with your plugins!
     
  22. Offline

    dVoCex

    Thanks for this amazing plugin and your hard work, bergerkiller. We 're using it for a year now, great experience :)

    Could you please add support for diagonal stations? Build my train station before testing it. :/ 2012-11-01_10.54.53.png Property sign's working fine, but station signs are ignored by trains.
     
  23. Offline

    bergerkiller

    CommanderGizmo
    Unfortunately I can't go back to 1.3.2 now, there are a lot of changes of 1.4 that make this nearly impossible. I did fix a lot of things for the next 1.4 version:
    • Signs using powered rails as power source - fixed
    • Pressure plates not read as power source - fixed
    • Trains not stopping/merging/delinking near vertical rails - fixed
    • Trains merging together when stopped by players/entities - fixed
    • Signs not working on slopes below vertical rails
    • New rail logic implementation to free myself of native Minecraft logic - more efficient
    • Fixed minecarts entering blocks when going down slopes (was a minecraft bug)
    • Fixed powered rails (not always) launching minecarts correctly
    And maybe some other small tweaks that had some impact, such as a better vertical movement of trains when launching into the air, they no longer slow down within a block. I am now in debug phase, testing for possible other issues. I will try to get the station/other signs working on diagonal (actually curved) track pieces.

    https://github.com/bergerkiller/TrainCarts/commits/master
     
  24. When I do /train private - it still allows people to enter the train. How can I make it so only the owners can use it?
     
  25. Offline

    CommanderGizmo

    bergerkiller

    I certainly appreciate your wanting to support the latest version of MC as quickly as possible. It is really quite amazing that you found it possible to implement the changes so fast. However, I do wish it were possible to provide a stable version of the plugin as a base to start from before supporting a dev build. We are all enjoying this plugin very much, but the enjoyment would be even greater if some of the old bugs could be sorted out and the plugin made stable before new features are added.

    I want to be clear that I do not intend to criticize here; but rather want to offer an alternative development path. I cannot find a version that supports 1.32 that does not have some critical bug that completely breaks some part of our train system. Would it be helpful if someone were to construct a through testing ground which would put the plugin through it's paces quickly to find any weak points? What do you think: Is there anything the community can do to assist in this?

    Thanks again for this awesome plugin! I don't think our server could be considered complete without it, or with your constant support for our requests.

    Ok, I just updated to latest verison: CB 1.4.2-R0.1; TC 1.72.0; BK 1.33

    My carts are still getting stuck when turning corners next to walls or while under low ceilings (one block high). My switcher signs seem to have no effect at all. Am I the only one?

    [EDIT]
    Let me clarify. If I put two carts together, they get stopped when going around a corner. If I put three carts, the train gets split into separate carts which each go a different way at the junction. This junction is just a three way track with three signs under it; each starts with [!train:<direction>] and contains one <direction>:true line. Thus, it should apply to the train and switch the entire train depending on where it came from. What's going wrong here?

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

    bergerkiller

    CommanderGizmo
    Speaking of testing phases, I think there are about 3 servers actively testing it. So far they helped me spot and that way fix about 6 bugs. They range from signs not being detected to minecarts flying into orbit around the world.

    To get rid of the issues I want to make a better use of branches. Basically, I will create a 1.4 branch that has all the 1.4 changes AND ONLY THAT. Problem this time, and which is usually the problem, is that BKCommonLib also changes. In my case I decided to replace all old 'isSign/isRail/isWhatever' functions and overloads to a MaterialProperty static variable instance with which I can work. This simplified a lot of things:
    This is a change that had to happen, but as a result I can no longer keep 1.3.2 development on pace, because all methods I use are deprecated, and I can't use the new instances. I can try and put all the deprecated -> instances in a change for 1.4, but it is going to cause issues along the way if I forget to use a deprecated function somewhere.

    I'll upload the latest dev version for 1.4 later today. Among the changes are fixes for signs not responding to trains correctly, and that trains now trigger signs in corner pieces. What you are having is most likely a bug. It uses cart.getDirectionTo(), which is incorrect to use in corners, as that is the direction 'it is going to next'. I had to use cart.getDirectionFrom(), which makes a world of a difference for switcher signs in general.

    For today I still have to fix a few issues before I can officially upload it:
    • Carts no longer stackable on top of each other; they go right through each other
    • Station sign not functioning on corner tracks (diagonal station is the goal here)
     
  27. Running the latest version I've noticed the following, not sure if they're bugs or I'm doing them wrong.

    Train set to Push Players gets stopped by players.

    /train private not working EDIT: Train privacy seems to be working now, strange.
     
  28. Offline

    CommanderGizmo

    bergerkiller

    Perhaps due to the complexity of this plugin it would benefit from unit testing. I propose that a world is built which has all the elements and most likely combinations of elements that players will be using (and frequently complaining about) setup and ready to go. You can then simply load the world and test each component. This will allow you to quickly use a standardized test to ensure no old bugs have shown up again as well as catch a fair number of new bugs before release. Anytime a new bug comes up you can just add to the world to care for that case as well. Wireless Redstone and the new server command blocks should come in handy for this as well. I would be happy to assist in building such a world if you would like.

    I really appreciate that you are constantly working in your spare time to make my game experience better. Thanks for staying so on top of this incredible plugin!

    [EDIT]
    Can you turn that minecart orbiting thing into a feature? That sounds awesome!

    Also, I'm getting spammed with this, and even more of this in my server log.

    CB 1.4.2-R0.1; TC 1.72.0; BK 1.33

    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

    CommanderGizmo
    I have 2 test worlds (lowgrass and flatgrass) but they are...how do I put this...a mess. Random rails obstacles everywhere. It's because I stick around in an area for a while to test a lot of different stuff, and then I move on.

    It is not really possible to make unit tests for this, as you have to test minecart physics on an actual server. There is no good way to simulate an entire world of blocks properly. Adding to that, how to write a test validating that a minecart 'doesn't fly away' and 'takes all corners'? You would have to include physics (expected) in the unit test, which would result in errors in the test, and so on.

    For now, I'll just try to do what I can do to keep stuff stable. It will get better. :)
     
  30. Offline

    CommanderGizmo

    Just a note to clarify:

    The 'java.lang.NullPointerException' errors spamming my log appear to be comming from a train each time it passes a sign as follows:

    Code:
    [!train]
    craft
    42
    
     
  31. Offline

    bergerkiller

Share This Page