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

    Newpoman

    damn... i was hoping you would be able to make a sign that goes on the track that wouldn't allow placement.... because i don't want to get some crappy protection plugin. But ok. And I love your plugin. It's amazing. Great job. Keep up the great work.
     
  3. Offline

    Cuitpoisson

    just set a sign under a track section:
    sign:
    [train]; station; MY_STATION_NAME

    Then any track section that has a [train];switcher sign under it will try to route the train in the correct direction to the sign.
     
  4. Offline

    Newpoman

    Also i was seeing if you can make a sign property for keepchunksloaded. instead of having to enable all moving trains in config.

    Also i have made a few roller coasters, and a subway at my spawn. I bet you would enjoy what i have done with your plugin so far. If you would like to see it my address is mc.the-10th-planet.com. And thanks again for the sick plugin.

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

    Cuitpoisson

    @bergerkiller

    Okay, so a while ago I said that destination signs were sometimes not working. On my server, I did some debugging and found that when onLeave (for MinecartGroup) is called in the Detector subclass of SignActionDetector class, the sign1down variable will sometimes be set as true, making the next pass of a minecart through the detectors unnoticed. I'm not sure why this is happening, I will update you if I find out more why, its hard debugging code when you don't exactly know what what does.

    [edit]
    I think I figured it out. I have two detector signs (as should be). They both detect empty carts. When an empty cart enters the detector region but a full cart leaves the region, it never toggles the sign1down to false. It should toggle it to false no matter what. I'm not sure if that is was intended or is a bug. But for now, it seems like a personal fix should be to set the exit detector to detect everything. Will let you know if that works.

    [edit2]
    Setting the second sign to [train];detector still has the same problems, and same with setting it to [train];detector;minecart :(

    You can set the default train properties in the DefaultTrainProperties.yml file to keepChunksLoaded. Its the easiest way if you want them all to be loaded. set the line to this:
    keepChunksLoaded: true

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

    andrewpo

    Code:
    2012-04-05 23:04:42 [SEVERE] Could not pass event VehicleEntityCollisionEvent to Train Carts
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:303)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459)
    at net.minecraft.server.EntityMinecart.collide(EntityMinecart.java:759)
    at com.bergerkiller.bukkit.tc.NativeMinecartMember.postUpdate(NativeMinecartMember.java:600)
    at com.bergerkiller.bukkit.tc.MinecartMember.postUpdate(MinecartMember.java:359)
    at com.bergerkiller.bukkit.tc.MinecartGroup.doPhysics(MinecartGroup.java:1130)
    at com.bergerkiller.bukkit.tc.MinecartGroup.doPhysics(MinecartGroup.java:1016)
    at com.bergerkiller.bukkit.tc.MinecartMember.F_(MinecartMember.java:345)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1265)
    at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:106)
    at net.minecraft.server.World.playerJoinedWorld(World.java:1247)
    at net.minecraft.server.World.tickEntities(World.java:1154)
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:545)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    Caused by: java.lang.NullPointerException
    Not sure what caused this, but it seemed to crash the server.

    2012-04-05 23:43:50 [INFO] TrainCarts 1.6 - See WIKI page for more information
    2012-04-05 23:43:51 [INFO] This server is running CraftBukkit version git-Bukkit-1.2.4-R1.0-b2126jnks (MC: 1.2.4) (Implementing API version 1.2.4-R1.0)

     
  7. Offline

    bergerkiller

    I'll be looking at the detector region physics again then, I did do thorough testing with a single train, but never really tested what happens when train A enters and train B leaves. Could be a bug in the update part of it all...

    andrewpo Could you post the caused by error bit too? This only shows what triggered the collide event (which is allright), not the bit that caused the exception. (I need the bit after caused by: ... )

    TheSuperNinjaBanana If you want to make a station with a name, add a destination sign. But, since this seems like a very common situation, I'll make a tutorial video about it for the WIKI. (I still need to make a PathFinding tutorial page about it). Things to look at is the destination sign and switcher signs. Destination signs set the destination on a train and mark a destination for the train to get to. They are used to guide the train along.
     
  8. Offline

    Cuitpoisson

    Sounds good. Easiest way to test it is create a region of [train];detector;empty signs then send an empty minecart through and get into the minecart in the region. The detector will notice/update correctly and then let the train continue through the end of the region. The next time you send an empty train through, it won't recognize the train.
     
  9. Offline

    bergerkiller

    Ugh as I noticed path finding has issues too...not the actual switching, but the detection of routes it can take. It can't find out some paths for some reason, and it is really annoying.
     
  10. Offline

    andrewpo

    Sorry, the server log stopped recording at that exact point so I can't get the requested information. :(
     
  11. Offline

    bergerkiller

    andrewpo :(
    Ow well, I did add an extra null-check to see if a Minecart group (train) was null, hopefully that fixes it. Though without an error, I can't know for sure, it could be something completely different. (and a group can only be null if the minecart is dead...)
     
  12. Offline

    andrewpo

    I did notice an awful lot of console warnings saying something about trains expected but missing, removed externally?

    Edit - found it:
    Code:
    2012-04-05 04:19:43 [WARNING] [Train Carts] 2 carts of group 'train69' are missing! (externally edited?)
    2012-04-05 04:19:43 [WARNING] [Train Carts] 2 carts of group 'train69' are missing! (externally edited?)
    2012-04-05 04:19:43 [WARNING] [Train Carts] 2 carts of group 'train69' are missing! (externally edited?)
    2012-04-05 04:19:43 [WARNING] [Train Carts] 2 carts of group 'train69' are missing! (externally edited?)
    2012-04-05 04:19:43 [WARNING] [Train Carts] 2 carts of group 'train69' are missing! (externally edited?)
    2012-04-05 04:19:54 [WARNING] [Train Carts] 2 carts of group 'train69' are missing! (externally edited?)
    2012-04-05 04:19:54 [WARNING] [Train Carts] 2 carts of group 'train69' are missing! (externally edited?)
    2012-04-05 04:19:54 [WARNING] [Train Carts] 2 carts of group 'train69' are missing! (externally edited?)
    2012-04-05 04:19:54 [WARNING] [Train Carts] 2 carts of group 'train69' are missing! (externally edited?)
    2012-04-05 04:19:54 [WARNING] [Train Carts] 2 carts of group 'train69' are missing! (externally edited?)
    I've now updated to v1.62 so hopefully most of the issues will be resolved.

    Also I may have caused this error, but what I did was:
    Replace the 1.60 jar with the 1.62 jar, shut down the server.

    and this error appeared during server stop:
    Code:
    2012-04-06 11:57:23 [SEVERE] Error occurred while disabling Train Carts v1.6 (Is it up to date?)
    java.lang.NoClassDefFoundError: com/bergerkiller/bukkit/tc/pathfinding/PathNode$2
    at com.bergerkiller.bukkit.tc.pathfinding.PathNode.deinit(PathNode.java:286)
    at com.bergerkiller.bukkit.tc.TrainCarts.disable(TrainCarts.java:361)
    at com.bergerkiller.bukkit.common.PluginBase.onDisable(PluginBase.java:196)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
    at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:362)
    at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:399)
    at com.bergerkiller.bukkit.common.PluginBase.onDisable(PluginBase.java:192)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
    at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:362)
    at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:399)
    at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:392)
    at org.bukkit.craftbukkit.CraftServer.disablePlugins(CraftServer.java:245)
    at net.minecraft.server.MinecraftServer.stop(MinecraftServer.java:402)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    Caused by: java.lang.ClassNotFoundException: com.bergerkiller.bukkit.tc.pathfinding.PathNode$2
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 15 more
    But I think you mentioned something in one of your posts about that error appearing if you replace the jar.
     
  13. Offline

    dockter

    Is there anyways that I can set a MAXSPEED for everyone traincart and not allow them to do a /train maxspeed above the configured value?

    I need to be able to set a default set of values which users cant go beyond.
     
  14. Offline

    bergerkiller

    dockter Hasn't been added yet, but it's a nice addition. I'll add a configuration node which sets this. (and a permission node that overrides this setting)
     
  15. Offline

    Newpoman

    the last update made it so that not a single one of my stations work. I had to downgrade back two verions. Do you know about this issue?
     
  16. Offline

    bergerkiller

    Newpoman which versionare you using now then? AFAIK I didn't change anything related to stations...
     
  17. Offline

    Newpoman

    Right now I'm using R: v1.60 for CB 1.2.4-R1.0 Mar 29, 2012... When i tried R: v1.62 for CB 1.2.4-R1.0 Apr 03, 2012. None of my stations worked.
     
  18. Offline

    bergerkiller

    Newpoman I looked at the changelogs, and the only thing I found was that I changed the way signs check if they are powered. You say 'all' stations were failing, are you sure it's not just the stations that receive power from the block they are attached to?
     
  19. Offline

    Newpoman

    Oh yes well. I have the station set up so that i have to power the sign to tell the cart where to go. I have to do that differently now?
    http://www.planetminecraft.com/project/roller-coaster-752199/
    also that is my roller coaster. Well one of them. Quick 2 min vid if your bored.

    this is how i have them set up <Edit by Moderator: Redacted mediafire url>
    <Edit by Moderator: Redacted mediafire url>

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

    bergerkiller

    Newpoman

    Hmmm I can vaguely remember something very similar to this. It happened while I was working on the Blocks add-on, and I noticed that the redstone change event didn't fire for non-redstone blocks. I had to switch to physics back then...
    I'll do some testing for 1.63 to see if the redstone related systems are working fine.

    EDIT

    Got it. It has to do with my 'is block the sign is attached to powered?' check. For some reason it thinks that the block is powered if any adjecent blocks are powered....in your case, it registers it is both powered by the torch and by the block the torch is attached to. Obviously fails then. Expect it fixed in the next version, and thanks for reporting :)
     
  21. Offline

    Newpoman

    Awesome. Your the best. And thanks for the fast response.
     
  22. Offline

    MacGyver420

    bergerkiller

    Is there a way to suppress the "carts of group are missing" warning message, or any clue how i can get the server to stop randomly eating carts in a group? A command to remove a specific train by name would be handy, instead of having to destroy all trains on the map and start over or hunt down the random offending train.

    Code:
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    2012-04-07 16:52:28 [WARNING] [Train Carts] 7 carts of group 'train20' are missing! (externally edited?)
    I wouldnt mind one message telling me whats up, but the amount of messages im getting about the same train per second seems excessive.
     
  23. Offline

    bergerkiller

    MacGyver420 ugh just too late, I already uploaded 1.63 :/
    Yeah, I know the issue, but the problem is that I can't seem to reproduce it. I tried several things, including 10 trains traveling into the unknown after I revisit them...it is simply put, an unexplainable issue. :(

    EDIT

    Forgot about the 1.63 changelog. Most of it consist of bug fixes reported here and there, as well as handling some of the reported tickets.

    New features as requested:
    • The ability to disable TrainCarts on certain worlds
    • The ability to set a 'maximum' value for maxspeed you can set on trains
    Bugfixes:
    • The failing north/east/south/west thing of the blocker is fixed
    • Redstone power to the attached block is fixed
    • Added failsafes at important locations to prevent the server crashing, and to disable TrainCarts automatically when this happens.
    • Spawner sign now correctly reads the force again
    • An NPE occurring at rare occasions when two minecarts collide
     
  24. Offline

    MacGyver420

    bergerkiller

    No rush berger. Let me know any ideas youve got about how to reproduce this and ill see what i can do. Some things ive noticed is its always train000 or some number and not a train ive named and set to keepchunksloaded. also the more unloaded chunks there are in the world (less players) the more errors it'll generate. But without being able to find train000 and actually see whats happened to it im not sure whats really going on. Maybe an optional argument for train name in the delete and info commands could help? or a train tp for debugging :p
     
  25. Offline

    bergerkiller

    MacGyver420 well the only thing I DO know is that it fails to properly deal with the issue. It should never spam the same '7 carts of train x not found' error more than once, as that is impossible. After that message all 7 missing carts are disposed of and should not show up missing in another attempt to restore the train. So the only thing I can think of, is that it is somehow failing to remove these carts, or it collides with new carts at the location causing that same error again very soon...

    Note: 'missing' is defined as 'unable to find the minecart by it's stored unique ID'. So, if you use another plugin that hot-swaps entities around, it could interfere in a way that it doesn't keep the UID after replacement. (TC does take care of this)
     
  26. Offline

    bpskotch

    This may seem like a request that defeats the purpose of the mod, but it would be EXTREMELY helpful in a current situation.

    I'd like to see a version of the mod where the connection of carts is optional. I'd like to use a couple of the features, such as pathfinding and speed setting, just without the connection of the carts themselves. I'm currently using a non-mod based cart feeding/recycling system I'd like to keep intact, just for the sake of redstone awesomeness. ;)
     
  27. Offline

    derfuzzi

    The Cart disappear when I want to build a train ;(
     
  28. Offline

    bergerkiller

    bpskotch you can do that, actually, just set 'linking' to false in DefaultTrainProperties. Right then single carts will never link together.

    derfuzzi What TC version and what CraftBukkit version do you use?
     
  29. Offline

    derfuzzi

    bergerkiller

    TC1.63
    Craftbukkit 2149

    all the newest but I can't "build" trains! the carts disappear any time!
     
  30. so.. i had a test drive of 1.63 and the train still does not seem to use the coal it did "chest out" from a chest. it's in the storage cart but does not get fed into the "engine"
     
  31. Offline

    bergerkiller

    derfuzzi just in case: enable 'keep spawn in memory' for the worlds you are in. Having it disabled seems to cause global issues, including that and missing carts.

    g_BonE I suppose you did toggle the feature on in the configuration first? After that it should properly put coal into the cart...though the direction to launch in is a bit bugged... :/
     

Share This Page