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

    chobohobo

    This is a really graet mod keep it up!
     
    mugekun likes this.
  3. Offline

    martial69320

    Excuse me, how can i make a portal, i have see your video, and i haven't message: You created a new portal to t1!
     
  4. Offline

    bergerkiller

    @martial69320 you need to have MyWorlds installed too. (see signature/main post)
    I made it a dependency so cross-world teleportation permissions are already handled, I dislike copy-pasting my own code.
     
  5. Offline

    Celtic Minstrel

    Uh, what is this MyWorlds thing? I don't see it on BukkitDev or even on Get Plugins. The plugin I use for portals is Multiverse-[Nether]Portals. (Though I don't currently use your plugin, but it's likely that I will at some point.)
     
  6. Offline

    bergerkiller

    @Celtic Minstrel ye still need to put it up at the Bukkit dev page...only issue is that it requires me to write a full-out WIKI page. (since there's no room for spoilers on Bukkit dev)

    (or I link to the Bukkit forums of course)

    Also:
    - *-tags are working. Following formats are possible:
    - Added option to disable global train owners from ignoring train pushes (I believe @mugekun has issue with it)

    EDIT

    Updated.
     
    mugekun likes this.
  7. Offline

    Silentspy

    had any luck with the minecart bug?
     
  8. Offline

    bergerkiller

    @Silentspy Looked into it, but after entering and using /stop, it simply closed the server. Restarted and the cart was still there. Perhaps an OS file access issue?

    EDIT

    One rare chance: can happen if the minecart is a member but has not yet gotten a group assigned. I'll add some simple checks for it.

    EDIT

    Re-uploaded it, adding a small fix that *could* fix the saving issue. I am still not entirely convinced..but who knows.
     
  9. Offline

    Silentspy

    great to hear you made some progress!
     
  10. Offline

    gungo

    Hey i must say its a great plug in .But i have one Problem the Train comes in the Station but he didnĀ“t drive out when i push the leveler again. Can you help me?
     
  11. Offline

    bergerkiller

    @gungo Did you make sure that the sign-side you want to launch to, is powered, and the other side is not powered, when toggling the lever? (see also the video if you don't know what I mean)
     
  12. Offline

    mugekun

    I still can NOT get carts to push me. They either go through me, or bounce off me as if I am made of an unmovable force.

    @bergerkiller, can you confirm that carts push your player in SMP? For creftbukkit 1317?
    BTW, the plugin loads as 1.42 (which I believe is the correct version number, but you listed it as 1.41 in your changelog in the OP)
     
  13. Offline

    gungo

    yes It its all build after the Tutorial only that I have two rails but they dont have contact(the Redstone)
    Can you help me on the Server? I can you send the Ip
     
  14. Offline

    bergerkiller

    @mugekun ye that happens now and then...the version changelog mishap. You have the latest version.

    And yes, it works perfectly fine here. Does this work out?:
    @gungo I'll come visit real quick (but do PM the IP or you get unwanted people lol)
     
  15. Offline

    mugekun

    No, it did not work. I tried both pushAwayIgnoreGlobalOwners as true and false.

    Since you say it works for you, I will setup a fresh install of everything, and try again.

    @bergerkiller wow, that did NOT work.

    Here is what I did.
    Create new folder, and place craftbukkit 1317 in it.
    Configure server.properties
    create plugins folder
    copy Train Carts.jar there

    Start server
    stop server
    Check that train carts created all of it's stuff
    start server
    login

    Create a simple track with powered rail at the ends to make the train bounce back and forth.
    Put a train on it
    set pushing on
    set pushing players on
    set owner to lknsd
    start train movement
    watch train bounce back and forth
    get in the way
    ....... train bounces off me

    shutdown server
    edit train carts config.yml
    Set pushAwayIgnoreGlobalOwners: true
    save

    start server
    login
    get train moving
    train still bounces off me instead of pushes me

    @bergerkiller I'm going to send you a PM with a link to a zip of the test server I setup, if you would be willing to take a look and see if I am a retard or something, that would be great.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  16. Offline

    King_KYl3

    I dunno but its so glitchy on my server when we all hop in the train ;(
     
  17. Offline

    bergerkiller

    @King_KYl3 Can't do much about that sadly. Notch should implement player - linked - minecarts instead of having both minecart and player movement packets being sent.

    @mugekun I'll look at the zipped file later. You are using the latest CB build and latest TC version?
     
  18. Offline

    King_KYl3

    okay well can u please add speed signs and lock cart signs thanks :D
     
  19. Offline

    mugekun

    CB is 1317
    TC is 1.42
     
  20. Offline

    bergerkiller

    @King_KYl3 lock cart signs are the property signs:
    Etc.

    Speed signs are missing tho, could add them easily. Assumed people could use Minecart Mania for it in the past...TrainCarts is kinda standing on it's own now.

    @mugekun couldn't really find an issue (since it worked here). What happens if you de-op yourself, or log in under a different name? (see also PM)

    @King_KYl3 Ok added a train speed limit train property for ya. I'll update the WIKI in a sec.
    Updated.
    Use /train speedlimit [value] or /train maxspeed [value] to set the limit through the chat. You can also use the property signs for this. Value is in blocks/tick.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  21. Offline

    BadKarMa

    Berger! First of all thanks for the *!

    It's a pity that I couldn't really test it yet, as I've found another problem.
    Our server log creates some terrible warnings every 3 seconds:
    Code:
    [WARNING] Can't keep up! Did the system time change, or is the server overloaded?
    My admin suspects the reason is TrainCarts, as the last entries before the first WARNING were:

    Code:
    [SEVERE] Could not pass event VEHICLE_MOVE to Train Carts
    java.lang.NullPointerException
    at com.bergerkiller.bukkit.tc.API.SignActionEvent.getLine(SignActionEvent.java:163)
    at com.bergerkiller.bukkit.tc.Listeners.CustomEvents.onSign(CustomEvents.java:379)
    at com.bergerkiller.bukkit.tc.MinecartGroup.removeCart(MinecartGroup.java:506)
    at com.bergerkiller.bukkit.tc.MinecartGroup.removeCart(MinecartGroup.java:426)
    at com.bergerkiller.bukkit.tc.MinecartMember.remove(MinecartMember.java:188)
    at com.bergerkiller.bukkit.tc.MinecartMember.destroy(MinecartMember.java:185)
    at com.bergerkiller.bukkit.tc.Listeners.CustomEvents.onSign(CustomEvents.java:492)
    at com.bergerkiller.bukkit.tc.Listeners.CustomEvents.onSign(CustomEvents.java:361)
    at com.bergerkiller.bukkit.tc.Listeners.TCVehicleListener.updateSign(TCVehicleListener.java:124)
    at com.bergerkiller.bukkit.tc.Listeners.TCVehicleListener.onVehicleMove(TCVehicleListener.java:143)
    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:608)
    at com.bergerkiller.bukkit.tc.MinecartMember.s_(MinecartMember.java:68)
    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)
    The server did not stop or restart, but it was extremely laggy at that time. I found some cart-graveyard (I call it like that, when a hell lot of carts are standing still at one point of the track) with dozens of carts. I then used the "/reloadall" and "/train removeall" and it seems to be less laggy now.

    I'm not that sure, which TC version was installed at the moment the error occured, but it was at least 1.40 or higher. The server is up-to-date now.
     
  22. Offline

    bergerkiller

    Mhh that's a bad thing, it shouldn't return 'no sign' when it is a sign action event. Let me stack trace this for a bit...

    EDIT

    @BadKarMa Re-uploaded it, added one little line of code to help fight null signs. Hopefully it fixes your issue for now.
     
  23. Offline

    mugekun

    De-oping myself did the trick. I'm definitely confused by how this works. Is this due to settings in the defaultflags.yml?
    I want it to push ops as well.
    And in fact, if I am not op now, simply setting owner to a non-player and enabling pushing works. I am very confused as to why it wasn't working before, and is now. I did do some playing around with the defaultflags.yml, but then I set it all back. I can't get it to behave like it did when I was having issues.
    (I think I will go try my mctest that I sent you again, and see if it's broken in the same way there or not)
    ...Okay I tested again with the zip I sent you, and so long as I set pushAwayIgnoreGlobalOwners to false, it works as expected. So long as the train has no owner set, everyone owns it, so they don't get pushed, and if I set an owner that is not me, I get pushed. I must have been doing something else wrong when testing before, I don't know what.:eek:

    Basically I would like to set things up so if people make a cart/train it will behave essentially normally.
    But so that if it is a train from one of my stations it will push anything that is in it's way(I guess by using signs to set the properties)

    Any suggestions for this config?

    Well anyway, it seems to work now. And I suppose I can just use a sign to set the owner to a non-player and more signs to setup the pushing properites.

    Any chance you could add a feature to set default flags for spawners? It would be much easier than me making signs. As is, I have to make a spawner sign, then a setowner(actually there isnt a sign setter for this either) sign, then a torch, then a pushplayer sign, then a pushmob sign, then a torch then a pushatstation(actually I didnt see a sign setter for this in the wiki, not sure if it is needed) sign.
    That's 7 signs for my train spawner, kinda ugly, but if it's a bunch of trouble, then it isn't a huge problem.

    Thanks again for the time and plugin.
     
  24. Offline

    bergerkiller

    @mugekun There is a 'property default' sign, which sets the properties on the train above to a default found in defaultflags.yml. For example:
    Where MyTrainStation is a default found in defaultflags.yml. You can also use custom/admin, as they are generated by default.
     
  25. Offline

    DamienMine

    Thank you for this great plugin bergerkiller! Running here without any major problems.

    I haven't read the whole thread (but the last few pages and the first 7 or so), so I'm having a little question: will you add support for booster/brake rails? With proper station usage they aren't really needed but it still would be nice to have them on specific tracks.
     
  26. Offline

    bergerkiller

    @DamienMine they still work as intented, however, stations disable them when a train enters it, and re-enables them when it is out of the stations' reach.
     
  27. Offline

    mugekun

    Wow I totally didn't figure that out from the wiki. So the defaultflags.yml is more of a flagtemplates.yml
    That will come in very handy.

    Thanks again.
     
  28. Offline

    PDemon

    This is a Very! good plugin and i use it on my server :-D keep it up
     
  29. Offline

    bergerkiller

    @PDemon I am also glad it all worked out so well...if you look at the early development video...lol
     
  30. Offline

    PDemon

    @bergerkiller Maybe i just didn't look hard enough but is it possible to have a sign add a tag to a train or just a cart?
    is there a to remove a traincart and make it "Normal" without any traincart plugin coding on it (have a few storecarts in a sorting station which do not need to be anything but dumb carts).
    would it be possible for you to make the powered cart run on "sticks for an example" ?
     
  31. Offline

    bergerkiller

    @PDemon
    1. Yup, use the 'property' signs (see WIKI), it contains settag, addtag and remtag property commands
    2. You can always have one minecart and set 'linking' to false. Then it will no longer link and will act as a regular minecart. (Nothing really happens when it is only one minecart)
    3. It's possible, but would it be useful? Lol...
     

Share This Page