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

    frdmn

    hey

    i got a problem with train carts that causes "out of memory"-errors. i use bukkit 1337 and train carts 1.45.

    here are some log file snippets:

    2011-10-29 00:33:28 [SEVERE] Could not pass event VEHICLE_COLLISION_ENTITY to Train Carts
    java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2746)
    at java.util.ArrayList.ensureCapacity(ArrayList.java:187)
    at java.util.ArrayList.addAll(ArrayList.java:499)
    at com.bergerkiller.bukkit.tc.TrainProperties.load(TrainProperties.java:242)
    at com.bergerkiller.bukkit.tc.MinecartGroup.remove(MinecartGroup.java:563)
    at com.bergerkiller.bukkit.tc.MinecartGroup.link(MinecartGroup.java:198)
    at com.bergerkiller.bukkit.tc.Listeners.TCVehicleListener.onVehicleEntityCollision(TCVehicleListener.java:139)
    at org.bukkit.plugin.java.JavaPluginLoader$86.execute(JavaPluginLoader.java:862)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
    at net.minecraft.server.EntityMinecart.collide(EntityMinecart.java:715)
    at com.bergerkiller.bukkit.tc.NativeMinecartMember.postUpdate(NativeMinecartMember.java:619)
    at com.bergerkiller.bukkit.tc.MinecartMember.s_(MinecartMember.java:71)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1193)
    at net.minecraft.server.WorldServer.vehicleEnteredWorld(WorldServer.java:109)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:247)
    at net.minecraft.server.Packet10Flying.a(SourceFile:126)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-29 00:33:41 [SEVERE] java.lang.OutOfMemoryError: Java heap space
    2011-10-29 00:33:41 [SEVERE] at java.util.Arrays.copyOf(Arrays.java:2746)
    2011-10-29 00:33:41 [SEVERE] at java.util.ArrayList.ensureCapacity(ArrayList.java:187)
    2011-10-29 00:33:41 [SEVERE] at java.util.ArrayList.addAll(ArrayList.java:499)
    2011-10-29 00:33:41 [SEVERE] at com.bergerkiller.bukkit.tc.TrainProperties.load(TrainProperties.java:242)
    2011-10-29 00:33:41 [SEVERE] at com.bergerkiller.bukkit.tc.MinecartGroup.removeCart(MinecartGroup.java:518)
    2011-10-29 00:33:41 [SEVERE] at com.bergerkiller.bukkit.tc.MinecartGroup.update(MinecartGroup.java:670)
    2011-10-29 00:33:41 [SEVERE] at com.bergerkiller.bukkit.tc.MinecartMember.s_(MinecartMember.java:68)
    2011-10-29 00:33:41 [SEVERE] at net.minecraft.server.World.entityJoinedWorld(World.java:1193)
    2011-10-29 00:33:41 [SEVERE] at net.minecraft.server.WorldServer.vehicleEnteredWorld(WorldServer.java:109)
    2011-10-29 00:33:41 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:247)
    2011-10-29 00:33:41 [SEVERE] at net.minecraft.server.Packet10Flying.a(SourceFile:126)
    2011-10-29 00:33:41 [SEVERE] at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    2011-10-29 00:33:41 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    2011-10-29 00:33:41 [SEVERE] at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    2011-10-29 00:33:41 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
    2011-10-29 00:33:41 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    2011-10-29 00:33:41 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-29 00:33:41 [SEVERE] Unexpected exception
    java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2746)
    at java.util.ArrayList.ensureCapacity(ArrayList.java:187)
    at java.util.ArrayList.addAll(ArrayList.java:499)
    at com.bergerkiller.bukkit.tc.TrainProperties.load(TrainProperties.java:242)
    at com.bergerkiller.bukkit.tc.MinecartGroup.removeCart(MinecartGroup.java:518)
    at com.bergerkiller.bukkit.tc.MinecartGroup.update(MinecartGroup.java:670)
    at com.bergerkiller.bukkit.tc.MinecartMember.s_(MinecartMember.java:68)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1193)
    at net.minecraft.server.WorldServer.vehicleEnteredWorld(WorldServer.java:109)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:247)
    at net.minecraft.server.Packet10Flying.a(SourceFile:126)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)

    can you help?

    thank you.
     
  3. Offline

    bergerkiller

    @frdmn Are you running the server with sufficient RAM memory and set-RAM memory? When launching the server, you need to use these arguments minimally:
    Code:
    java -Xmx1024M -Xms1024M -jar "craftbukkit-0.0.1-SNAPSHOT.jar" nogui
    Or something like that. The error you got has nothing to less to do with TrainCarts, it has to do with the server not having enough memory at hand to run the server. (Having at least 2 gb of RAM allocated for the server is recommended, since the server is full of memory leaks. Also regularly restart the server.
     
  4. Offline

    BlancoLanda

    @bergerkiller I updated to v1.45 and the FalseBook booster blocks don't boost (in fact they boost, but a little bit, not fast). The brake blocks work... I tried removing TrainCarts and it's the reason... It seems like TrainCarts is limiting the speed, I tried to set a higher value at maxCartSpeed (from 0.35 to 0,9) but it's the same . Any help?
     
  5. Offline

    bergerkiller

    @BlancoLanda max speed value setting is now in the defaultflags.yml, or, in the train properties. Does it work if you change that to a higher value?
     
  6. First of all: Thank you very much for this great plugin. As a java developper myself, I know it's always nice to receive congratulations first.
    I'd have a question for you: It seems that my spawned carts (using a [train]spawn sign) are not reacting to any booster rails (the golden ones), they don't get any blast. But minecarts I place myself on the tracks do react to the boosters. Is that a config I did not see? The max speed value do not affect the experience, i first was on 0.6 and thought it might come from that, reversed back to 0.4 but it's still the same
    For information, I'm running everything on latest version, and my plugin list is not impressive, but myworlds, worldguard, train carts and cart jump
    Edit, did not see the same question 2 posts above mine... Sorry, it's because I first posted on the wrong topic as I was installing myworlds same time
     
  7. Offline

    Anthony13

    first off, every timei bring the server down n bring it back up doesnt keep the carts i made before shutting it down...
    -
    2nd, the works up to build 1368, and up to minecraft bukket server 9 beta 5
    ( http://ci.bukkit.org/job/dev-CraftBukkit-1.9/4/ )
     
  8. Offline

    bergerkiller

    @Anthony13 Me and (mostly) @Thulinma have already been working on a 1.9 version of TrainCarts. I will probably upload one version for 1.8 too. So, don't use this version for 1.9, it works on 1337 but will fail in the most horrid ways on 1.9.

    Also, see the banner all above the main post. Did you use stop?

    I'll take a thorough look at the spawner signs too.
     
  9. Got a second problem, with the portal part. I installed my world plugin and teleports are working well BUT:

    They are working well when on small distance. I tried a train portal over a greater distance. I get ported, get a double message: You teleported to T2 You teleported to T1), and spawn in the dark, on T2, falling somewhere without end (F3-> Y value drops fast). No suffocation or anything. Need to disconnect reconnect and I'm on the surface where I have teleported, T2 even though the message says I teleported back to T1.

    But using a teleport by walking through a water door I made seems to be ok, the problem's only with minecarts.

    And line 4 on the shield, to display port name doesn't work, isn't it suppose to be used in the "You teleported to XXXXX" message?

    Console shows no error
     
  10. Offline

    bergerkiller

    @Psychokiller1888 Funny that you mention it, because I had the exact same issue when I first worked on it. At that time it had to do with the player not being registered on the server anymore (player object is removed), so I guess it is time to take another look.
     
  11. Oki, at least nice i'm not the only one actually. It's always a pain in dev when you can't reproduce what someone encounters :) BTW, I lied, I said everything uptodate, but on the supported versions of course, I'm running 1.45 and not your unsupported releases
     
  12. Offline

    bergerkiller

    Ow they are not yet released, I first take time to fix bugs like you mention.
     
  13. So for help, maybe you can reproduce the bug?

    Seed: 8492281326913119375

    Portals signs, placed under rails:

    t1:
    x 122
    y 94
    z 169

    t2:
    x 241
    y 68
    z -1771

    When used as normal portals, with a water gate, there's no problem crossing them. But removing the water gates, placing rails over them, and there you fall through the world.

    Thanks for your work! Sorry, don't know minecraft source code, could have checked and helped.
     
  14. Offline

    bergerkiller

    Yup, confirmed, although it is a bit strange...
     
  15. Actually, I have been having the same issue with rails-teleport. I thought it was something I was doing wrong, lol.
    In addition, I sometimes get "stuck" in a portal in a minecart, unable to destroy my cart because I end up clicking the portal blocks instead (switching to water portals at least "fixed" that problem...)

    The weird thing is, I'm pretty sure these chunks are all loaded on the server (at least in my tests), so I'm not quite sure what's going on here.

    Oh, regarding 1.9 btw - using a 1.8 build of traincarts is not too horrid... it simply breaks all minecarts everywhere :)
    @bergerkiller: The 1.9 build I've been testing works very well, btw. But the server keeps printing errors ("Fetching addPacket for removed entity") when the minecart entities get replaced... Everything still works, even though it shows those errors. Looks like replacing an entity is not handled exactly the same anymore in 1.9 (more error checking is done, perhaps?)!
     
  16. Offline

    bergerkiller

    @Thulinma ah your online, get on Skype! :)

    And I currently got it (re)solved. I added a second delay between 'teleporting near the minecart' and 'entering it'.
    The error is prob. because of some sort of protection they added, the packet removal is important tho.

    Chunks were not loaded because the player was in a parallel universe between the two minecarts: to the server the player was at the old minecart, the player is at the new minecart. Result: Chunks near are not triggered and unload.
     
  17. Offline

    eragonn1490

    could u add in a feature so that you can have boosters along the track an example i was thinking of for a sign
    top line [train]
    second line push"speed you want"?
    third line "every 4 cars"
    i have long systems of subways on my server and your plugin helps alot with stopping of cars but your plugin dosent work becase our powered rails have 0 affect on the minecarts :/ so could u fix that or add in a push sign? ill be watching the plugin message me or reply here
     
  18. Offline

    bergerkiller

    @ergaonn1490 you can use the station signs for that: 0 delay and fourth line continue, and power both sides. It will then act as a simple directional launcher.

    Also, what plugins do you use? Guess it's time to add compatibility to some of them...
     
  19. Offline

    eragonn1490

    sorry about that went afk but i use alot of plugins...visit my server @77.111.203.65:25565
    and type /plugins
     
  20. Offline

    robxu9

    Hm, I have a funny problem with booster rails sometimes.
    When the traincarts go up/down, it's like the back minecarts are pulling it down, so that sometimes it fails to go up and just comes back down.

    Also, I can't seem to get default flags set D: It's like the trains aren't getting any default flags set when they are made :(
    Namely pushing and mobs. >_>

    I have v1.45, RB 1337
     
  21. Offline

    Chett

    World Portals working perfectly. Using Portals with Carts over larger distances are not rly possible, even if u make smaller jumps Portals in a row, they fail big big big (they just stay after the second jump, even if u are close enough to trigger the event for Chunkloading, tricky thing, isnt it ?).

    I i am hopping to get a "specific Chunk Laod at Serverstart" tool (got one who keeps em loaded, but not from Start up), so they continue driving after a bigger Whoop. Right now they disappear, even if u fly behind them, or they spawn if u are in range and continue. If u are outta chunkload range, u can see em standing at the portalpoint. Chunk Load is not working after a larger portal jump. Tested 3 Builds - almost 3 hours, but maybe i am n Idiot :p

    Btw i tested almost 50 hours straight with TC right now - last couple days. Thumbs up! And thank you for sharing it with us. And i like all 3 of ur Plugs and using em all, thx :)
     
  22. Offline

    bergerkiller

    @robxu9 @Chett @Prettymucheveryone Already got a new version in the making, and lets say it is quite a changebomb. A few changes already implemented:
    Sooow ignore the teleportation issues, it has been fixed already, afraid you got to wait a little longer for the next update (still improving some things here and there). You can check the GitHub source page if you wish to keep track of it. :)
     
    robxu9 likes this.
  23. Offline

    robxu9

    Awesome!!!!! :D Sign me up for dev builds if you get around to making any ;)
     
  24. Great, thanks for the fix!
     
  25. Offline

    Sneaky420

    Got an odd error, but sadly cant read what it means, so I bring it here to share with everyone :)


    06:15:25 [SEVERE] Could not pass event VEHICLE_MOVE to Train Carts
    java.lang.NullPointerException
    at com.bergerkiller.bukkit.tc.MinecartGroup.destroy(MinecartGroup.java:505)
    at com.bergerkiller.bukkit.tc.Listeners.CustomEvents.onSign(CustomEvents.java:433)
    at com.bergerkiller.bukkit.tc.Listeners.CustomEvents.onSign(CustomEvents.java:318)
    at com.bergerkiller.bukkit.tc.Listeners.TCVehicleListener.onVehicleMove(TCVehicleListener.java:119)
    at org.bukkit.plugin.java.JavaPluginLoader$89.execute(JavaPluginLoader.java:883)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
    at com.bergerkiller.bukkit.tc.NativeMinecartMember.postUpdate(NativeMinecartMember.java:600)
    at com.bergerkiller.bukkit.tc.MinecartMember.s_(MinecartMember.java:69)
    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)


    What does this mean please.

    Thank you
     
  26. Offline

    bergerkiller

    @Sneaky420 I'll look at the old source and see where the NPE occurs, if it hasn't been fixed yet, I'll add some code to prevent it.
     
  27. If in my defaults I set defaultOwner = Psychokiller1888, and I place by myself a minecart I have in my inventory, on the rails, a /train i returns as owner: Psychokiller1888 and Psychokiller1888 :)
    Boosting rails are effectively this way, placed be a player it seems that they use the golden rails, but if spawned, they don't. But sometimes, even carts placed by myself don't get boosted. Still searching coincidences and will report if I see something.
     
  28. Offline

    bergerkiller

    @Sneaky420 Afraid the version you have is unsupported...so can't really implement changes for it...newer version can't/doesn't/shouldn't have this bug though. Update TrainCarts and CraftBukkit with it is all I can recommend...

    @Psychokiller1888 Yeah then you need to disable 'setOwnerOnPlacement', since it adds you as owner if enabled. What do you mean with 'spawned', the spawner sign?
     
  29. Yeah, meaning the spawner signs
     
  30. Offline

    bergerkiller

    @Psychokiller1888 Ok I removed the 'ignoreForces' group variable, instead it will check if the group has a running velocity target. (is being controlled by the plugin). This should at least solve that issue.

    Ok pushed out the 1.46, containing bug fixes and a new Destinations system by Thulinma, of which I will make a video shortly. Tip:
    Under the tracks, tag switcher signs underneath the tracks you wish to toggle. Then you can use /train dest [name] to set a destination, or click on the destination sign. Also possible to set property signs.

    @Sneaky420 change the direction of the sign so that the text-side faces into the direction you want to spawn to. Otherwise it spawns into a dead end, making all carts spawn clamped up in one spot.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Sep 9, 2018
  31. I must say: great job! The two problems I reported, the booster rails and train teleportation over long distances, are now solved, tested right now with exactly the same that was not working before, as I did not take anything away, trusting you'd fix quickly :) Thank you very much!
     

Share This Page