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. well, i did a couple of test runs as per your instruction and the instruction on the wiki pages and it seems the destroy sign always destroys a train ignoring it's redstone power state. (also tried [train] and [!train]) is this a bug ?

    just tried the setup posted here: http://forums.bukkit.org/threads/me...o-form-trains-2167.29491/page-73#post-1092160

    and it also does not seem to work as intended: in the wiki it says "The lever is toggled when either of the two statements match. The tracks are only changed if the sign is powered. (or has power inverted and is not powered)" but no matter if i use a powered or unpowered sign, the tracks always get switched. same as with the destroy sign always destroying no matter if power is applied or not.
     
  3. Offline

    bergerkiller

    g_BonE most likely a bug, as I noticed the destroy sign was in two classes for some reason. Also noticed that it was using the move to do stuff too, not too good. I'll do some tests.
     
  4. same here, testing detector signs now and it seems to have issues too, nothing is triggered by an empty train even if the [train] - detector - passenger sign should switch the lever and power up redstone.

    further testing:

    * created a [train] - switcher - f:passenger - r:empty sign
    * created a [!train] - destroy sign three blocks before the switcher design and facing the train as it would enter on reverse

    destroy ignores how the sign is facing too.
     
  5. Offline

    bergerkiller

    g_BonE try version 1.68, it could very likely be the same bug CommanderGizmo had (see previous page) where a track was wrongly detected. I fixed that in 1.68.

    Also, other changes:
    • New announcer sign
    • Statement and message shortcuts
    • Messages support signlink variable replacements (e.g. %time%)
    • Mobs enter trains correctly again
    • Fixed a directional bug (switchers and destination path finding had issues with it)
    • Destroy sign source code slightly altered to make more sense (could possibly change something)
    • Fixed error on startup (rare error when fixing things up)
     
  6. will do and report back, thanks sir !
     
  7. Offline

    andrewpo

    I keep getting lots of 'ghost' minecarts in my network.

    You can walk through them and they won't move at all
    When a minecart collides with one, the minecart that collided with it stops moving BUT it doesn't "link" with the ghost one.
     
  8. Offline

    bergerkiller

    andrewpo known bug that happens when a minecart ends up stored in the chunk but not in the world. Restarting or reloading the server fixes it. (no idea who or what causes this to happen though)
     
  9. Offline

    CommanderGizmo

    bergerkiller Could you sort out the issue with logs not being seen as a burnable item in furnaces? This issue has shutdown most of my automated fuel supply system. Thanks!

    [EDIT]
    Also, I never had any phantom carts before, but now I do. They won't dissapear with a reload either. Thanks for constantly updating this with so many fixes!

    bergerkiller Ok, that phantom cart bug is driving me mad! Every time that I start the server, I have carts stopped everywhere. On at least two of the trains there will be a phantom cart that I can't get rid of. It won't respond to physics or interaction, but it will stop other carts trying to pass. If I stop the server and start it again to get rid of the phantom, two more appear. My rails are all shutdown until this is fixed.

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

    reeZZer

    Hello,
    i did get these Ghost Carts too and remembering typing "/train removeall" and then restart server fix the problem.
     
  11. Offline

    CommanderGizmo

    reeZZer Thanks, but I have far too many trains in too many places to keep redoing them on each restart.
     
  12. Offline

    Happylosertempo

    [train]switcher !passenger !!!! has problem ab 1.67 - ....
    our entire rail network down :-(
     
  13. Offline

    CommanderGizmo

    I did as reeZZer suggested just to get my tracks running again for a while. Ran command to remove all minecarts, then stopped server and started again. Then replaced all carts. Everything was running fine. Now there are reports that more phantom carts have appeared on running lines.

    Apparently they don't just happen at startup.
     
  14. Offline

    reeZZer

    Hello,
    i tested several times on the Local Server and could reprocedure how Ghost carts gets generated.
    CommanderGizmo: Are you using a Destroyer sign?

    I found out that if you spawn one or more train/carts and they get destroyed due a Destroyer Sign and the Server Crash, there will be 3-4 More Carts on next restart which one or more of them are not removeable on current Server session.
    The Procedure would be, destroy all carts / find out ghost carts (which will stay on track after break) and then reload server and they are gone.
    So i think that the Destroyer Sign just needs to save this Settings or something after Destroying otherwise the Server will recreate these Carts on track again. (That's my Theory)

    There could be a chance that other Signs will create Ghost Carts also after Server crash (maybe collector or some others which will change the Physic/Current Minecart) but i didn't tested them.

    greeTz,
    reeZZer
     
  15. Offline

    xMasterPx

    Hello
    we have some trouble to set "Defaults" on special Trains but maybe i missunderstand the wiki.
    i added 3 defaults to the "DefaultTrainProperties.yml"

    Code:
    default:
      allowLinking: true
      requirePoweredMinecart: false
      trainCollision: true
      keepChunksLoaded: false
      speedLimit: 0.4
      slowDown: true
      pushAway:
        mobs: false
        players: false
        misc: true
      ignoreStations: false
      owners: []
      tags: []
      allowPlayerEnter: true
      allowPlayerExit: true
      allowMobsEnter: true
      isPublic: true
      pickUp: false
      blockBreakTypes: []
    admin:
      allowLinking: true
      requirePoweredMinecart: false
      trainCollision: true
      keepChunksLoaded: false
      speedLimit: 0.4
      slowDown: true
      pushAway:
        mobs: false
        players: false
        misc: true
      ignoreStations: false
      owners: []
      tags: []
      allowPlayerEnter: true
      allowPlayerExit: true
      allowMobsEnter: true
      isPublic: true
      pickUp: false
      blockBreakTypes: []
    tte_u1:
      allowLinking: false
      requirePoweredMinecart: false
      trainCollision: false
      keepChunksLoaded: true
      speedLimit: 0.8
      slowDown: false
      pushAway:
        mobs: true
        players: true
        misc: true
      ignoreStations: false
      owners: []
      tags: []
      allowPlayerEnter: true
      allowPlayerExit: false
      allowMobsEnter: false
      isPublic: true
      pickUp: false
      blockBreakTypes: []
    tte_speed_1:
      allowLinking: false
      requirePoweredMinecart: false
      trainCollision: false
      keepChunksLoaded: true
      speedLimit: 0.8
      slowDown: false
      pushAway:
        mobs: true
        players: true
        misc: true
      ignoreStations: true
      owners: []
      tags: []
      allowPlayerEnter: true
      allowPlayerExit: false
      allowMobsEnter: false
      isPublic: true
      pickUp: false
      blockBreakTypes: []
    tte_speed_2:
      allowLinking: false
      requirePoweredMinecart: false
      trainCollision: false
      keepChunksLoaded: true
      speedLimit: 1.5
      slowDown: false
      pushAway:
        mobs: true
        players: true
        misc: true
      ignoreStations: true
      owners: []
      tags: []
      allowPlayerEnter: true
      allowPlayerExit: false
      allowMobsEnter: false
      isPublic: true
      pickUp: false
      blockBreakTypes: []
    Then i added a sign with:
    [train]
    property
    default
    tte_u1

    powered with redstone.
    After that i placed some minecarts manually on the track with the sign and some minecarts on a other track without the sign.
    But it isnt working correctly sometimes the carts are instant at default "tte_speed_2" some times they have the default "default" and some gain the correct default "tte_u1".

    Same on the track without the property sign.
    Some Trains are instant speed_2 some or default and so on.....
    did i miss anything or is it a bug?
     
  16. Offline

    _frozen

    About time! :D :D :D

    EDIT: How would you use an announcer sign? Theres nothing on the wiki regarding that...

    EDIT 2: So far it is:

    [train]
    announcer
    *message*
    *message*

    is there a wiki/explaination to extend the announcement via variables ala signlink?
     
  17. Offline

    CommanderGizmo

    reeZZer No, we don't use destroyer or spawner signs. The carts just seem to appear randomly.

    bergerkiller Man, the bug preventing logs from being placed as smeltable items is killing me!! Can we get an update for it?
     
  18. Offline

    bergerkiller

    _frozen will in the config.yml you can define message constants. Then, for example, you can but welcome on the sign and welcome: 'Welcome to our place!' in the config.yml. That's all there is to it. You can also use signlink variables (%var%) on the sign, which it will read as well.

    CommanderGizmo Mmh yeah the problem is kind of that logs can be both burnt and smelted. I guess it makes most sense to make it acts as smeltable instead of burnable...as logs have the same smelting 'power' as normal wood. (4 wood can be obtained from one log, so it's extremely inefficient)
     
  19. Offline

    CommanderGizmo

    bergerkiller you can leave them as a fuel item, but can you make items always default to smeltible rather than fuel? So if you have iron ore in the furnace it will use it as fuel, but otherwise it's smeltible. Either way, burning logs to get charcoal is the foundation of our whole industrial revolution, so an update asap would be awesome! Thanks for your hard work!


    Also, after some testing, it seems that the issue with the phantom carts is definitely in the code that loads carts. We have found that carts do not stay loaded when we are not there (whether moving or not). When we walk to an area it is then that carts suddenly become ghosted at random. They do this if you load the server with carts in the world as well.

    We are getting spamming null pointer exceptions on furnaces that have run out of fuel. Once fuel is manually put back into the furnace the train properly adds to it to keep the furnace going and the errors go away.
     
  20. @bergerkiller

    Hi

    We are trying to build a store system with the chests approx 3 blocks above the minecart tracks, and with the spacing between chests being very tight, when the storage cart passes a chest it puts the items in but as the chests are close together the items are not going into the correct chests, would it be possible to make it so that we can control the the height and the radius .

    Thanks

    @bergerkiller

    I am having a problem with empty train detection, if i use 'empty' it will report empty if any cart is empty, if i use '!empty' it will report empty if any cart is empty and it does not matter which cart in a train is empty, if i make sure all carts have player/item in them then it detects as not empty. We are wanting to run some trains as 'mm' or 'ms' where the 's' will pick up some items from a chest as it leaves the station if the chest has anything in it. I have tried 'switcher' and 'detector' to try and remove empty trains but if any cart in the train has a player/item in it leave the whole train intact.

    Is this possible?

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

    jinS

    ..a.. what's the TrainCartsBlocks?
     
  22. Offline

    bergerkiller

    Lexion for the second thing, you can use 'items' (or i@) to check if the train has an item in there, or even a specific item. You can also wait for a certain amount of items, though you then need to define a name of the item.

    jinS Adds block-versions of some of the sign versions to the server. Since people wanted 'action blocks' I added it, as it wasn't too hard to support it from another plugin.

    CommanderGizmo I'll check if the world.addEntity has any sort of bug that can lead to this. It is very much likely that the entity is added to the world list but not to the chunk, or the other way around, if a chunk is not loaded or something.
     
  23. bergerkiller
    The train is also classed as empty if i have 'mm' and only one cart has a player in it, if both carts are occupied the train is not empty. the 'empty' flag seems to be set if it sees any cart in a train is empty

    [edit]
    I have managed to do it now with 2 detector signs 1 for 'items' and 1 for 'passenger', my trains now only get destroyed if the whole train is empty, if it has passengers or items on board it now stays alive.
     
  24. Offline

    fbs1997

    The trains are driving into the station and most they drive in the other destination but sometimes they are standing in the station forever... What can I chance? I already made /train keepchunksloaded
     
  25. Offline

    CommanderGizmo

    bergerkiller could it be that the trains are moving faster than the chunks are loading?
     
  26. Offline

    TikGillis

    Is there a limit to how long a track can be?

    I have a train of 4 carts travelling accross a biome at 1.0 speed.
    Keep chunks loaded is True.
    The train is supposed to go to one station and return back to where it has came from. At each station the train is reversed with a redstone torch and a sign with:

    [cart]
    station
    15

    The train works fine with a passenger or even if I follow the train on creative, however if left to it's own it will stay the other station until I walk there looking for it. Then it will keep on going like nothing was ever wrong.

    Thank you for the help!
     
  27. Offline

    CzY Horse


    Your sign will need a redstone torch on left or right of sign, depending upon direction and "continue" on 4th line

    [cart]
    station
    15
    continue

    I had to get in an empty cart (part of the train) and type

    /train keepchunksloaded true

    to get train to complete a similar circuit even though the config file is set to true.

    Hope this helps
    CzY Horse

    @bergerkiller

    Still having issues with "Transferring" stuff.

    Was hoping to set a limit on the amount of item in a chest, and if the amount was lower than that set amount the Storage Cart would "top up" to that amount on next pass.

    I've tried these switcher signs

    [train]
    switcher
    redstone<128
    The train shuts switch off regardless of storage cart or chest contents when it passes over switch.

    [train]
    switcher
    i@redstone<128

    [train]
    switcher
    i@redstone 128
    These freeze up the train system as soon as the cart hits the sign. Carts/Trains do not respond to signs. Requires a server restart to fix.


    Thanks for your time
    CzY Horse

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

    TikGillis

    Thanks for the help CzY, but nothing I've tried there has any effect.

    It turns out that the train works fine when I log in at one location and will go back and forth.
    However if I travel to the other station and back then get off of the train. Then it will no longer work as intended.
    It seems a really strange bug -_-


    Illustration for clarity:
    Tracks - # one pound sign = 100 blocks
    Train -0
    Me - @

    Layout:
    __________________________________
    Station 2
    #
    #
    #
    #
    #
    @0
    Station 1
    If I spawn at station 1 I can see the train moving back and forth between stations.
    ___________________________________
    Station 2
    @0
    #
    #
    #
    #
    #
    Station 1
    However if I move to station 2. I will see the train come there as well. So far so good.
    ____________________________________
    Station 2
    @ #
    #
    #
    #
    #
    0
    Station 1
    But when the train leaves, it wont come back again. No matter which station I go to.
    It will start moving when I get in view again, however it will not come back.
    _____________________________________



    I have also tried keeping under the stations carts (with keep chunks loaded) moving on a small track just incase the station wasn't loading properly but it's no good.
     
  29. Offline

    xMasterPx

    Can anyone confirm that the train portal signs with my worlds are working?
    Teh Picture is on my Testserver. Only MyWorlds, TrainCarts and SignLink are enabled.
    testet it with BK-Common 1.18 and 1.19.
    The plugin/permission configuration is not touched.


    [​IMG]
     
  30. Offline

    bergerkiller

    TikGillis set 'keep nearby chunks loaded' to true, or the train will unload and stop moving. (see WIKI)

    I'll respond/test further in the day, got some important stuff to do first...
     
  31. Offline

    Happylosertempo

    Second post :-(

    [train]
    switcher
    !passenger
    !!!! has problem ab 1.67 - ....
    our entire rail network down :-(

    Switcher not sorted passenger,all direction
    empty cart sorted =yes
    passenger cart sorted=no

    [cart]
    destroy
    is bugi
    direction 0 left okay,right okay
    direction 1 left okay,right okay
    direction 2 left okay,right bug
    direction 3 left bugi,right okay

    sign stands next to a switch

    see you
    [​IMG]

    ???
     

Share This Page