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

    robxu9

    suggestion: use 1.6 beta 9 :| it's a beta, and it has bugs, but it doesn't have that one.
     
  3. Offline

    Sg1team

    What bugs can you speak of that beta 9 has? If they aren't soo serious I will give it a try, because having to clean up all trains after a server restart can get annoying;-)
     
  4. Offline

    robxu9

    TBH, I just installed beta 9, and it cleaned up pretty much all of the problems I had before. There are some syntax changes IIRC like @bergerkiller posted above, but that's pretty much it... I just need to figure out portals and I'm set :D
     
  5. Offline

    Sg1team

    I tried this out and I am not getting this error anymore, but my trains behave exactly as before (stopping or driving in wrong directions) after restart.
    Another problem I have is that trains sometimes don't make it through curves which come directly after stations if "slowdown" is set to false. They turn around right before the turn. If I set slowdown to false this doesn't happen. I can make a quick video of this problem if it helps ;-)
     
  6. Offline

    bergerkiller

    @Sg1team aah that clears it all up, then I can focus on the native coding. It disables some code parts there to get rid of things like slowing down, friction and slow-down in slopes. It is possible that a key turn part got removed as well..

    And yup, beta 9 has some issues still, but if I never uploaded beta versions it would be a lot worse by now. You guys gave me perfect help in spotting (serious) bugs soon enough. :)

    @hiro24 Trains spawn without owners (that's the default). If no owners are set, everyone should be owner...but I'll check it.

    @LinkDude80 How does 1.6 beta 9 work out? Guess I'll go out of beta soon to get people to use this new version...but it has to be 100% stable to do that :/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Sep 9, 2018
  7. Offline

    McGarnicle

    I just found this plug in yesterday, GREAT work on it! Everyone on my server was instantly in love. I've just started to work with it, but it seems like the pushmobs function isn't working. Or I'm misreading what it's supposed to do. In either T/F setting the mobs are unaffected by cart impact, the settings seem to adjust how far I bounce back off them. Is it supposed to be pushing mobs out of the cart's path? Or is it supposed to be pushing me back with enough momentum that I return to the last station?

    We'd love if it plowed mobs off the path!

    I'm on beta 9.

    Thank you for your excellent work on this plug in!
     
  8. Offline

    bergerkiller

    @McGarnicle it should push them left/right of the cart when hit, but with the latest configuration changes nothing is certain anymore...as always, time to debug :)
     
  9. Offline

    Sg1team

    Uploading betas is great, so one can have a glimpse at what is coming in the next versions. But just to make this clear: The problem with trains sometimes not making it through turns is in version 1.54, not in the beta.
    Besides, I love that plugin, because it is the only one (in connection with Redstone Mania) that makes it possible to build a large automatic railroad system without having to build multiple floors packed with fancy redstone circuits ;-)
     
  10. Offline

    hiro24

    Thanks for all the help.. I guess I was just making things hard on myself. I figured if the tag couldn't see the destination signs in unloaded chunks I'd put extra ones, but I didn't know they shared data like they do.. truely an awe inspiring achievement. Kudos! One more thing though that suddenly I'm having trouble out of. I'm on I think 1.6 beta 7, and suddenly I can't set train locations on trains that are spawned via the train spawner signs. I can't do anything w/ them.. says I'm not the owner. Did something change or is there a setting I need to modify?
     
  11. Offline

    LinkDude80

    @bergerkiller
    It happens with single minecarts. Trains (which run on the freight rail which has more powered rails) are working fine.

    Using Version 1.53 craftbucket 1597
     
  12. Offline

    -FroZen-

    I have a new problem in Beta 9

    Situation:

    One train stops at the first station, another train is "too fast" and has to stop at the second station.

    But since Beta 9 the "second train" doesn't start driving to the first station (after the first station gets empty)


    [​IMG]

    Red = Redstone ;-)
    Blue = Railway
    Black = Station


    (But all the other bugs are gone =) )
     
  13. Offline

    bergerkiller

    @-FroZen- So in other words:
    1. 'empty' station sign
    2. One side is permanently powered
    3. Other side is powered when the train enters it
    4. Train stops properly
    5. One side loses power
    6. Train does not get launched into the expected direction (the side that is left powered)

    I'll see what I can do about it. *opens up SignActionStation.java*

    EDIT

    Got it. The station sign uses REDSTONE_CHANGE, but still reads the 'powered' state from the block. Since this is not yet updated at REDSTONE_CHANGE it will not know that the (changed) side is now no longer powered, thus it doesn't launch. I'll add an argument to set if the sign is powered or not.
     
  14. Offline

    BadKarMa

    Hi, you asked for our plugins. This is the "usual" list:

    chatbukkit.jar
    Essentials
    Essentials.jar
    EssentialsChat.jar
    EssentialsSpawn.jar
    LWC
    LWC.jar
    MailBox
    MailBox.jar
    MailBox_db_file.db
    Modifyworld
    Modifyworld.jar
    MultiInv
    MultiInv-12.jar
    Multiverse-Core
    Multiverse-Core-2.2.jar
    Permissions.jar
    PermissionsEx
    PermissionsEx.jar
    plugins.txt
    RealTeleporter
    RealTeleporter.jar
    Safe Creeper
    Safe Creeper.jar
    scrapbukkit.jar
    Tent
    Tent.jar
    Train Carts
    TrainCarts.jar


    However we deactivated most of them except Essentials, ModifyWorld, MultiVerse, Permissions etc and currently no TrainCarts :(

    Okay, a little update on my problem:
    We've found 48000 entities on our server. I advised the admin to enter "/[train] remove all" in the console. It said that 6 trains were removed. Afterwards we had around 400 entities on our server.

    As this is the same problem our server experienced several versions ago (my post here), my admin doesn't want to install TrainCarts anymore without good reason that this problem is solved. :(
    He also doesn't want to install NoLagg because he's afraid of chunk-corruption. So I cannot test that.

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

    Porvora

    Running a 1557 server: it's impossible to place or destroy carts in zones flagged with world guard. What do?
     
  16. Offline

    bergerkiller

    @BadKarMa I can't argue against it, it had issues for all that's worth. If only people would take effort and looked at the code, then they knew why some things are inevitable to prevent from happening. In TrainCarts there are about 60 classes, 400-500 lines in each on average, and all code that I have to comprehend, even native 'Notch' mess.

    Why all the minecarts? Well, for some reason, there is a hidden infinite loop somewhere: native->custom and while this happens, it finds the old minecart and performs the same operation AGAIN, and this goes on forever. I did add several (global) checks against it to prevent the spawning of carts while a cart is being replaced, unfortunately it now appears to happen randomly in just-loaded chunks. It's quite a pain...

    TBH, I never really have this anymore while developing the newer beta versions, so it's pretty hard to find out if the bug is fixed or not. If anyone running the 1.60 beta v9 has this issue (you see a frozen cart, hit it with a sword, another cart is inside and this goes on for 10K carts), then please reply. It used to be an issue of the past...

    About NoLagg, I've been running it for 4 days now, in just-created worlds and 'static' worlds, haven't seen a single issue. As for right now it lacks safety checks against faulty code (it assumes everything is as it has to be), therefore don't use NoLagg on builds other than in the download description EVER. I can't possibly know the results on another version. And if you use mods, disable the buffered chunk loading feature; it's the main cause for chunk corruption.

    @Porvora AFAIK this has not much to do with TrainCarts, maybe you need to change a set property for the region you have the issues in? WorldGuard defines multiple region 'flags' you can set, such as block placement and if fire spreads.
     
  17. @bergerkiller MC 1.1 code is in CB git, I'll be sending you a pull request with the proper support for it soon, if needed (going to try it now, but most likely they renamed everything again...) :)

    Actually, this had to do with the server unloading chunks. Apparently the TrackMap is not able to properly load chunks at all times (I gave @xcanner a modded build that forces a load of all chunks the TrackMap goes into, but that didn't help either). Very confusing stuff, and I can't replicate it on my own server for some reason... Or did you put the 10k limit on the TOTAL distance? I hope not...?

    Like was already explained to you, you only need to place destinations signs AT the destinations themselves. Not at the intersections. Also, never place two destination signs right next to each other (you need at least 1 piece of normal rail in between). It screws up the routing code horribly.
     
  18. Offline

    Mycah

    FYI... I'm sure plenty of people have tested, but I thought I'd post:

    2012-01-12 17:50:19 [INFO] This server is running Craftbukkit version git-Bukkit-1.0.1-R1-37-g3733c54-b1714jnks (MC: 1.1) (Implementing API version 1.1-R1-SNAPSHOT)
    2012-01-12 15:57:12 [INFO] [TrainCarts] 3 Trains have been loaded in 2 worlds. (3 Minecarts)
    2012-01-12 15:57:12 [INFO] [TrainCarts] version 1.54 is enabled!


    As soon as someone joined that owns a rail:

    2012-01-12 17:48:08 [SEVERE] java.lang.NoSuchFieldError: bN
    2012-01-12 17:48:08 [SEVERE] at com.bergerkiller.bukkit.tc.NativeMinecartMember.move(NativeMinecartMember.java:681)
    2012-01-12 17:48:08 [SEVERE] at net.minecraft.server.EntityMinecart.y_(EntityMinecart.java:396)
    2012-01-12 17:48:08 [SEVERE] at net.minecraft.server.World.entityJoinedWorld(World.java:1257)
    2012-01-12 17:48:08 [SEVERE] at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:110)
    2012-01-12 17:48:08 [SEVERE] at net.minecraft.server.World.playerJoinedWorld(World.java:1239)
    2012-01-12 17:48:08 [SEVERE] at net.minecraft.server.World.tickEntities(World.java:1146)
    2012-01-12 17:48:08 [SEVERE] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:525)
    2012-01-12 17:48:08 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:432)
    2012-01-12 17:48:08 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    2012-01-12 17:48:08 [SEVERE] Unexpected exception
    java.lang.NoSuchFieldError: bN
    at com.bergerkiller.bukkit.tc.NativeMinecartMember.move(NativeMinecartMember.java:681)
    at net.minecraft.server.EntityMinecart.y_(EntityMinecart.java:396)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1257)
    at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:110)
    at net.minecraft.server.World.playerJoinedWorld(World.java:1239)
    at net.minecraft.server.World.tickEntities(World.java:1146)
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:525)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:432)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
     
  19. Offline

    xcanner

    @bergerkiller @Thulinma with beta 9 the "broken" destination system works again in all my metro systems.

    Edit: Move the beta9 to our real server. Server became very unstable with 30+ players

    Plugins: GroupManager, Vault, MagicCarpet, CombatTag, OnlineUsers, Permissions, WorldEdit, Multiverse-Core, LogBlockQuestioner, SilentDeath, WebAuction, Essentials, LagMeter, EssentialsSpawn, EssentialsChat, WorldBorder, WorldGuard, Multiverse-NetherPortals, Multiverse-Portals, AntiBuild, EssentialsGeoIP, LWC, Train Carts, NoLagg, LogBlock, ChestShop, dynmap

    No errors in log :/ Tried to restart server multiple times, trying to debug the problem. After returning til 1.54 (passenger fix). Server ran smooth again!
     
  20. Offline

    lionlorena

    Hi i want to know if there is any chance to update to #1718 mc 1.1
    thanks
     
  21. Offline

    bergerkiller

    @lionlorena Thulinma is working on it right now, I am updating several other plugins of mine to 1718. (MyWorlds now)
     
    Mycah likes this.
  22. Offline

    saki2fifty

    I'm using TrainCarts 1.6 Beta v9 along with Bukkit Build # 1718 and am having the issue where once placing the cart, its unclickable and just sits there. I used my sword to remove it, but nothing apparently happens. Thinking it might have something to do with the plugins, I removed all except for Traincarts and moved way away from the spawn area (in case that was the problem)... Same issues. If I click on the rail below the cart, it removes it and the cart jumps to the block above it. I dropped bukkit down to the recommended build, and the same things happens.

    I'm not sure how to tell how many carts there are in game, but did use MCEdit and there are approx. 40,000 carts. I removed all those entities, deleted the TrainCarts folder so that it would recreate itself, restarted... same thing happens.

    I would love to get this working for it is the best Transportation plugin available...
     
  23. Offline

    bergerkiller

    @saki2fifty I guess a 1.1-compatible build will be up tomorrow or this weekend. We are having some issues with the 1.1 version not toggling rails correctly. I'll also add some more safety checks against cart 'cloning', although I have no idea where it comes from...
     
  24. Offline

    andrewpo

    Is it possible for players to choose a destination by pressing a button? Possibly have a button on a block, with a destination sign on the other side?

    That would be a great feature for the designs I'm trying to make
     
  25. Offline

    bergerkiller

    @andrewpo yup, that's possible. Place a [train] property sign under the rails and lead a redstone current to the sign. Whenever it is powered, it will set the destination on the train.
    Code:
    [train]
    property
    destination
    Yourdestinationhere
    You can also use the train destination signs, but afraid it then auto-sets the destination whenever a train gets on it, which not listens for redstone current...
     
  26. Offline

    kinkinhood

    If you make use of redstonechips it's actually real easy to make a setup that does that with what berger mentioned. on the server I run I've actually made a rather complex train system using the destination signs. It works awesomely well.
     
  27. Offline

    TheShadow777

    hey i love your plugin and it have a lot of cool functions, but i have a little question: its possible to make a sign that sort out empty trains?
     
  28. Offline

    Raek

    Just thinking, reading through some of these posts and seeing alot of issues pop up (through no fault of your own, these things happen ya know) you might want to put up something on the OP about possible issues that they could get while using the plugin at this time.

    As we all know some of the community lack the skill of reading xD some people might just be looking at the CB version and downloading without reading the last few pages of this thread and getting an idea of what they are getting into :)

    Again My intentions are legit, i mean no offence, just had myself a nasty chunk corruption in my creative world ^^ not sure what caused it but thank god for McEdit! :D

    I would like to test this plugin myself, i really love this plugin, setup myself an awesome track ready for it around the few cities we have. I will be keeping my eye out for an update dude hope you get this epic plugin of yours sorted ^^
     
  29. Offline

    McGarnicle

    I have an idea for a simple feature that would help us out a TON. I'd like it if a Spawn sign added momentum AFTER the rail is powered by a button for launch, and in a specific direction.

    right now we're spawning trains with 3 carts as a server standard. the problem is that if we put 'spawn 1' in the tag, the cart immediately takes off and there's no chance to get in it. if you face the spawn sign the other direction and have the spawned train bump a dead end block it inevitably is too far away from the dead end for normal game mechanics to take over and send it off in the correct direction once a button is pressed to launch it.

    here's my proposed spawn sign command:

    [train]
    Spawn MN

    M would mean it recieves momentum AFTER the launch button is pressed, N is the direction it takes off in.

    Spawn 1 would be un affected.

    Spawn 1 MN would launch it north with the speed of 1 AFTER the button is pressed.

    If there's a mechanic in there already for this let me know!
     
  30. Offline

    Mycah

  31. Offline

    MechanID

    bergerkiller
    Please look at my issue with stations.
    CB 1597
    traincarts 1.6 beta v9 and no other plugins
     

Share This Page