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

    xcanner

    @bergerkiller this would make an simple metro, more "advanced" than needed.

    Check out http://www.crafters.dk/worldmap/ we have a huge metro on this world and lots of users. Thats why i was hoping for an simple solution.

    Another thing to keep in mind is that in a perfect world, users are only travelling from "stations", but in reality players are jumping on/off minecarts all over.
     
  3. Offline

    bergerkiller

    @xcanner Impressive world :)

    And that's what the 'allowPlayerExit' is for, you can use that to prevent players from exiting. I'll add forcing abilities in them in the next version to make disconnecting fail as well.

    And in the next version the 'atStation' variants will be replaced by default flags.
     
  4. Offline

    xcanner

    @bergerkiller its never a good idea to restrict players. Why is it that you think a property that allows emptycarts not to move (or move very slowly) is a bad idea?
     
  5. Offline

    bergerkiller

    @xcanner because you don't know where this cart comes from. If someone else, far far away, places a minecart on his mob catcher machine, it wouldn't move.
     
  6. Offline

    xcanner

    @bergerkiller thats why it shoud be a property allowing each server to choose :) The players on our server would rather have the feauture to disallow runaway empty minecarts.
     
  7. Offline

    bularax

    I placed a powered rail after 10 blocks after a station and it still doesn't boost the cart...

    btw i use:

    [train]​
    station​
    5​
    continue​
     
  8. Offline

    bergerkiller

    @bularax Must be an annoying bug with the stations not resetting the isAtStation then...

    Ow well new coding is incoming anyway, can only say: wait for it, we are fixing existing bugs, improving everything where possible.
     
  9. Offline

    Maylife

    hey
    I don't know where to put this, as its a mix of your 2 plugins
    but my problem is with train jumping with myworlds

    could you add on the myworlds [portal] signs the same dicecon control from the stations
    so the signs would like

    [portal]
    ts1
    ts2
    right

    because atm its really hard to get the carts running the right way and adding that would stream line it all

    Thanx
     
  10. On 1.47 (using this one, as boosters are dead on 1.48), train duplication after portal teleportation still occures, juste experienced a hour ago that completly crashed my server. Can't tell you how many were created, as I can't even start the server, as it runs out of memory before ^^
     
  11. Offline

    bergerkiller

    @Psychokiller1888 Why do you think I updated to 1.48, mh?

    If you simply don't use stations (or don't touch trains at stations) boosters and powered minecarts work just fine.
     
  12. Thought we fixed duplication on 1.47 actually. 1.48 was more a multiple little bug fixes :) Anyway, I have time, I can wait, I reported because I truly thought 1.48 did not have anything to do with duplication fix.
     
  13. Offline

    DomiStyle

    @bergerkiller Is there a way to give trains a little extra boost when they reach a booster rail?
    They seem to be slower then a single minecart and always stop on my tracks.
     
  14. Offline

    ledhead900

    @bergerkiller
    Could you take a look into how trains work in unloaded chunks please It seams on my testing server after a restart and even during when the chunk unloads, my 3 cart train occasional gets stops at certain corner areas.

    The carts become stationary. If you want to see this first hand pop on over to our test server, you still have the address ?
     
  15. Offline

    xcanner

    Can's get property/speedlimit signs to work?
    [train]
    property
    speedlimit 1.00

    Edit:
    Oh, forgot a redstone tourch by the sign
     
  16. What means if you don't touch them? Meaning you let the trains go empty on the tracks? If i step in a spawned train that is waiting in a station, boosters won't affect it.
     
  17. Offline

    xcanner

    Destinations over long distances. I have following setup:

    "Distination A sign" - 100 blocks rails - "Tag sign"

    From the tag sign there is 2 destinations (B and C)

    "Distination B" sign and "Distination C sign"

    From the tag sign, there is 100 blocks rails to destination B and about 6000 blocks to destination C. Some how it seems like its forgetting destination C.

    Is it the long distance?
     
  18. The destinations code will attempt to follow rails to see where they go, but needs to be able to reach at least another tag or an end-destination to be able to remember it. No chunks are loaded during this process (to safe resources in exactly your case - big distances), so only loaded areas can be "discovered" by the search algorithm.

    To get your destination to work over long distances, you have 2 possible "solutions":
    1. Either make sure the entire 6000 blocks of rail are loaded chunks (perhaps by having people stand along the tracks or walking/flying by the track once, depending on server config and all that...), or,
    2. Place several tag signs along the way. This will still not instantly work, as the final destination does not become more "reachable", but if you sent a minecart from C to A or B with a few tags along the way (every 1000 or so blocks should be good, I think), it should then make the full connection upon reaching your original tag, and A/B to C will start working as well.
    Solution 2 works because every tag, when passed over by a minecart, checks its neighbours and copies their knowledge to itself. This way the fastest path from any point to any other connected point is always discovered eventually.
    The plugin will remember any "discovered" paths and destinations, saving them to a special file. So once discovered, it will not forget unless you change the tag switchers afterwards. (And in that case, a /train reroute may be neccesary to get everything working properly again... but not always.)
     
  19. Offline

    xcanner

    @Thulinma So solution 1, you would have to "load" all the chunks every time the server restarts? Solution 2 works "all the time" even after a server restart?
     
  20. Both are remembered until you do a /train reroute. It's just that solution 1 is harder to "repeat" if you ever need to :)
     
  21. Offline

    xcanner

    Thanks for the help. Gonna roll with solution 2 :)
     
  22. Offline

    bergerkiller

    Ok people updated to v1.49, lots of awesome fixes and features. I bet you will love having trains go through corners and slopes at full speed...well it's now possible! Infinite train speed. :)
     
  23. Offline

    kalez

    Not sure why, but after copying the examples in your videos exactly, if the train is longer than 2, when it tries to do what the sign says (continue/reverse/etc) it appears to "catch" the next cart in the train and stop again, attempting to do what the sign says AGAIN. so the train will stop, start to go, stop, for some reason try to go the other way, stop, etc.

    1.49 1337

    Also when the issue above was happening, i tried to break a middle cart and i got this:

    2011-11-21 03:33:35 [SEVERE] java.lang.NullPointerException
    2011-11-21 03:33:35 [SEVERE] at com.bergerkiller.bukkit.tc.VelocityTarget.update(VelocityTarget.java:74)
    2011-11-21 03:33:35 [SEVERE] at com.bergerkiller.bukkit.tc.MinecartGroup.updateTarget(MinecartGroup.java:360)
    2011-11-21 03:33:35 [SEVERE] at com.bergerkiller.bukkit.tc.MinecartGroup.doPhysics(MinecartGroup.java:703)
    2011-11-21 03:33:35 [SEVERE] at com.bergerkiller.bukkit.tc.MinecartMember.s_(MinecartMember.java:77)
    2011-11-21 03:33:35 [SEVERE] at net.minecraft.server.World.entityJoinedWorld(World.java:1193)
    2011-11-21 03:33:35 [SEVERE] at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:104)
    2011-11-21 03:33:35 [SEVERE] at net.minecraft.server.World.playerJoinedWorld(World.java:1175)
    2011-11-21 03:33:35 [SEVERE] at net.minecraft.server.World.tickEntities(World.java:1090)
    2011-11-21 03:33:35 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:467)
    2011-11-21 03:33:35 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    2011-11-21 03:33:35 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-11-21 03:33:35 [SEVERE] Unexpected exception
    java.lang.NullPointerException
    at com.bergerkiller.bukkit.tc.VelocityTarget.update(VelocityTarget.java:74)
    at com.bergerkiller.bukkit.tc.MinecartGroup.updateTarget(MinecartGroup.java:360)
    at com.bergerkiller.bukkit.tc.MinecartGroup.doPhysics(MinecartGroup.java:703)
    at com.bergerkiller.bukkit.tc.MinecartMember.s_(MinecartMember.java:77)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1193)
    at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:104)
    at net.minecraft.server.World.playerJoinedWorld(World.java:1175)
    at net.minecraft.server.World.tickEntities(World.java:1090)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:467)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
     
  24. Offline

    Drugsnix

    i found a Bug. When i used the mod it keeped ketting stuck [ not on the way that the cars aint moving ... but you cant remove some off them when you used them.]
     
  25. Offline

    bergerkiller

    @kalez Thanks, yet another spot where I need to check if the member-to-target is dead. :)
    @Drugsnix Do you mean 'ghost carts': you can't interact with them and if you rejoin these carts disappear?

    I'll look into the whole targetting thing, it's possible that every single minecart is re-triggering the station (GROUP_ENTER), I'll look into it later.
     
  26. Offline

    kalez

    Cool! But yeah i also had some of the same errors as Drugsnix. it seemed, at times, that after the train was pushed out of the "stuck" position (if you could, sometimes you just walk through it uneffected), when it hit the end it would not respond to the button+redtrack i had to get it going again, UNTIL i broke the front car, then the rest of the cars would move forward at rocket speed, as if there was some trapped momentum. after that the remaining train would function as normal.

    this only seems to happen when the station sign (as far as i know, i have not tested any other sign), it does not happen if controlling a cart train with normal redtrack functions alone, that i noticed anyway.
     
  27. Plugin v1.49

    Happened when trying to spawn a trani in my trainstation. First time went ok, got to the second train station, the cartz I was sitting in got destroyed, everything fine. Called a new train to go back, never came, server crashed of OOM, Sad, the boosters were working in this one. Back to 1.47


     
  28. Offline

    bergerkiller

    @Psychokiller1888 Related issue to the previous, I'll work around it. :)

    EDIT

    Both NPE's fixed, I'll add some checks in the velocity targeting to stop targeting if the cart can not be moved any more.
     
  29. Thanks! You'll bring out a 1.50 with the fixes or you fixed 1.49?
     
  30. Offline

    bergerkiller

    @Psychokiller1888 Will be 1.49.1, decided to keep 1.50 for the 1.00 official release :)

    EDIT

    Ok all issues resolved. Station launching now 100% working, also made it launch trains a bit quicker and slow them down a bit slower too. It was a bit of an on-off situation at first...

    Ok updated to v1.49.1, fixing the NPE's mentioned above and improving/fixing the station velocity targeting.

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

Share This Page