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

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    [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]

    This post has been edited 184 times. It was last edited by bergerkiller Oct 16, 2012.
  2.  
  3. Offline

    r1rider01

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    After testing V3, the out of sync issue has gotten worse i think, trains don't stay connected, they stack on top of each other, etc...

    Ive found that when i attach a chestcart to a cart, the train takes off on its own, or will stack up with other trains...stops obeying signs.

    This post has been edited 1 time. It was last edited by r1rider01 Aug 17, 2012.
  4. Offline

    Qi Xiang

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Now its like every hour or so, my trains disappear.
    Console says: [TrainCarts] 9 carts of group "train2" are missing! (externally editted?)
    It happened to me when my server crashes only in the past.
    now, when the server is running fine, my trains keep disappearing.

    This post has been edited 1 time. It was last edited by Qi Xiang Aug 18, 2012.
  5. Offline

    Freejack

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    OK got some strange issues. Lovwe the plugin but if it won't work consistently then it does not work well.
    I have built full rails that go from one map zone to another. Only way it works is if someone is in the train. If not it randomly stops somewhere to never return. Also have shuttle that uses power rails and has a station at each end. It randomly stops on power rails and then starts again. Also tried the station 0 continue along the rail and it still randonly just stops unless you are in the train. Any ideas here? Do we need a npc onboard to make it work correctly?
  6. Offline

    SinCalChewy

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Using test version 3, and this was present in the other test versions as well, detector regions seem to set to true/on even when there are no trains or carts in the region. I have a railway system set up with sidings, so if a section of track is in use, the train waits in the siding until the other train comes by. It normally works, but upon a server restart, a lot of times some of the rail sections will always just stop the trains and wait forever for a train thats not even there. If I get out and flick the lever to off, the train will continue, and then upon riding the same rail in the reverse direction (going back to town, for example), it works and I can then ride either direction with the working siding system we have until the next restart, which normally starts it all over again with the blocking because of invisible trains. I have lanterns showing when rails are in use, and a lot of them are started ON after restarts, so it makes it easy to see if it is having a problem.
  7. Offline

    Skyve

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Is there a way to only have Switcher turn on a lever without switching the track? Not sure if "always switching track" was the default behavior in earlier versions. Using Test V3.
    Clarification: I'm trying to build a train destructor on a straight line for only the trains that do not contain a player, powering destructor through switcher.

    This post has been edited 3 times. It was last edited by Skyve Aug 18, 2012.
  8. Offline

    Lexion

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I have a detector that checks for empty carts leaving my stations, the white wool is the detector, the green wool is the station sign where the cart pauses to pick up passengers, if the detector is true then it will disable the destroy sign.

    [!train]
    detector
    passenger
    items (add this if you are wanting to check the storage carts)

    MC-CartDestroy.png

    This post has been edited 1 time. It was last edited by Lexion Aug 19, 2012.
  9. Offline

    Skyve

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Thanks, it seems this solution works.

    But I also need to know if it is possible to power the destroyer with a single switcher nowadays (should take less space and less train checking). I remember seeing such setup somewhere and it worked back then.
  10. Offline

    Lexion

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I have had a quick look at using the switcher to destroy a cart, this will destroy any train that does not have a storage cart with items in it, will need the logic changing to meet your needs

    MC-SwitcherDestroy.png

    This post has been edited 1 time. It was last edited by Lexion Aug 19, 2012.
  11. Offline

    Skyve

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Thanks a lot, that's the thing. My problem was that the server's earlier switchers didn't use the directional prefix (f in this case) as they weren't introduced at that time yet, so switchers sometimes switched the track direction in addition to turning the lever. Making all sort of derailment accidents even on a straight track.
  12. Offline

    Lexion

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Glad you asked the question, I am now in the process of changing most of my detector/destroy to switcher/destroy. Had been looking or a neater more usable solution for a while
  13. Offline

    marksc

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Hi. I am not sure if it is just me or an error but it is not loading properly. I am using CB 1.3.1 R 2.0.

    Here is what comes up from the beginning:

    Code:
    12:45 PM [INFO] [CraftBukkitUpToDate] Loading CraftBukkitUpToDate v2.9.0
    12:45 PM [INFO] [BKCommonLib] Loading BKCommonLib v1.23
    12:45 PM [INFO] [My Worlds] Loading My Worlds v1.48
    12:45 PM [INFO] [SignLink] Loading SignLink v1.24
    12:45 PM [INFO] [Pail] Loading Pail v0.8
    12:45 PM [INFO] [TrainTickets] Loading TrainTickets v1.1
    12:45 PM [INFO] [PailPlus] Loading PailPlus v0.3
    12:45 PM [INFO] [Train Carts] Loading Train Carts v1.71.2
    12:45 PM [INFO] [Train Carts Blocks] Loading Train Carts Blocks v1.03
    12:45 PM [INFO] [BKCommonLib] Enabling BKCommonLib v1.23
    12:45 PM [INFO] BKCommonLib version 1.23 enabled!
    12:45 PM [INFO] [Pail] Enabling Pail v0.8
    12:45 PM [INFO] Preparing level "world"
    12:45 PM [INFO] Preparing start region for level 0 (Seed: -3443517573418734678)
    12:45 PM [INFO] Preparing spawn area: 65%
    12:45 PM [INFO] Preparing start region for level 1 (Seed: -3443517573418734678)
    12:45 PM [INFO] Preparing spawn area: 52%
    12:45 PM [INFO] Preparing start region for level 2 (Seed: -3443517573418734678)
    12:45 PM [INFO] Preparing spawn area: 52%
    12:45 PM [INFO] [CraftBukkitUpToDate] Enabling CraftBukkitUpToDate v2.9.0
    12:45 PM [INFO] CraftBukkitUpToDate version 2.9.0 is enabled!
    12:45 PM [INFO] [My Worlds] Enabling My Worlds v1.48
    12:45 PM [INFO] [My Worlds] Using build-in 'Bukkit SuperPerms' as permissions plugin!
    12:45 PM [INFO] [My Worlds] Successfully bound variable to region file cache.
    12:45 PM [INFO] [My Worlds] File references to unloaded worlds will be cleared!
    12:45 PM [INFO] My Worlds version 1.48 enabled!
    12:45 PM [INFO] [SignLink] Enabling SignLink v1.24
    12:45 PM [INFO] [SignLink] Using build-in 'Bukkit SuperPerms' as permissions plugin!
    12:45 PM [INFO] SignLink version 1.24 enabled!
    12:45 PM [INFO] [TrainTickets] Enabling TrainTickets v1.1
    12:45 PM [INFO] TrainTickets v1.1: Vault economy not found, switching to gold ingots!
    12:45 PM [INFO] TrainTickets v1.1 has finished loading the config file.
    12:45 PM [INFO] TrainTickets v1.1 by Cobalt loaded all events
    12:45 PM [INFO] [PailPlus] Enabling PailPlus v0.3
    12:45 PM [INFO] [Train Carts] Enabling Train Carts v1.71.2
    12:45 PM [INFO] CButD: CraftBukkit is up to Date
    12:45 PM [SEVERE] java.lang.Exception: Field 'a' does not exist in class file 'EntityTracker'!
    12:45 PM [SEVERE] at com.bergerkiller.bukkit.common.SafeField.<init>(SafeField.java:25)
    12:45 PM [SEVERE] at com.bergerkiller.bukkit.tc.controller.MinecartMemberTrackerEntry.initFields(MinecartMemberTrackerEntry.java:27)
    12:45 PM [SEVERE] at com.bergerkiller.bukkit.tc.TrainCarts.enable(TrainCarts.java:325)
    12:45 PM [SEVERE] at com.bergerkiller.bukkit.common.PluginBase.onEnable(PluginBase.java:179)
    12:45 PM [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
    12:45 PM [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:365)
    12:45 PM [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
    12:45 PM [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:265)
    12:45 PM [SEVERE] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:247)
    12:45 PM [SEVERE] at net.minecraft.server.MinecraftServer.i(MinecraftServer.java:296)
    12:45 PM [SEVERE] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:275)
    12:45 PM [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:225)
    12:45 PM [SEVERE] at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:140)
    12:45 PM [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:378)
    12:45 PM [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
    12:45 PM [WARNING] [Train Carts] Failed to initialize the entity tracker replacement:
    12:45 PM [WARNING] [Train Carts] Train movement will not be smoothed!
    12:45 PM [INFO] [Train Carts] Loading chunks near trains...
    12:45 PM [INFO] [Train Carts] 0 detector rail regions loaded covering 0 blocks
    12:45 PM [INFO] [Train Carts] MyWorlds detected, support for portal sign train teleportation added!
    12:45 PM [INFO] [Train Carts] SignLink detected, support for arrival signs added!
    12:45 PM [INFO] Train Carts version 1.71.2 enabled!
    12:45 PM [INFO] [Train Carts Blocks] Enabling Train Carts Blocks v1.03
    12:45 PM [INFO] Train Carts Blocks version 1.03 enabled!
    12:45 PM [INFO] Server permissions file permissions.yml is empty, ignoring it
    12:45 PM [INFO] Done (4.704s)! For help, type "help" or "?"
    12:45 PM [WARNING] Task of 'Train Carts' generated an exception
    One of the things I can't do is link minecarts. I don't know about other things as I didn't try them yet.

    This post has been edited 1 time. It was last edited by marksc Aug 21, 2012.
  14. Offline

    bergerkiller

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @marksc yeah, I am waiting for the next RB. That one has a lot of other changes as well, which require me to update all of my plugins. To prevent a lot of temporary versions being used, I don't support R 2.0. (Unless they really take long to update...)
  15. Offline

    r1rider01

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I'm still running 1.3.1 R1.o with Test version 3

    i'm having the weirdest things still...the # feature for naming doesn't work, they all still name themselves train1...so i get 3 or 4 trains all the same name!

    also when using the [train train1] property destination station2

    if i only have one train it will send the train off correctly, if i have multiple trains it won't take the destination property anymore.

    Hopefully can get fixed soon
  16. Offline

    CommanderGizmo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It's been my experience that the carts just stopping with a cart that can't be interacted with except for getting in and out is caused by a phantom cart. These seem to happen when a chunk is loaded with a minecart in it such as when a player enters the area or when the server first loads/reloads. This issue is still occurring as of 1.71.2.

    I'm afraid I must express my frustration at a few of these bugs still being around. The issue with logs not being used in a furnace, for example. I have posted exactly what lines of code to change and how as an example of how to fix the simple issue and opened a ticket for it, yet it remains.

    I still can't use vast minecart systems because the carts simply don't load properly. Any item in the cart has it's data value reset to zero while many carts stop moving and/or become phantoms. It's just not worth trying to maintain them all with these bugs.

    Is there any chance I'm just not up to date with the fixes? Will there be an updated to fix theses issues anytime soon? The players on my server are asking me to find a better train mod, but I like the features offered in this one if it just worked.
  17. Offline

    bergerkiller

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @CommanderGizmo Well you see, most of those bugs are almost impossible to track back in the code, though I think I forgot to look at the log problem. The data wipe (?) seems to be related to item transferring in BKCommonLib, and seems to re-occur every single time. It is slightly annoying.

    I thought I fixed that damn ghost cart problem in 1.71.2 already, I especially spent 2 days debugging everything to prevent it all. It's an annoyance for me too.

    EDIT

    I see no data wiping going on, so not sure what you mean here? Placed all 4 types of logs in a storage minecart, stopped the server and started again. All 4 types still in there...

    I'll make sure that items that are both fuel and burnable are parsed differently.
    • item only fuel? Use as fuel
    • item only burnable? Use as burnable
    • item both fuel and burnable? If defined line 3, burnable, line 4, fuel.
    EDIT

    Ok that issue is fixed then. Together with the disturbing lack of item animations.

    This post has been edited 3 times. It was last edited by bergerkiller Aug 27, 2012.
  18. Offline

    CommanderGizmo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @bergerkiller Wooooo!! It's really fixed?! That was fast! My apologies for my tone earlier. I loath spending hours resetting trains instead of using them, and had finally had enough.

    My server log shows I am running 1.71.3. Is that a test build? Can I download the update with the fuel fix? My whole industrial revolution depends on automated fuel production.


    The issue with the data wiping is most noticeable with dyes. Perhaps it only happens to certain items? If I put, for example, bonemeal or lapis into a cart and reload it turns into ink_sack. If I have charcoal in a cart, it turns to coal. Leaves also drop to 0. Normally they have 12 added to the data value of their type due to the counter (so oak leaves have a value of 12 when in your inventory).

    The phantom carts definitely seems to happen when loading a cart. I just had it happen 12 times last night. I finally set the default properties to keep chunks loaded and picked up all carts and placed them again. The phantoms occur at server load/reload or when a chunk is loaded from a player walking by.

    EDIT

    Also, the carts do not maintain speed when a chunk is loaded or on load/reload.

    This post has been edited 1 time. It was last edited by CommanderGizmo Aug 27, 2012.
  19. Offline

    bergerkiller

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @CommanderGizmo it's not the latest, that is for sure. I'll link you to the 1.71.5 test build I uploaded to dropbox:
    https://dl.dropbox.com/u/3681706/TrainCarts v1.71.5.zip

    Check if the ghost cart problem and the data issue still exist. Don't forget that:
    • This build requires CraftBukkit 1.3.2 R0.1
    • It needs the BKCommonLib included in the Download (don't forget to update)
    I'm off now, I'll continue the good ol' ghost train testing tomorrow on my prepared test world. Hope I do get the server wrapper running on-time...
  20. Offline

    CommanderGizmo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @bergerkiller Thanks! I can finally smelt logs using my trains.

    However, the train appears to have put a full stack of logs in the furnace to be burnt when my sign reads "8 log;coal". Perhaps it is not seeing the number?

    Also, golden_apples still do not get picked up using transfer signs.
  21. Offline

    bergerkiller

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @CommanderGizmo
    I'll have to check the transfer logic then. The golden apples problem could be related to the name -> material function in BKCommonLib. Do they get picked up when using an empty line? (which represents all items)

    I made the fuel times in BKCommonLib use the function of Minecraft itself (on all materials), to make sure possible fuel changes are automatically supported. I'll test further on the things you mentioned.
  22. Offline

    Qi Xiang

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Now... the console keeps saying that the entity "minecart" is at an invalid position... The carts did not link properly together,
  23. Offline

    CommanderGizmo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @bergerkiller So far I have not had any phantom carts appear, even when reloading the config or the server. I think it might really be fixed! I'll keep testing. Random intermittent issues are the worst, eh? Thanks for keeping after it for free when most coders would run away and hide.
  24. Offline

    bergerkiller

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @CommanderGizmo Maintaining it is a lot easier than it was a few months ago. I deobfuscated all minecart related logic, so when Minecraft decided to 'screw me over' again, it won't be as bad. Only the move function, which I override to disable certain collisions, is a constant annoyance right now.

    Thanks for testing it btw, I don't have time to test TrainCarts non-stop and check every single feature after every new version, I have to rely on incoming bug reports to fix problems. (mainly because 40% of the train physics is done inside Minecraft itself...)
  25. Offline

    SinCalChewy

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I'm running the 1.71.5 test build posted above, and so far after riding all my rails to test them a bunch (my rail system has a ton of detector-powered sidings for multi-train stuff so they don't crash), the problem with my detector sections always being "on" and therefore always stopping trains forever that I posted above seems to be gone. I'mma test it a bit more, but so far so good. Thanks! :D

    EDIT:
    Well I lied, it's doing it again (Detecting as if something is in that region, when it's not). Is this something I'm doing then? Because it only happens between certain regions, most of them work fine all the time... can the only be so big or not have a certain track path or something? lol

    This post has been edited 2 times. It was last edited by SinCalChewy Aug 29, 2012.
  26. Offline

    CommanderGizmo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    So far, so good! I haven't had any more phantom carts, crashed trains, or stuck carts since I updated to 1.71.5!

    One more question for now:
    I have trains running next to my crops, but none of them seem to grow while I'm gone. I have the default properties of all trains set to KeepChunksLoaded=true, and have confirmed so with the /train info. They are moving, but the KeepChunksLoadedOnlyWhileMoving is set to false anyway. Is there anything in bukkit or MC that requires a player to be present to grow the crops, or is it possible the chunks aren't really staying loaded?
  27. Offline

    bergerkiller

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @CommanderGizmo When the train leaves the area, the chunks will unload. Unless you place a minecart underground or something the chunks will not stay loaded. Crops grow using a lot of randomness, so the chunk needs to be loaded for a fairly long time for them to grow.

    @SinCalChewy It does use complicated logic to reduce the amount of checks on trains. For example, when the detector is on, it only handles trains leaving that match the detector. When the detector is off, it will only handle new trains that match the detector. There is always a possibility that the detector-off logic is malfunctioning, or that a train disappears from the region without it being removed. I'll have to test that once more to verify, because this same issue has happened before...

    And then it is also possible there is a ghost cart on the rails, keeping the detector on.

    This post has been edited 1 time. It was last edited by bergerkiller Aug 29, 2012.
  28. Offline

    CommanderGizmo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @bergerkiller Yes, the carts run directly under the crops. From what I can tell in the source, it looks like it keeps a 5x5 area of chunks loaded with the cart in the center. Having a cart sitting parked or circling under the crops ought to work, correct? Is it possible the chunks is getting unloaded and reloaded rather than staying loaded? Perhaps that might reset the growth timers.
  29. Offline

    bergerkiller

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @CommanderGizmo CraftBukkit unloads chunks every tick, so as soon as the minecart leaves a chunk, the 5-width chunk block gets unloaded, and another 5-width chunk block loads again. Having a minecart circle between chunks is not a good idea, as chunks would unload a lot then. (it's CraftBukkits' fault for not handling chunk unloads better...)
  30. Offline

    CommanderGizmo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Is there no way to cancel a chunk unload? I normally leave one just sitting. If that is the case the chunks should stay loaded? Does your code load the chunk every tick?
  31. Offline

    bergerkiller

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @CommanderGizmo
    TrainCarts does the most efficient methods (others can't do this, because they have to use a slower HashMap all the time, I can store it in the Minecart itself)
    • Every time the minecart moves (postmove) it checks if it crossed a chunk border
    • If it did, it loads all the unloaded chunks within range. This happens every 40 ticks when moving at 0.4 b/tick)
    • If a Chunk Unload event is fired, it checks all the minecarts that occupy this chunk (within 2 chunk range)
    • If there are no minecarts that keep the chunk loaded, the event is allowed
    • In the next handler it despawns all minecarts that occupy that chunk
    I *tried* to implement a chunk unload delay system (chunk persistence) in NoLagg, but ironically, it lags like crazy. In the end it takes more time to look up the chunk in the map to check if it can unload than you gain from possible useless unloads. The same would happen if I keep chunks loaded longer after a minecart leaves chunks.

    If you want to keep a chunk loaded 'all the time', I think you can do this quite easily. All you have to do is have a simple set of chunk coordinates to keep loaded. Try to optimize it all away and perhaps you can get it working. In short: The Minecraft/CraftBukkit devs caused the chunk unload event to be spammed, resulting in causing a lot of lag when you try to keep chunks loaded.
  32. Offline

    SinCalChewy

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Yeah, it seemed to work for awhile with 1.71.5, but then started doing it again. The railway more often works going one way more than the other, was well. Whats kinda weird, is I have lights that come on at the sidings when the rail section is in use, and when it's working they turn off as I leave the rail section for the most part, but then if I ride the rail back that way, they're on for some reason even after seeing them turn off when leaving the section of rail and my train is stopped at the siding because the track is "in use". But once they're stuck on, they stay on most times until I manually flip the lever. Then they will work for a few more minutes, and then stop again most times.

    As for CommanderGizmo asking if wheat will grow, I have set up a few "always grow" wheat farms that grow the wheat all the time. I just made a grid of rails directly under some dirt, and then used a timed spawn sign to spawn a cart every 3 seconds at .1 speed and then at the end of the grid rail a cart destroy, and at least what it seems, they're spawned close enough to keep the area always loaded if you set up the railing right. I have a large wheat farm that I can farm lots of wheat from because it always grows it because of the train system under it. I also do this in the nether with nether wart, with a quite large farm as well.

    This post has been edited 3 times. It was last edited by SinCalChewy Aug 29, 2012.

Share This Page