Inactive [ADMIN/FIX] ForeverALoad v1.1 - Keep your chunks forever a loaded [1.2.3-R0.1]

Discussion in 'Inactive/Unsupported Plugins' started by Piedo_bear, Jul 29, 2011.

  1. Offline

    Piedo_bear

    ForeverALoad - Keep your chunks forever a loaded
    Version: v1.1
    Download
    [​IMG]

    This plugin enables you to select individual chunks or entire areas and stop them from unloading. You can add, remove and check chunks, and also get information on how this may impact on your server.

    You use this, obviously, to keep chunks unloaded. This is useful for long redstone constructions, so the connection continues. Crops wont grow - see side note below.

    Side-note:
    Crops wont grow in loaded chunks, this is one thing I noticed with my testing. However, redstone charges DO carry over very long distances (it will be greater than the view-distance specified in the server.properties) but you need to make sure those chunks load first. This plugin stops chunks unloading, if you are in doubt use the logging mode and get the confirmation, I cancel the event of unloading quite accurately so if things aren't working it could be Bukkit, in-game mechanics or something else interfering - if not then its me XD

    Features:
    • Allow/Stop chunks from unloading
    • Check if a chunk can unload
    • Stats on how it may impact your server
    • Supports in-game adding or config based areas
    • Supports Permissions 3.x and SuperPerms (otherwise defaults to op)
    • Optionally load chunks into memory from the start
    Future features:

    • Suggestions?
    Configuration file:

    Code:
    Debug - tells you in console each time a chunk is prevented from unloading, or any errors encountered. Also tells you the percentage of loading rectangles on startup
    Rectangles - Used to stop areas unloading
        Use - If rectangles in config are being used to stop chunks unloading
        Quantity - Number of rectangles in use
        LoadFromStart - Loads defined rectangles from the start, if they are active
     
    Format of rectangles:
    rectangle0:
      world: world - world of the chunks
      points: -50,-50,50,50 - coords in the form of (x1,z1  x2,xz)
    
    Commands:
    (Note: will need ForeverALoad.usage in permissions or must have op status)

    Show Spoiler
    /chunk - Tells you how many chunks you will have (at a maximum) remaining from unloading, and give stats about it

    /chunk add - Adds the chunk you're on to the Do-Not-Unload list

    /chunk remove - Removes the chunk from the list

    /chunk check - Checks whether the chunk can unload

    /chunk addRect - After you have defined two blocks with a bone(ID: 352) by left and right clicking this will add the rectangle of chunks to your config file for you. You must have Use rectangles set as true in the config.


    Instalation:
    Show Spoiler

    1. Place ForeverALoad.jar into your plugins directory and start the server to generate the config.yml
    2. Go to the folder plugins/ForeverALoad and edit the config.yml to your needs (see above for an explanation) The config generates weird, be aware of putting the co-ord information in the right places!
    3. Restart the server for the new configuration to take effect!
    4. Go add chunks and enjoy!



    Changelog:
    Show Spoiler

    Version 1.1
    • Updated config handling - BREAKS YOUR CONFIG - so you will need to regeneate and edit, sorry. You can probably copy, paste,edit for your rectangles though.
    • Added the option to load chunks from the start
    Version 1.02
    • Fixed a sneaky typo
    • Hopefully corrected a calculation for area.
    Version 1.01

    • Updated to RB 1337
    • Added specific support for PermissionsEx
    • Fixed a null pointer with items
    Version 1.0

    • Updated to RB 1317
    • Changed config for Bukkits new API - requires a newly generated config
    • Completely recoded and organised to be prettier
    • Debug mode should help narrow down issues better now
    Version 0.5

    • Removed auto-protect of chests/furnaces since wiping bug is fixed
    • Ditched over-complicated part of protecting specific blocks
    • Added /chunk addRect to add rectangles ingame, using a bone as the selection tool.
    • Updated config NOTE: no longer uses ' around numbers so change '50' to just 50
    • Added support for SuperPerms
    • Updated to 1240 at last :p
    Version 0.4

    • Fixed an issue where /permissions would list chunk data, my bad
    • Added an option to load chunks straight into memory from the start. WARNING: this may take a while depending on the amount of chunks, it will load, and if the chunk does not exist it will be generated, but this might end up without flowers etc. So just use this for areas that already exist, or use a pre-rendering plugin/program first.
    • Updated the calculation of ram being used, to match experimental data opposed to theoretical
    Version 0.3

    • /chunk check now includes rectangles
    • /chunk [add/remove/check] will also tell you the coordinates of that chunk
    • AutoChestProtect now includes furnaces
    Version 0.2

    • Added auto chest protection option in configuration, stop all chests being unloaded.
    Version 0.1

    • Initial release


    Please post bugs, suggestions or anything related here and I will get looking :)

    Also, please include as much detail as possible, CraftBukkit build, stack traces, other conditions that may cause things.
    NOTE: Requires Vault installed
     
    Lancezh likes this.
  2. Offline

    _Robert

    Hey there! One question: In my server the chest/sign wiping bug, ocurrs when i restart the server complety (shutting it down, and then starting it again, nor with the /reload command). As far i can see your plugin works to prevent this only when the server it's running, or it will help me too?
     
  3. Offline

    Zalastri

    Can you have it automatically never unload chunks that it finds pistons in? That'd be super handy.
     
    TzeTzeTze1 likes this.
  4. Offline

    DamienMine

    This would be an interesting question.

    However, if this plugin works fine even though it adds to the server load it may be a fix for all the plagued hosters and players out there. As I've not encountered the bug yet, I'll only try when it occurs to me.
     
  5. Offline

    Piedo_bear

    I've not had the opportunity to test this, since I've never had that issue. All I can suggest is that you give it a try, but if it happens on shutting down it may still occur. My thoughts behind this is that the chunks will still be unloaded because of course the server is shutting down so there is no need for them, but they will also be saved...which may save the data contained all.

    This is possible however it would be more cpu-intensive because instead of just checking the location of the chunk it would be checking 32768 blocks, which is a considerable amount more. Alternatively, there is a much easier way...just came to mind. If a piston is placed or destroyed in a chunk it will auto be added/removed respectively. This would be much more efficient, but existing pistons would not be covered.

    I may look into this, since you could have a list of block ids, such as chests which would be auto-unloadable.
     
  6. Offline

    _Robert

    I tried it, it dosen't work to fix bugged chunks :(, but at least it can be usefull to prevent buggy chunks in public zones. A few recomendations, the message when you use /chunk check it'll be more usefull if you add the chunk id, for i.e.: "The chunk <chunk id> CAN be unloaded", and when you type /chunk a list of the other commands will b nice :).

    Also, i have a request, since you were talking about check blocks and scan them for one type of block i think you can be able to do something to avoid the chest/sign wiping bug. I allready posted this idea, i don't know if it's factible to make it since i don't have any experience making plugins, but well, it dosen't harm saying it anyway.

    I think that the buggy chunks problem, it can be momently fixed/patched/whatever saving all the chests and signs contents on the shutdown of the server to a file and restoring them (if neccesary, it only will check those ones that are empty) on the startup (the problem might be that the plugin must before all the others to avoid conflicts). Maybye the chunks can be flagged with a command (like your plugin does) instead scanning all of them, so it will be much faster. I don't know if it's possible, but well, this bug it's frustrating me :(
     
  7. Offline

    Zalastri

    Could you perhaps have it load the entire world on start, slowly, in a time sliced manner so disk users could simulate a RAMDISK environment without having to actually set up a tempfs disk?
     
  8. Offline

    codename_B

    Not really - chunk.getTileEntities() - you don't need to check for pistons BLOCKS just piston TileEntities
     
  9. Offline

    Piedo_bear

    I tried this but It doesn't pick up pistons. It shows up for chests which I will add a configuration to auto-protect chests though.

    For the entities I get the array per chunk, then loop through and print out whats there upon unloading. The most common to show up is mobspawners, despite littering pistons around. Any suggestions? If not I can include a block list to check for breaking/placing pistons, if only as a workaround.
     
  10. Offline

    LlmDl

    A couple questions:

    I have a world that has approximately 14848 chunks, how intensive would this be if everything was loaded.

    You mention a chest option, is there a similar thing for furnaces and signs? If there was could I use this plugin to keep only chunks with signs, furnaces and chests loaded?
     
  11. Offline

    Piedo_bear

    I'd estimate that to keep all those chunks loaded it would take around 1gb of ram.

    Also, I will be working on something which will automatically make that chunk unloadable if a specified block is placed. Furnaces should be easy, signs, I will test, and other blocks I will specifically code something for them. Should be in version 0.3 I just need a bit of spare time :)

    I do want to clarify that I can't promise this to solve the bug however it will reliably stop the selected chunks from unloading, which is related to the bug as far as anyone is aware.
     
  12. Offline

    LlmDl

    Thank you very much.
     
  13. Offline

    Piedo_bear

    The coords are for chunks. But the conversion is simple, just do blocks/16, then round it DOWN to the nearest whole number.
     
  14. Offline

    Ratchet

    does AutoChestProtect: 'true' stop all chunks that chests are in from being unloaded or just the chest blocks themselves?
     
  15. Offline

    Piedo_bear

    When a chunk unloads it checks to see if a chest is on that chunk, if so that chunk is prevented from unloading.

    As an update:
    I am 75% through coding custom protection. This means you give a list of block ids, if those blocks are placed, that chunk will not unload, if all types of that block is removed it can unload again. It wont be perfect, since it tracks placed/broken blocks instead of checking the entire chunk - however at least it is more efficient. This means you can, for example, have pistons placed and they will not be unloaded until destroyed again. Current blocks would not be counted though.

    Should be out in 1-2 days if things go well in regards to my coding and time XD
     
  16. Offline

    yottabyte

    Best plugin name I've seen in a long time. That's all.
     
  17. Offline

    moose517

    would it be possible to load the entire world? RAM is not an issue, if i could keep the entire world loaded taht would be epic.
     
  18. Offline

    Piedo_bear

    Currently /chunk check doesn't consider rectangles. Its most likely being stopped from unloading, since it seems fine - Logging mode will reassuringly tell you its stopping chunks unloading. I'll try update this soon though :)

    Its a little out of scope from what I've intended. I simply want to stop specific chunks from unloading once they're already loaded. Loading everything though can be more problematic. So, sadly, it will most likely not be included with this plugin, sorry.
     
  19. Offline

    Piedo_bear

    Delayed because I have to fix other things on my server first, sorry.
     
  20. Offline

    MonsieurApple

    Approved!
     
  21. Offline

    o0AzzA0o

    Seems to conflict with /permissions command it shows me chunk info when i type /permissions now :p lucky shorcut for permissions still works....

    another question is .... do auto chest chunks show up in /chunk ? or is it same situation as rectangles?
     
  22. Offline

    Piedo_bear

    Hmm I'll look into the /permissions thing, but it shouldn't be doing that!

    Auto protected chests/furnaces dont show up in /chunk. I could make it keep track, might not be 100% accurate though
    Oh, and rectangles should show up in /chunk check etc, so that shouldn't be an issue :p
     
  23. Offline

    Feed_Dante

    Any easy way to keep all chunks loaded without having to reconfigure the plugin when new ones are generated?

    Essentially to disable unloading until the server shuts down, and load everything back up when it starts.
     
  24. Offline

    Piedo_bear

    Added an option to pre-load rectangle chunks into memory from as soon as the plugin starts. Is that what you meant?
     
  25. Offline

    Ratchet

    FYI for anyone interested, this seems to work flawlessly for stopping the chest wiping bug. haven't had a chests contents get wiped since installing it, so it is definitely related to chunks unloading.
     
  26. Offline

    Piedo_bear

    Glad to know it helps! :)

    Kinda ditching the idea to keep custom blocks loaded, would probably need a database and its not very efficient if something was to go wrong.
     
  27. Offline

    xJoshJx

    Umm, is this safe? :oops:

    [​IMG]
     
  28. Offline

    cybernetamd

    I want 1.5 Terebytes of ram :).
     
  29. Offline

    xJoshJx

    lmfao :D ya jelly bro?
     
  30. Offline

    Piedo_bear

    If you set a rectangle that big then it will keep as many chunks loaded as your ram will allow lol. Once you hit your max ram you will be throttled, its just an estimate of how much would be used if all those chunks were made to stay loaded. :p

    I wish I had 1.5tb of ram :eek:
     

Share This Page