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

    MechanID

  3. Offline

    Serejai

    All the speed problems I was having were gone, however now my trains seem to randomly change direction. I have no idea what's causing this as I haven't personally seen the moment of change, but there are no other players and no mobs so it's either happening randomly or stations are launching trains the wrong direction.

    Had a train going fine for 2-3 hours earlier, then all of a sudden I saw it going in reverse. Any ideas?
     
  4. Offline

    bergerkiller

    @Serejai No, not really...can't think of anything that can 180-switch the direction...maybe if it managed to hit a physics update if the locX and locZ are perfect full numbers (0, 1, 2, 3, 4, etc.) as I can't really test that, but it's unlikely.
     
  5. Offline

    MechanID

    @bergerkiller
    i have set keepchunksloaded in defaultflags.yml :
    Code:
    default:
      keepChunksLoaded: true
    station:
      pushAway:
        mobs: true
        players: true
    admin:
      keepChunksLoaded: true
      pushAway:
        mobs: false
        players: false
        misc: true
    
    errors:
    
    2011-12-17 23:56:34 [SEVERE] Could not pass event CHUNK_LOAD to Train Carts
    java.util.ConcurrentModificationException
            at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
            at java.util.AbstractList$Itr.remove(AbstractList.java:357)
            at com.bergerkiller.bukkit.tc.GroupManager.refresh(GroupManager.java:331)
            at com.bergerkiller.bukkit.tc.Listeners.TCWorldListener.onChunkLoad(TCWorldListener.java:38)
            at org.bukkit.plugin.java.JavaPluginLoader$52.execute(JavaPluginLoader.java:626)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
            at net.minecraft.server.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:92)
            at org.bukkit.craftbukkit.CraftWorld.getChunkAt(CraftWorld.java:101)
            at com.bergerkiller.bukkit.tc.GroupManager.refresh(GroupManager.java:319)
            at com.bergerkiller.bukkit.tc.GroupManager.refresh(GroupManager.java:291)
            at com.bergerkiller.bukkit.tc.TrainCarts.onEnable(TrainCarts.java:149)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:968)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
            at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
            at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:348)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:335)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    2011-12-17 23:56:34 [SEVERE] Error occurred while enabling Train Carts v1.54 (Is it up to date?): null
    java.util.ConcurrentModificationException
            at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
            at java.util.AbstractList$Itr.remove(AbstractList.java:357)
            at com.bergerkiller.bukkit.tc.GroupManager.refresh(GroupManager.java:331)
            at com.bergerkiller.bukkit.tc.GroupManager.refresh(GroupManager.java:291)
            at com.bergerkiller.bukkit.tc.TrainCarts.onEnable(TrainCarts.java:149)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:968)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
            at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
            at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:348)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:335)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    00:01:50 [SEVERE] [TrainCarts] Failed to perform physics on train 'train16':
    00:01:50 [SEVERE] java.lang.NullPointerException
    00:01:50 [SEVERE]       at com.bergerkiller.bukkit.tc.NativeMinecartMember.postUpdate(NativeMinecartMember.java:446)
    00:01:50 [SEVERE]       at com.bergerkiller.bukkit.tc.MinecartMember.postUpdate(MinecartMember.java:72)
    00:01:50 [SEVERE]       at com.bergerkiller.bukkit.tc.MinecartGroup.doPhysics(MinecartGroup.java:751)
    00:01:50 [SEVERE]       at com.bergerkiller.bukkit.tc.MinecartGroup.doPhysics(MinecartGroup.java:676)
    00:01:50 [SEVERE]       at com.bergerkiller.bukkit.tc.MinecartMember.w_(MinecartMember.java:67)
    00:01:50 [SEVERE]       at net.minecraft.server.World.entityJoinedWorld(World.java:1253)
    00:01:50 [SEVERE]       at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:107)
    00:01:50 [SEVERE]       at net.minecraft.server.World.playerJoinedWorld(World.java:1235)
    00:01:50 [SEVERE]       at net.minecraft.server.World.tickEntities(World.java:1142)
    00:01:50 [SEVERE]       at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:518)
    00:01:50 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425)
    00:01:50 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    
     
  6. Offline

    bergerkiller

    @MechanID Ow lol...so when it tries to load all trains that have that setting enabled, it loads those chunks, but this results in those chunks auto-loading, which causes concurrency issues. At least I know - then I have to make sure I simply load the chunks and only load the train already had chunks near, insta-restore it.
     
  7. Offline

    L.Antigreen

    @bergerkiller, sorry, it was my fault
     
  8. Offline

    dog.big

    I am sorry, but after using latest version, when spawn 5+ trains with 5+ minecarts, the server crash after few minutes with RAM overload (have got 5Gb)
     
  9. Offline

    Lethal_Dark

    Single Carts on powered rails have now too less power they just go too slow. Tried to increase it in the config but did not work...
     
  10. Offline

    bergerkiller

    @Lethal_Dark is that with or without passenger in it? (I added a separate version on GitHub which fixes this slow-down with passengers)

    @dog.big Could you post the exact error you are getting? It's seems rather unreal that train objects (which hardly use up 2 kb / cart) can hit the RAM limit.
     
  11. Offline

    Lethal_Dark

    Single Cart with one passenger
     
  12. Offline

    bergerkiller

    @Lethal_Dark does the separate download on GitHub fix this? (passengerfix)
     
  13. For me, everything seems to be back to normal, at least everything works as it was with 1.47, using the passengerfix version.
    EDIT
    Still, train portals still don't work:
    Minecart is duplicated at destination, and is launched wrong heading...
     
  14. Offline

    Viperdream

    So, if I understand it correctly. The trains keep moving, even when no one is online on the server? Or no one is at a certain station?
    Like crops won't grow unless someone's within a certain radius
     
  15. Offline

    Lethal_Dark

    I will test it...
    Another point I realized is that the trains disappear after reboot...
     
  16. Offline

    xcanner

    Seems like trains collide, even with train collisions = false, using 1.54 (passengerfix).
     
  17. Offline

    bergerkiller

    @JM120897 Strange error, the data generated by a function called right before postUpdate (preUpdate) got erased...I added a null check there although this shouldn't even be possible to happen...
     
  18. So what can I do?, here the list the plugins I have:
    http://pastebin.com/7jKM7UQL
     
  19. Offline

    bergerkiller

    For now I'll put TrainCarts 'on hold' (I am already fixing tons of bugs and adding lots of other needed fixes/features), I know of the following issues and some have already been fixed:
    - The station sign: pulling trains back after launching
    - Several 'infinite link' issues (lots of smoke puffs are the synthoms)
    - A few concurrent modification issues

    Features to be added:
    - Owners and tags per cart
    - /cart command to edit a single cart (set owners, tags)
    - Track switching: Allow trains to be de-linked and per-cart destinations and tag track switching
    - Possibly (if it doesn't take too long): sensors to give a redstone pulse based on certain conditions
     
  20. Offline

    Junrall

    @bergerkiller
    First off... very cool! cart based mods always interest me!

    So, I'm a bit confused. You say that "This plugin is made compatible with Minecart Mania."
    Isn't Minecart Mania not working properly with the new builds of Bukkit or am I mistaken?
     
  21. Offline

    lipe123

    1. Please set up a proper ticketing page on the bukkitdev site.
    2. Add commands to reload the config files instead of a full server restart every time just to test one setting
    3. Explain what the effect of the variables are, for example: poweredCartBoost 0.1 <- how much is 0.1? how much is a normal vanilla powered cart by this system? does that 0.1 get added to the vanilla or override it?

    4. I started to play with this a little today and I'm not having to much luck. Powered carts doesnt seem to have enough power to even pull a train of only 2 cars up a single block incline. I set the boot to 2.8 as a test and it made absolutely no diff. This looks like a really awesome plugin but I'm having a really hard time getting it to work.
    My idea is to use the powered carts instead of the booster tracks to give it that "real train" feeling but sofar no luck.
     
  22. And the train teleportation on long distance isn't working properly.
     
  23. Offline

    bergerkiller

    @Junrall yeah Minecart Mania is not working and people asked me (or I proposed :) ) to take over most of the features from Minecart Mania. (thus the cart properties and dynamic cart de-linking is important)

    @lipe123
    1. If you know a tutorial site which explains how this is done, I will. I am more focused on programming the plugin than setting up all the pages. (and a lot has to be done)

    2. I will add a reload command then. (two, one for the config.yml and one for the train/cart properties)

    3. See the WIKI page, it contains lots of information and configuration help. PoweredCartBoost Adds forward speed to the boosting power, but the real value type is unknown to me too. I just added it to a variable in native coding, which is pretty hard to comprehend. (but hey, it works :) )

    4. I'll take another look at the powered carts then. Also make sure you have the 'passenger fix', it's possible that the other version slows down the carts too much.
     
  24. Offline

    lipe123

    Gotcha, It's just so much cleaner to get help when its in a ticket format than and bunch of forum posts that bury things.

    Oh and I think my powered cart problem was mostly my own stupidity, I forgot that powered carts only push, so putting them on both ends of the train will equal out the force or something like that. Maybe I'll just stick to powered rails but I hate the speed limitation they impose. I was able to get the train going pretty damn fast with the powered carts once.

    I did read the wiki page many times and it helped me figure out most things. Just coming back to the PoweredCartBoost, have you tested any values other than 0.1? like what would be a acceptable range 0.1 - 1.0?
     
  25. Offline

    bergerkiller

    @lipe123 You can also set train speed limits. The maximum is around 16 blocks/tick (but who needs that). Believe me, you get some epic traveling if you use such limits :)

    Code:
                    double d17 = (double) MathHelper.a(this.b * this.b + this.c * this.c);
                    if (d17 > 0.01D) {
                        this.b /= d17;
                        this.c /= d17;
                        double d19 = 0.04D;
    
                        this.motX *= 0.800000011920929D + TrainCarts.poweredCartBoost;
                        this.motY *= 0.0D;
                        this.motZ *= 0.800000011920929D + TrainCarts.poweredCartBoost;
                        this.motX += this.b * d19;
                        this.motZ += this.c * d19;
    As you can see it kinda adds a factor to the motX/Z values. I suppose values between 0 and 0.8 are fine, anything higher will probably cause some weird things to happen.
     
  26. Offline

    xcanner

    @bergenkiller have been using speed 1.0 on mine carts (craftbukkit 1.8.1) without any problems (we have a 20.000+ minetrack metro).

    After update it seems like the chunks arent loading "fast" enough, we had no issues with this at all on 1.8.1. I assume the "problem" is new code craftbukkit, and not TrainCarts, but have you any idea on how to resolve this issue?

    Using the 1.54 passengerfix.
     
  27. Offline

    Raek

    First off with most posts here I will say thank you for this amazing plugin/project. It is something our users love and is a great way to setup automated city transport.

    This being said I have to add to the list of things not working, sorry! It seems that when the train goes into an unloaded chunk it stops? even with the "keepchunksloaded" set to true. The train being pulled by a powered minecart would lose its coal power when the train passes over a powered rail? no passengers in it but it just seems to stop.

    I'm using the passenger fix version of your plugin along with the latest RB of bukkit.

    Hope this helps in your project, keep up the great work!
     
  28. Offline

    bergerkiller

    Ok so chunk loading is failing too, will re-check all of that once cart properties are working.
     
  29. Offline

    Tobsy4inc

    Where can i download TrainCarts 0.6v it is easier to use and before i had such fun with it
     
  30. Offline

    bergerkiller

    @Tobsy4inc how can it be easier? It has 0.1% of the features it has now xd

    Also, I am afraid that version is outdated for 1.00 servers. A lot of methods got changed over time and it contained several bugs. May I ask, what makes the 1.54 version so hard to use? Then I could simplify some things if needed.
     

Share This Page