[MECH] EverCart v1.0 - Storage Minecarts Load Chunks [740]

Discussion in 'Inactive/Unsupported Plugins' started by Valrix, Apr 5, 2011.

  1. Offline

    Valrix

    EverCart - The Storage Minecart Chunk Loader:
    Version: v1.0

    EverCart is a plugin thought up by @amd3th that keeps the chunks around Storage Minecarts loaded while it moves to you can transport goods distances that are usually too far away and would cause the cart to stop moving due to it going into a chunk too far from any player.

    Features:
    • Dynamically loads and unloads chunks within a short range as it moves
    PLANNED UPDATES (open)
    • Improved chunk loading and unloading to increase performance
    • Config options to enable logging of chunk loading and unloading
    • Config options to track different kinds of minecarts besides just the Storage Minecart


    Download EverCart

    Source Code: EverCart

    Changelog:
    Version 1.0
    • Release of EverCart
     
    Rytharr likes this.
  2. Offline

    Joeyy

    This is extremely useful on big minecart stations etc!
    Great solution
     
  3. Offline

    CyborgOne

    great Idea!
    I'll try this

    thx for your work
     
  4. Offline

    Iqualfragile

    could you replace
    Code:
    if (v instanceof StorageMinecart)
    by
    Code:
    if (v instanceof StorageMinecart||v instanceof Minecart||PoweredMinecart)
    (if it is called powered minecart, i am not shure about it)
    or, at least give the oportunity to enable them in a config file (not ervery admin is javageek)
     
  5. Offline

    Valrix

    Sure, I'll create a config with each kind of cart being a true/false so all kinds can be tracked. I'll do that today. A warning though, if the carts are close together, unless the server manages chunk loading better than I think it does, this may cause a few problems since I still don't have the code worked out to be efficient as I'd like. Until then, be warned that it may cause a lot of lag and stress to the server.
     
  6. Offline

    Afforess

    I should warn you - your current implementation does not protect the chunk the cart is currently in. If a chunk unload request is called for the chunk the minecart is occupying, your plugin will do nothing to stop it, and the minecart will be unloaded. I've also noticed from test cases that a range of 2 is not sufficient. Minecarts will still outrun the chunks around it in most cases.

    If you figure out any improvements in this area, I'd be interested in hearing them.
     
  7. Offline

    Valrix

    Yeah, it still has a lot to be improved upon and I think I'll have to up the range to at least 3 around it. I've been wanting it to instead watch for change of direction so it'll only load the chunks it needs to to the front and sides instead of all around it, but the chunks being all around it helps when loading future chunks.

    I did a small patch to the JAR that increases the chunk loading range so if you've been having your carts stop, this SHOULD fix the problem at least for the most part until I can improve how the chunks are managed.

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

    ibizaman

    Hi, very interesting plugin !

    Improvement idea: It would be great if the users could make arbitrary/square/rectangle patterns on the ground to let those chunks always loaded.
    I am thinking at the crops : it would be great if the chunks where crops are stay loaded !
    Also for the chunks where there are redstone, water flows and things like that :)
     
    Dyllon likes this.
  9. Offline

    Valrix

    I think I'll make another plugin where you'll use a command to add the chunk you're standing in to stay loaded and even when the server starts up again it'll run through that list and load each of the chunks you want to always be loaded. Only bad thing is that can eventually cause a lot of extra stress since they're always loaded, but that's the trade off I suppose.
     
  10. Offline

    FrostyWolf

    Does this work nicely with Minecart Mania?
     
  11. Offline

    Valrix

    I would think so. Nobody has said otherwise so far and it uses similar code, so I wouldn't think there would be any problems.
     
  12. Offline

    orangegreenblue

    could you possibly make a plugin make wheat load the chunk it is in so you can let stuff grow without being in the chunk?
     
  13. Offline

    Valrix

    I will keep that in mind. Previously I've had someone ask if I could make a plugin that you'd stand in a chunk and use a command to force it to stay loaded and when the server restarts, etc. then it will stay loaded so crops will always be growing. The main issue is finding a way to show the player the bounds of the chunk so they'll know if their crops are in multiple chunks and will have to keep a few loaded. Once I figure out a "nice" way to do this then I will make that plugin. Please follow me or keep an eye out for when I do happen to release that.
     
  14. Offline

    Shinobi

    Doesn't minecart mania do this, when you set:
    "<KeepMinecartsLoaded>true</KeepMinecartsLoaded>"
    In the config?
     
  15. Offline

    Valrix

    Yes, but this is meant to be a light-weight version of only that functionality and will handle chunk loading and unloading differently. Once I can find a good method that works I'll probably be sharing it with Afforess so he can implement it into Minecart Mania. Most of my plugins seem to be things that other, larger plugins can do, but I'm more in favor of small, fast plugins that don't take many resources and are easy to use. Nobody has complained thus far and I always keep my source open for other developers to use as they see fit. I'm in this purely for the community :)
     
  16. Offline

    Afforess

    Yes.

    Edit: Ninja'd
     
  17. Offline

    Valrix

    Haha :p
     
  18. Offline

    Shinobi

    Never meant to sound rude, just asking. I've wanted to have my stuff churning about even when noone is logged in.. Gonna try this, MCM has issues.. :p
     
  19. Offline

    Valrix

    I didn't take it as you being rude, sorry if I made it sound that way. Looking back I notice I may have sounded a bit..brisk. I hope it works well for you, it still has a ways to go.
     
  20. Offline

    TheInventor

    Thank you. Now I can operate my redstone minesweeper without needing someone else. :p
     
  21. Offline

    AgentME

    I've tweaked a few lines so that this plugin will remove chunks from the correct world as needed, and submitted a Pull Request with the new code on github, because the Nethrar plugin currently supports players travelling in minecarts throught Nether portals (and ideally will support unoccupied carts going through eventually).

    ...though I just now checked the Nethrar code and it turns out it destroys the first minecart and makes a new minecart for the player on the other side of the portal, so there's no immediate benefit now really. Guess it does prep the EverCart plugin for any other future plugins that move the cart between worlds (assuming that's even possible; I'm not too familiar with Bukkit, but I guess it's feasible anyway in the future and this makes the EverCart code a bit more correct).
     
  22. Offline

    akrieger

    It's not actually possible to "transport" a minecart from one world to another. It's not even possible to do this with Players - although the entity interface specifies a "teleport" function, it's implementation involves creating a new generic Player in the other world, having it inherit all the characteristics of the old one, and removing the old one. This dance has to happen with everything it seems.
     
  23. Offline

    Dominic

    Hey akrieger! This works great but it seems the carts go invisble after travelling out of the render distance of the players. Is there a way to fix this? Or are we out of luck?
     
  24. Offline

    Valrix

    It shouldn't be doing that...but I'm a bit busy with other plugins and haven't had a chance to work on this.
     
  25. Offline

    Dominic

    That's fine man. I was just wonderin!
     
  26. Offline

    Afforess

    I've had the oppertunity to look at chunk loading in detail the past few days, in a (successful) attempt to get chunk loading around minecarts work for MM. Long story short, unloadChunkRequest will never, ever unload any chunks, and basically that means this plugin leaks memory, causing it to load chunks but never unload them.

    I think I got it working for MM, take a look at the ChunkManager class. It was a PITA to get to work right.
     
  27. Offline

    Valrix

    No wonder it was just causing a bunch of lag, thanks for the heads up and I'll check out your code. Hopefully they'll fix that bug that way we don't have to do as many checks to see if the chunk can be safely unloaded.
     
  28. Offline

    Drei Gyuu

    I hope this gets fixed and working right. It would really be nice to send convoy of carts from point A to point B
     
  29. Offline

    Valrix

    Yeah, I've been a bit too busy lately, but once I get a chance then I'll be fixing it up to work right and manage the data better so it won't lag the server so bad.
     
  30. Offline

    Plague

    if you really (but really really) need to use more versions of CB use a version range, enumerating them is a mess.
     

Share This Page