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

    zuendi123

    Hi bergerkiller!
    I love your plugin! It's very nice and perfect for our server but we need a new feature. Can you deny minecart-destroying via permissions? I've seen that you have implemented a permission-node for minecart-placing but not for minecart-destroying. It would be very nice!

    zuendi123
     
  3. Offline

    bergerkiller

    @zuendi123 new version has all this. Commands are a TODO, but you can now set who can enter a minecart, can destroy it, and if trains can be linked. A lot is possible now, even enter messages.
     
  4. Offline

    zuendi123

    Nice work man! Keep it up!
     
  5. Offline

    Noogies

    I'm getting the following error. I have bukkit 1185, the latest signlink, and TrainCarts 1.35

    2011-09-22 19:40:37 [INFO] [TrainCarts] SignLink detected, support for arrival signs added!
    2011-09-22 19:40:37 [INFO] [TrainCarts] 0 Trains have been loaded in 0 worlds. (0 Minecarts)
    2011-09-22 19:40:37 [INFO] [TrainCarts] version 1.35 is enabled!
    2011-09-22 19:40:37 [INFO] Server permissions file permissions.yml is empty, ignoring it
    2011-09-22 19:40:37 [INFO] Done (0.309s)! For help, type "help" or "?"
    2011-09-22 19:40:38 [SEVERE] Could not pass event VEHICLE_COLLISION_ENTITY to Train Carts
    java.lang.NullPointerException
    at com.bergerkiller.bukkit.tc.MinecartGroup.link(MinecartGroup.java:122)
    at com.bergerkiller.bukkit.tc.MinecartGroup.link(MinecartGroup.java:118)
    at com.bergerkiller.bukkit.tc.Listeners.TCVehicleListener.onVehicleEntityCollision(TCVehicleListener.java:155)
    at org.bukkit.plugin.java.JavaPluginLoader$83.execute(JavaPluginLoader.java:825)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
    at net.minecraft.server.EntityMinecart.collide(EntityMinecart.java:715)
    at net.minecraft.server.EntityMinecart.s_(EntityMinecart.java:575)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1193)
    at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
    at net.minecraft.server.World.playerJoinedWorld(World.java:1175)
    at net.minecraft.server.World.cleanUp(World.java:1090)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:460)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-09-22 19:40:38 [SEVERE] Could not pass event VEHICLE_COLLISION_ENTITY to Train Carts
    java.lang.NullPointerException
    at com.bergerkiller.bukkit.tc.MinecartGroup.link(MinecartGroup.java:122)
    at com.bergerkiller.bukkit.tc.MinecartGroup.link(MinecartGroup.java:118)
    at com.bergerkiller.bukkit.tc.Listeners.TCVehicleListener.onVehicleEntityCollision(TCVehicleListener.java:155)
    at org.bukkit.plugin.java.JavaPluginLoader$83.execute(JavaPluginLoader.java:825)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
    at net.minecraft.server.EntityMinecart.collide(EntityMinecart.java:715)
    at net.minecraft.server.EntityMinecart.s_(EntityMinecart.java:575)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1193)
    at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
    at net.minecraft.server.World.playerJoinedWorld(World.java:1175)
    at net.minecraft.server.World.cleanUp(World.java:1090)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:460)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
     
  6. Offline

    bergerkiller

    @Noogies Got it, expect an update in a few secs. In the meantime: you can resolve it by removing all minecarts. From then on it will work.

    EDIT

    Updated.
     
  7. Offline

    Noogies

    Yes, that resolved the problem. Thanks for such quick work.

    I have a feature request.

    It would be nice to tie all the stations together, and have track junctions automatically switch the train to go in the correct direction. This is how I envision a possible system for doing this...

    Builder places a sign with the following text next to the button that is connected via redstone to the sign under the track which spawns the train:
    1st line: StationName
    2nd line: [station]
    3rd line:
    4th line:

    Builder issues a command to tell the system what is down the track from the station. It can be a one exit station, or a two exit station. I believe it would be easiest to restrict stations to 180 degrees, prohibiting stations with exits at 90degrees to each other.

    Command would consist of /traincart station [stationname] [connections]

    the connections string would consist of a cardinal direction letter and the name of a Station or junction that is down the track which exits the station in that direction, separated by a colon. Two exit stations would have two connection strings separated by a comma.
    for instance: /traincart station BeachStation S:WoodsyJunction,N:ArcticJunction

    This command would place a line in one of the .yml files maintained by Minecart.jar as part of it's config.

    User sees:
    StationName
    > DestinationStationOne <
    DestinationStnTwo
    StationThree

    each time the user clicks on the sign, the > and < move down. (similar to the way you use signs to choose destination portals on the Stargate plugin) Once the destination is chosen, the user then presses the button to spawn the train. The train spawns, with the destination defined in one of it's variables.

    Builder places a sign under each three point intersection with the following text on it.
    1st Line: JunctionName
    2nd Line: [junction]
    3rd line:
    4th line:

    Builder issues command: /traincart junction [junctionname] [connections]
    the connections parameter consistes of three sections separated by commas. Each of the three sections contains a cardinal direction and a junction name or station name separated by a colon. For instance, you just created a junction in the woods. it's called "WoodsyJunction" according to the sign you placed under the junction. if the station named "BeachStation" is down the section of track which is going North from the junction, "JunctionTwo" down the section that goes East, and "MilltownJunction" is down the section of track that leaves the junction towards the West, the full command string would be:

    /traincart junction WoodsyJunction N:BeachStation,E:JunctionTwo,W:MilltownJunction

    With all the junctions and the stations defined, you should be able to work out the best path and change switches to direct the train of carts to the appropriate station. In the example, the junction would change to a straight piece if the train is going from "JunctionTwo" to "MilltownJunction" or vice-versa. It would change to a NE curved section if the train is going from "JunctionTwo" to "BeachStation" or vice-versa. And would change to a NW curve if going from "MilltownJunction" to "BeachStation" or vice-versa.

    Obviously you may have a different idea on how this could be implimented. Either way, it sure would be nice if I didn't have to get out of my cart to flip a switch at each junction, then get back in and hope i can get the cart started again without pushing it.

    Sorry about being a tad long-winded.
     
  8. Offline

    Celtic Minstrel

    Actually, there is a BukkitDev page for the plugin. I'm not sure if the downloads are kept up-to-date, but the page is there. I do agree that BukkitDev has some issues, though for me it's more related to notifications than file uploading (I haven't had problems uploading files).
     
  9. Offline

    zuendi123

    @Noogies Nice idea, but I think this would fit in a seperate plugin :D I'm curious about what bergerkiller thinks about it ...
    @bergerkiller I have another new feature for you. Can you do a permission-node for using the plugin? We only want admins to link carts together, but no users.
     
  10. Offline

    Omen

    @bergerkiller
    I love this plugin but I have found once annoyance. Stalled carts stop moving trains.
    Is it possible for a moving train to destroy/remove stalled carts from the track?
    Maybe with a sign:
    [train]
    plow

    Then any carts that train comes across is destroyed if its moving or not.

    I have a "Tour Bus" I am building to tour my land but sometimes there is a random cart on my tracks, or a stalled train and while people are riding, they hit them, and stall out and cannot move.

    Or maybe make it so no matter what, the train in motion links to the stalled carts but keeps moving?

    On another note....
    Is it possible to make it so if 2 trains/carts are heading towards one another, they pass right through each other? No linking, no collisions, no stalls.
     
  11. Offline

    DeathQueen

    How would you propose he do the removal? Issuing a command? It wouldn't make sense for it to auto happen because minecarts autolink when touching.
     
  12. Offline

    Omen

    he can detect when trains collide right? cant he detect when a moving, linked train collides with a non moving cart/train? if you wanna build your trains manually, then build your train before it runs over the "plow" sign. unless there is an easier way to do it. i cannot stand when my tour bus stops because of a dead, stray or placed non moving cart.
     
  13. Offline

    DeathQueen

    You don't understand. All carts that a train comes in contact wiht auto joins the train. There is no way to differ then, unless you send a command of some sort, like /traincart plow or /traincart derailer. I can't understand why your cart would stop if it collided with the cart, if they auto connect. It shouldn't stop at all.
     
  14. Offline

    bergerkiller

    Woah been a while since I saw such a discussion going on... :)
    Don't forget: I know EVERYTHING of my minecarts. I can check the passengers, items, coal level, what train the minecart is in, connected minecarts, neighbours, and now train properties too.

    Also, I will eventually add a 'detector' sign, which will toggle a lever if a certain property on the train above matches that on the sign. This way I (and you) can create automatic-train switching stations to get a train to another station through lots of complicated junctions if needed. First need the properties system to be finished and all working.

    @zuendi123 Yes, I shall add 'default train properties' using permissions. This way you can set options for different people, such as mobs enter false upon train creation when they place a minecart.

    @Omen yes, it's possible to make minecarts penetrate eachother. (I handle all coding now anyway, I could make it fly and drop tnts to make a fighter yet out of it, if I wanted) I'll add a 'traincollision: true/false' property to the trains. If either of the two trains have this property, it will not collide/link.
     
  15. Offline

    Celtic Minstrel

    Ooh, it'd be nice to get this into the Bukkit API...
     
  16. Offline

    Omen

    That will work to keep strains from stalling out on other trains that are already stopped. Thanks!
     
  17. Offline

    bergerkiller

    Status update:
    - Train collision setting working, trains can penetrate other trains/entities
    - Tags working: you can toggle a lever based on two tags max (OR/AND)
    - Train has infinite tags he can use
    - With the tag-setup, you could pre-destine a train or make it go a certain route
    - Fixed entity enter bug: mobenter false didn't always denied mobs from entering
     
    emericask8ur likes this.
  18. Offline

    emericask8ur

    Maybe make it so that you can place signs on the trains :O Like Train Numbers
     
  19. Offline

    bergerkiller

    @emericask8ur wish it was possible, but unfortunately signs are blocks...so you can't make it follow the minecart smoothly. :)
     
  20. Offline

    DrAgonmoray

    @bergerkiller

    That video was amazing. This plugin looks sooper cool.
     
  21. @bergerkiller:
    Had a look at your plugin now,
    so far it's very nice!

    But I've a problem with the spawner:
    On my test-route, the train spawns but does not launch :-/

    On the other side, i now have two more wishes:
    could you include an option to auto-spawn trains, for example every 5 minutes a new train?

    And could you let the trains drive without needing powered rails between stations (like in Falsebook)?

    Thank you

    Basti
     
  22. Offline

    emericask8ur

    Hmm maybe next make it with spout so you can! xD
     
  23. Offline

    bergerkiller

    @szoller I'll add a 'stay at max speed' property then for individual trains. (setTrainSpeed)
    Not sure about the train spawner, been a pain to get it to work... xd

    And I don't want to overcomplicate things...so Spout bumper signs can be a different plugin project for someone.
     
  24. Thank you.
    Could that also be set in stations, so trains drive at ~constant speed between station or a kind of constant launch?
    In Falsebook, only in stations launched carts keep their speed...

    I could imagine that ;)
    But would be a nice feature, so there are no buttons needed at stations...people just have to wait (and on arrival signs they see when the next train comes...
     
  25. Offline

    bergerkiller

    Well the station sign is pretty much filled with data already, I could add a max speed changer sign ofc. (like Minecart Mania has, and is already implemented)
    I'll try to use the last known max speed, using the previous velocity. If the previous velocity was higher than the new one, it would set the new one to the old one. This way smooth-launches are still possible.
    (they launch till max-speed anyway)
     
  26. Offline

    dockter

    Server Side error, client crash when a user logs in, logs out, then tries to login again.

    2011-09-25 01:51:41 [WARNING] Failed to handle packet: java.lang.NullPointerException
    java.lang.NullPointerException
    at org.getspout.spout.chunkstore.SimpleChunkDataManager.getTaggedBlocks(SimpleChunkDataManager.java:208)
    at org.getspout.spout.block.SpoutCraftChunk.getTaggedBlocks(SpoutCraftChunk.java:253)
    at org.getspout.spout.inventory.SimpleItemManager.sendBlockOverrideToPlayers(SimpleItemManager.java:736)
    at org.getspout.spout.inventory.SimpleItemManager.sendBlockOverrideToPlayers(SimpleItemManager.java:699)
    at org.getspout.spout.player.SimplePlayerManager.setVersionString(SimplePlayerManager.java:115)
    at org.getspout.spoutapi.packet.PacketFullVersion.run(PacketFullVersion.java:37)
    at org.getspout.spout.packet.CustomPacket.a(CustomPacket.java:130)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:500)
    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)

    If a server reload or stop/start is performed, user is able to login one time only before problem comes back.
     
  27. Offline

    bergerkiller

    @dockter that is a Spout error, ask it to a Spout developer for help. Not related to TrainCarts. :)

    I am writing up a WIKI page with ALL the features, including the up-coming tag feature which is pretty awesome!

    This page is becoming so incredibly long I can't even find the section to edit anymore, so expect a better formatted page in a few hours! :)

    Updated to v1.37, adding default train properties and a tag track switcher. (don't miss it!)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  28. Happens for me :-/
     
  29. Offline

    bergerkiller

    @szoller well spotted, for some reason Notepad++ added a tab and a space after the line. (no idea why)
    Re-uploaded it.
     
  30. Works now!
    So I need powered rails for now?
     
  31. Offline

    bergerkiller

    @szoller Yup, for now you have to. Or use station signs set on continue every x blocks.
     

Share This Page