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

    bug report, 1.6 BETA v10 CB 1597 (current 1.0 recommended build)
    Code:
    14:08:39 [INFO] This server is running Craftbukkit version git-Bukkit-1.0.1-R1-b1597jnks (MC: 1.0.1) (Implementing API version 1.0.1-R1)
    14:08:39 [INFO] Preparing level "world"
    14:08:39 [INFO] Default game type: 0
    14:08:40 [INFO] Preparing start region for level 0 (Seed: -5032577977843402752)
    14:08:40 [INFO] Preparing start region for level 1 (Seed: 4482122056527247973)
    14:08:41 [INFO] Preparing spawn area: 61%
    14:08:41 [INFO] Preparing start region for level 2 (Seed: 4343513497250610307)
    14:08:41 [INFO] [TrainCarts] 17 Trains have been loaded in 1 world. (17 Minecarts)
    14:08:42 [INFO] [TrainCarts] 0 detector rail regions loaded covering 0 blocks
    14:08:42 [INFO] [TrainCarts] version 1.6 is enabled!
    14:08:42 [INFO] Server permissions file permissions.yml is empty, ignoring it
    14:08:42 [INFO] Done (0,220s)! For help, type "help" or "?"
    14:08:42 [SEVERE] java.lang.NoSuchFieldError: bQ
    14:08:42 [SEVERE]      at com.bergerkiller.bukkit.tc.NativeMinecartMember.move(NativeMinecartMember.java:667)
    14:08:42 [SEVERE]      at net.minecraft.server.EntityMinecart.w_(EntityMinecart.java:396)
    14:08:42 [SEVERE]      at net.minecraft.server.World.entityJoinedWorld(World.java:1253)
    14:08:42 [SEVERE]      at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:107)
    14:08:42 [SEVERE]      at net.minecraft.server.World.playerJoinedWorld(World.java:1235)
    14:08:42 [SEVERE]      at net.minecraft.server.World.tickEntities(World.java:1142)
    14:08:42 [SEVERE]      at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:518)
    14:08:42 [SEVERE]      at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425)
    14:08:42 [SEVERE]      at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    14:08:42 [SEVERE] Unexpected exception
    java.lang.NoSuchFieldError: bQ
            at com.bergerkiller.bukkit.tc.NativeMinecartMember.move(NativeMinecartMember.java:667)
            at net.minecraft.server.EntityMinecart.w_(EntityMinecart.java:396)
            at net.minecraft.server.World.entityJoinedWorld(World.java:1253)
            at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:107)
            at net.minecraft.server.World.playerJoinedWorld(World.java:1235)
            at net.minecraft.server.World.tickEntities(World.java:1142)
            at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:518)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    
    new errors TrainCarts 1.6 Beta v10 CB b1797
    when placing detector sign without third line :
    Code:
    14:24:20 [SEVERE] Could not pass event org.bukkit.event.block.SignChangeEvent to Train Carts
    java.lang.NullPointerException
            at com.bergerkiller.bukkit.tc.signactions.SignActionDetector$Detector.validate(SignActionDetector.java:96)
            at com.bergerkiller.bukkit.tc.signactions.SignActionDetector$Detector.onEnter(SignActionDetector.java:176)
            at com.bergerkiller.bukkit.tc.detector.DetectorRegion.register(DetectorRegion.java:173)
            at com.bergerkiller.bukkit.tc.signactions.SignActionDetector.build(SignActionDetector.java:288)
            at com.bergerkiller.bukkit.tc.signactions.SignAction.handleBuild(SignAction.java:77)
            at com.bergerkiller.bukkit.tc.listeners.TCBlockListener.onSignChange(TCBlockListener.java:47)
            at org.bukkit.plugin.java.JavaPluginLoader$38.execute(JavaPluginLoader.java:532)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:57)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:327)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:1094)
            at net.minecraft.server.Packet130UpdateSign.handle(SourceFile:41)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:100)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:536)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    14:24:30 [SEVERE] Could not pass event org.bukkit.event.block.BlockBreakEvent to Train Carts
    java.lang.NullPointerException
            at com.bergerkiller.bukkit.tc.signactions.SignActionDetector.removeDetector(SignActionDetector.java:41)
            at com.bergerkiller.bukkit.tc.listeners.TCBlockListener.onBlockBreak(TCBlockListener.java:41)
            at org.bukkit.plugin.java.JavaPluginLoader$42.execute(JavaPluginLoader.java:560)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:57)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:327)
            at net.minecraft.server.ItemInWorldManager.breakBlock(ItemInWorldManager.java:207)
            at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:102)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:507)
            at net.minecraft.server.Packet14BlockDig.handle(SourceFile:43)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:100)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:536)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 14, 2016
  3. Offline

    bergerkiller

    MechanID You need a later CraftBukkit version, v10 is no longer for 1.o1. (this is the 10th time I post this in the past week)
     
  4. Offline

    MechanID

    bergerkiller ok sorry,
    Same error with CB b1797jnks (my post 1473)
     
  5. Offline

    bergerkiller

    MechanID Yup that one is confirmed (somewhat)

    Also, you can now change train direction by having two powered minecarts on both ends. By placing coal in either of the two you can change the direction almost instantly. (it auto-changes all other powered minecarts with it)
     
  6. Offline

    MechanID

    sometimes i got error, why it happens i dont know
    Code:
    15:27:14 [SEVERE] Could not pass event org.bukkit.event.vehicle.VehicleEntityCollisionEvent to Train Carts
    java.lang.NullPointerException
            at com.bergerkiller.bukkit.tc.utils.BlockUtil.getBlockSteps(BlockUtil.java:36)
            at com.bergerkiller.bukkit.tc.MinecartMember.isHeadingToTrack(MinecartMember.java:828)
            at com.bergerkiller.bukkit.tc.MinecartMember.isHeadingToTrack(MinecartMember.java:822)
            at com.bergerkiller.bukkit.tc.MinecartMember.isFollowingOnTrack(MinecartMember.java:845)
            at com.bergerkiller.bukkit.tc.MinecartMember.isTrackConnected(MinecartMember.java:859)
            at com.bergerkiller.bukkit.tc.MinecartGroup.link(MinecartGroup.java:133)
            at com.bergerkiller.bukkit.tc.listeners.TCVehicleListener.onVehicleEntityCollision(TCVehicleListener.java:144)
            at org.bukkit.plugin.java.JavaPluginLoader$92.execute(JavaPluginLoader.java:914)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:57)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:327)
            at net.minecraft.server.EntityMinecart.collide(EntityMinecart.java:721)
            at com.bergerkiller.bukkit.tc.NativeMinecartMember.postUpdate(NativeMinecartMember.java:609)
            at com.bergerkiller.bukkit.tc.MinecartMember.postUpdate(MinecartMember.java:279)
            at com.bergerkiller.bukkit.tc.MinecartGroup.doPhysics(MinecartGroup.java:910)
            at com.bergerkiller.bukkit.tc.MinecartGroup.doPhysics(MinecartGroup.java:830)
            at com.bergerkiller.bukkit.tc.MinecartMember.y_(MinecartMember.java:265)
            at net.minecraft.server.World.entityJoinedWorld(World.java:1256)
            at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:110)
            at net.minecraft.server.World.playerJoinedWorld(World.java:1238)
            at net.minecraft.server.World.tickEntities(World.java:1145)
            at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:527)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
     
  7. Offline

    bergerkiller

    MechanID Ye that's the error I mentioned before, it's not very severe. Already patched here.

    EDIT

    Adding grouped entity tracker so trains move as one 'being'. This will make trains look a lot more realistic and pretty much eliminate all bumping. :)
     
  8. Offline

    kinkinhood

    kinkinhood Time to re-check I guess...

    EDIT

    Stations work 100% fine here...sow:
    - what TrainCarts version did you use and what CB build?
    - what type of station did you make
    - screenshot or video?
    - can I join to see for myself if that's possible?[/quote]

    Sure. Shoot me your minecraft name in a message and I'll get you on the whitelist. The main reason it's odd is that I have 6 stations and that's the only one that is having issues.
     
  9. Offline

    bergerkiller

    kinkinhood just bergerkiller, got an online account. :)
     
  10. Offline

    kinkinhood

    Alright, come onto 206.217.141.22:25574
     
  11. Offline

    bergerkiller

    kinkinhood ok bug found and fixed. It was in the 'get member from rail block' function; it didn't use the distance from the middle of the block. (thus it couldn't find the cart)

    Also going to prevent that launching when already on the spot.
     
  12. Offline

    kinkinhood

    Ah ok. Is the fix up on the github?
     
  13. Offline

    bergerkiller

    kinkinhood first going to add grouped entity trackers, can take a while though.
     
  14. Offline

    kinkinhood

    Alright. Not too big of a deal.
     
  15. Offline

    bergerkiller

    Wehew! All carts move 100% in-sync now, and it looks AMAZING :D
    And I was wondering why it was so hard to do...now I finally know what I forgot to do :D

    AlexxNB No the syntaxis got changed in the 1.60 versions :)
    Your trigger syntax is correct, but the display name is different.

    If trigger name is 'test1', then the names you can use:
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Sep 9, 2018
  16. Offline

    Mycah

    Thanks for all your work this weekend berger. It is very much appreciated.
     
  17. Offline

    bergerkiller

    See BETA 11 on GitHub. Fixes several NPE's, the station bug and this awesome synced movement. No more bumping into each other EVER :D
     
    Mycah likes this.
  18. Offline

    kinkinhood

    Woot! Way to go killer or bergers.

    Yeah, station problem fixed, running a second cart into the first though still launches them

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

    MechanID

    My Fail (post deleted)
     
  20. Offline

    AlexxNB

    I try use sign-triggers with SignLink. I do exactly same as on the video but doesn't work =(

    Sign1:
    [train]
    trigger
    test1
    00:06

    Sign2:
    Arrival
    countdown:
    %test1%

    Server 1796 (SimLink is only for 1597 - maybe it is answer?) . SgnLink write about variable test1. %date%,%time% and etc. also work. server.log doesn't have errors about it.
     
  21. Offline

    AlexxNB

    cool thx!
     
  22. Offline

    robxu9

    This is a bit of a weird issue. I'll try explaining the best I can:

    On our server, nobody wants to keep hitting a button to spawn trains. We therefore use RedstoneCommand in conjuntion with ConsoleScheduler in order to automate the spawning of these trains. However:

    When a train is spawned in an unloaded chunk, it does nothing. Yet, it keeps spawning more and more trains until we have a major crash there, by which I have to restart the server and clear all entities.

    What used to happen was that when a train was spawned in an unloaded chunk, it would load that chunk, and then the train would go on and load all the chunks that it encountered while moving.

    I think Train Carts' keep chunks loaded function isn't working, because when no players are in a zone, the chunk unloads, the trains never make it to the next stop :|

    EDIT: When I physically go to the spawn location, and I go to each place, then it spawns everything right. But then the trains move into an unloaded chunk and never reaches its destination. :c
     
  23. Offline

    MechanID

    you can use other small train somwhere nearby to keep this chunlks loaded, every smart player in my server have small train in basement of his house to keep furnaces burning and crops growing while the he is far away.
     
  24. Offline

    robxu9

    As I said, the keep chunks loaded doesn't seem to be working :| It might be RollingMinecarts as well, though >_>"
    Uh, the keeping the small train won't help me because we clear minecarts every night when nobody's usually on so that our server runs without random trains piling up.
     
  25. Offline

    bergerkiller

    robxu9 By default, only MOVING minecarts keep chunks loaded. If you want this to happen to not-moving minecarts as well, set the node in the configuration. (keepChunksLoadedOnlyWhenMoving)

    I'll look at this later in the day to check if the feature still works, because it's possible that something got changed in a later CraftBukkit build.
     
  26. bergerkiller
    Im also having trouble with pushing away people (and owner). I am still on beta 10 (didnt see changed to fix it) and in my config i have set push away ignore for global owner/owner to false and i only have the default group in my defaultflags file. The group has all 3 pushAway options enabled.

    Same with the chunk unloading, its enabled and i set the keepChunksLoadedOnlyWhenMoving to false, yet when i move away it stops at one of the stations and freezes up there (doesnt seem to stop between). Now, if its due the train not being part of the proper group and thus getting the flag to keep chunks loaded or it just failing to keep em loaded when stopping, i dont know.

    Im using PEX and i have the * permission. Shouldnt my trains be added to the only existing group by default then?

    Also, im just starting to play with the plugin and its alot to wrap your head around so if im missing something obvious, sorry :)

    Im using CB 1749 (slightly old dev, but no errors)
     
  27. Offline

    kinkinhood

    bergerkiller Out of curiousity does the current beta have the chest drop off sign setup in it? (and do chestcarts autopickup stuff as they pass?)
     
  28. Offline

    bergerkiller

    kinkinhood yup that is in there.

    Instead of [train] you can use [cart] to pick up items (or put items) at the cart that is right now at the spot. For trains, it does this on the entire train once.

    1st line: [train] or [cart]
    2nd line: chest in or chest out
    3rd line: optional minecart owner name to take from (keep blank to take from public carts)
    4th line: The item type to remove. Keep empty to transfer all. Don't put a number in front to take all of that type.

    Sorken will look at it then.
     
  29. Offline

    kinkinhood

    Awesome. Think there is any way you could make it so chestcarts can collect stuff that's on the ground next to/near it?(i.e. making an autofarm that has the cart go out and collect the goodies and then bring them back and stick them in their associated boxes)
     
  30. Offline

    MechanID

    bergerkiller
    Please tell me is there way to set slowdown to trains like in your signature (pppmmmmssssmmmmppp) same as trains without powercarts have ?
     
  31. Offline

    bergerkiller

    MechanID Actually, they were just powered minecarts with coal in them :)

    Believe I haven't added a node for it yet, good suggestion. What command would you prefer?

    kinkinhood also possible:
    :)
     

Share This Page