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. Yeah, maybe disabling the fact that you can push a train that is at station would be cool, offen happens that someone pushes one back to the spawner ^^
     
  3. Offline

    bergerkiller

    @Sneaky420 if have the 'global owner' permission (OP) or own the train, you are not pushed away by the train. This so owners won't have issues with the train. Set the owner to an odd name, set 'pushAwayIgnoreGlobalOwners' to false in the configuration or deop yourself.

    Also, I'm working on a way to prevent carts from penetrating blocks..it's a serious pain IMO.
     
  4. Offline

    Taek Fang

    I am not sure if it's a plugin that might be an issue, or perhaps my miss understanding of the concept of "select cart" but every time I try to set a destination I get the quoted error. I've even checked on the server console and am receiving no errors at all.
    Following Plugins:
    Show Spoiler
    AuthMe
    CraftBook
    Essentials
    Lockette
    MagicCarpet
    Permissions
    Residence
    SignLink
    TrainCraft
    WorldEdit
     
  5. Offline

    bergerkiller

    @Taek Fang You are not the only one, it happened to me too a few times. It's random, so not sure what the reason is behind all this...
     
  6. Offline

    crosstalk

    It seems to be that stations aren't always stopping trains. While it seems reliable for 1 minecart, if I tell a station to stop a train of 3 or more minecarts (2 of which are powered minecarts), the train will just pass by the station. If I tell it to send trains a certain direction, it is reliable in doing so.

    I'm powering each side using redstone torches. I've also tried powering just the "front" of the sign with a single torch, and by using redstone dust wiring from an active torch. Additionally, I've set a delay of 1 second on the station -- but it still doesn't seem to stop trains.

    Am I doing something wrong?
     
  7. Offline

    Sneaky420


    Yea, I thought that, so i checked all the configs and seems I set the wrong one, so when the server it back up and running, i will test it as soon as I can.
     
  8. Are you using a station lenght greater or equal to the train lenght? If you increase the delay, is it then working? Weird, seems to work on mine, but again, informatic and its mysteries...
     
  9. Offline

    bergerkiller

    @crosstalk not sure, but what if you re-download it? Could be you have a version I had to re-upload in 10 minutes or so...
     
  10. Offline

    crosstalk

    I recall downloading it immediately before you posted about the issue, the redownloading when you said that you accidentally put up a bad download. Guess I missed the BukkitDev link, though, because I used GitHub.

    Thanks, I did have the bad version.
     
  11. Offline

    mrgreaper

    were getting an error that brings down our server as soon as some one gets into a cart


    Code:
    2011-11-04 15:13:58 [SEVERE] Could not pass event VEHICLE_CREATE to Train Carts
    java.lang.NoSuchMethodError: net.minecraft.server.BlockMinecartTrack.f()Z
        at com.bergerkiller.bukkit.tc.NativeMinecartMember.preUpdate(NativeMinecartMember.java:298)
        at com.bergerkiller.bukkit.tc.MinecartGroup.create(MinecartGroup.java:83)
        at com.bergerkiller.bukkit.tc.MinecartGroup.create(MinecartGroup.java:76)
        at com.bergerkiller.bukkit.tc.Listeners.TCVehicleListener.onVehicleCreate(TCVehicleListener.java:64)
        at org.bukkit.plugin.java.JavaPluginLoader$82.execute(JavaPluginLoader.java:834)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
        at net.minecraft.server.EntityMinecart.<init>(EntityMinecart.java:92)
        at net.minecraft.server.ItemMinecart.a(ItemMinecart.java:32)
        at net.minecraft.server.ItemStack.placeItem(ItemStack.java:69)
        at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:282)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:590)
        at net.minecraft.server.Packet15Place.a(SourceFile:39)
        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.w(MinecraftServer.java:511)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:409)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:454)
    2011-11-04 15:13:58 [INFO] Fetching addPacket for removed entity
    2011-11-04 15:13:58 [INFO] Fetching addPacket for removed entity
    2011-11-04 15:13:58 [SEVERE] java.lang.NoSuchFieldError: bJ
    2011-11-04 15:13:58 [SEVERE]     at com.bergerkiller.bukkit.tc.NativeMinecartMember.move(NativeMinecartMember.java:659)
    2011-11-04 15:13:58 [SEVERE]     at net.minecraft.server.EntityMinecart.x_(EntityMinecart.java:393)
    2011-11-04 15:13:58 [SEVERE]     at net.minecraft.server.World.entityJoinedWorld(World.java:1238)
    2011-11-04 15:13:58 [SEVERE]     at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:104)
    2011-11-04 15:13:58 [SEVERE]     at net.minecraft.server.World.playerJoinedWorld(World.java:1220)
    2011-11-04 15:13:58 [SEVERE]     at net.minecraft.server.World.tickEntities(World.java:1127)
    2011-11-04 15:13:58 [SEVERE]     at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:502)
    2011-11-04 15:13:58 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:409)
    2011-11-04 15:13:58 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:454)
    2011-11-04 15:13:58 [SEVERE] Unexpected exception
    java.lang.NoSuchFieldError: bJ
        at com.bergerkiller.bukkit.tc.NativeMinecartMember.move(NativeMinecartMember.java:659)
        at net.minecraft.server.EntityMinecart.x_(EntityMinecart.java:393)
        at net.minecraft.server.World.entityJoinedWorld(World.java:1238)
        at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:104)
        at net.minecraft.server.World.playerJoinedWorld(World.java:1220)
        at net.minecraft.server.World.tickEntities(World.java:1127)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:502)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:409)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:454)
    we are on 1.47 (the bukkit dev link uploaded 40 hours ago)
    craftbukkit for 1.9 (build 16 i believe) (could be that the plugin is not compatable with 1.9 it would be the first one we have had that issue with but entirely possible)

    hoping its fixable as this looks great

    ***
    the crash happens the moment a player places a cart on track
     
  12. Offline

    bergerkiller

    @mrgreaper yup it's not compatible with 1.9 @Thulinma already made a 1.9 version for it though, but of course stick with the recommended builds until 1.9 is official. :)

    (else CB#1337 version ends in a version full of bugs or missing features)
     
  13. Offline

    mrgreaper

    were loving 1.9 unfortuantly we needed a new map around the time of the pre release so we were vanila until the amazing dinnerbone updated bukkit branch for it

    is there a link to the 1.9 build?
     
  14. Offline

    Cherrykiller

    the plugin spam 1000 mincarts if place 2 mincarts to a train and plugin crash 2 times the server.
    no thanks 2 PLugins from you (nolag, and now dis) has crash it my server
     
  15. Offline

    LEOcab

    I don't know if this is intended behavior or not, but how come powered minecarts never run out of fuel? I love the plugin and I'll add it on my server once I figure out how to fix this... Can you help me? :)
     
  16. Offline

    bergerkiller

    @LEOcab I am not sure, but it is possible that it is refueling every time it passes a station. I recently removed the two lines causing this, not yet in this version.

    @Cherrykiller Has already been fixed, you must have a version where it is not fixed. Otherwise, how?

    @mrgreaper I'll upload a temp. 1.9 version for ya :)
     
    mrgreaper likes this.
  17. Offline

    bergerkiller

    @Thulinma thanks, I couldn't find a proper Bukkit pre-release to build my own :)
    Did you use the latest changes I committed and pushed to Github? (This)
     
  18. Offline

    LEOcab

    I'm not using stations; it's just a circular track. It goes on infinitely and it does have several slopes. I just tried it with no other plugins to rule out a conflict but nope. I'm using CB1337. What could it be?
     
  19. Not yet. That build has everything except that last commit. I'll update it soon, I think :) (is there anything important in that bugfix?)

    EDIT: Updated with latest fixes. Same link.
     
  20. Offline

    bergerkiller

    @Thulinma yup, lots. Fixes for false linking, recoded the minecartgroup spawn coding to correctly launch the train, lots of minor bugfixes, and fixes a lot of memory leaks in the latest commit I did a minute ago.
     
  21. HELP!
    Code:
    [INFO] [TrainCarts] SignLink detected, support for arrival signs added!
    2011-11-04 23:38:52 [SEVERE] Error occurred while enabling Train Carts v1.47 (Is it up to date?): org/bukkit/configuration/file/YamlConfiguration
    java.lang.NoClassDefFoundError: org/bukkit/configuration/file/YamlConfiguration
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(Unknown Source)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$000(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
        at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:219)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:32)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at com.bergerkiller.bukkit.tc.TrainCarts.loadConfig(TrainCarts.java:65)
        at com.bergerkiller.bukkit.tc.TrainCarts.onEnable(TrainCarts.java:132)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:920)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:278)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:173)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:156)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:297)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:284)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:152)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:348)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    Caused by: java.lang.ClassNotFoundException: org.bukkit.configuration.file.YamlConfiguration
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 27 more
     
  22. Update your CraftBukkit to a recent build. :)
     
  23. Thanks, I'm just an Idiot for not noticing that. :)
     
  24. Offline

    Sneaky420

    K so finally my server is back up and running, and i am testing some more, still able to push a train out of the station, i turned off OP, still able to push the train around.

    Here is the configs:

    normal:
    cartDistance: 1.5
    cartDistanceForcer: 0.1
    turned:
    cartDistance: 1.6
    cartDistanceForcer: 0.2
    nearCartDistanceFactor: 1.2
    removeDerailedCarts: false
    maxCartDistance: 4.0
    breakCombinedCarts: false
    spawnItemDrops: true
    poweredCartBoost: 0.0
    exitOffset:
    x: 0.0
    y: 0.0
    z: 0.0
    pushAwayForce: 0.2
    pushAwayIgnoreGlobalOwners: false
    useCoalFromStorageCart: false
    setOwnerOnPlacement: false
    use: true

    Flags:

    default:
    owners: &id001 []
    passengers: &id002 []
    allowMobsEnter: true
    allowPlayerEnter: true
    allowPlayerExit: true
    allowLinking: false
    requirePoweredMinecart: false
    trainCollision: true
    keepChunksLoaded: true
    tags: &id003 []
    speedLimit: 0.4
    slowDown: true
    destination: ''
    pushAway:
    mobs: true
    players: true
    misc: true
    atStation:
    mobs: true
    players: true
    misc: true
    admin:
    owners: *id001
    passengers: *id002
    allowMobsEnter: true
    allowPlayerEnter: true
    allowPlayerExit: true
    allowLinking: false
    requirePoweredMinecart: false
    trainCollision: true
    keepChunksLoaded: true
    tags: *id003
    speedLimit: 0.4
    slowDown: true
    destination: ''
    pushAway:
    mobs: true
    players: true
    misc: true
    atStation:
    mobs: true
    players: true
    misc: true

    Sorry for being a pain with this, but I just want it the way that it was :( I guess i am old fashioned... lol

    but thank you for all the help so far and anymore help you can offer.
     
  25. Offline

    bergerkiller

    @Sneaky420 right now everyone is owner (owners is empty), set someone owner or it won't work.
     
  26. Offline

    Sneaky420

    so for these, i can put in my name?

    admin:
    owners: *id001
    passengers: *id002

    well the owner one. and the reason i ask this is cause the trains are wiped by another plugin after 30 mins, all boats and carts are cleared, so the trains that i use are all point to point and they destroy them selves, so I am guess this would need to be a default flag then?

    Or putting in the random characters in the default owner line
     
  27. Offline

    bergerkiller

    @Sneaky420 yup, a default flag. Note that others can't push the train if you are the owner, so there is no real issue.
     
  28. Offline

    Sneaky420


    woot, thank you soo much, sorry for double checking and such, better to be safe then sorry.

    tho i would like to invite you to my server so you can see the "factory", which i am sure is not anything like the intended use for the trains, i will have to get you the server address one the new IPs are assigned (lots of updates to the host) but I can pm you the temp one if you like
     
  29. Offline

    bergerkiller

    @Sneaky420 sorry the machine goes to bed :)
     
  30. Offline

    Sneaky420

    rest well :) and i did not mean right this min.. lol


    and i put in owners: TrainConductor420 for the default flags, and turned back on my OP and i can push them again... it worked when i manually typed it tho figured that part out
     

Share This Page