[INACTIVE]Bedrock Gap Insurance + Flat Earth v2.0 (Updated 1/20/11)

Discussion in 'Inactive/Unsupported Plugins' started by msleeper, Jan 20, 2011.

  1. Offline

    msleeper

    Bedrock Gap Insurance + Flat Earth v2.0

    Old favorite from hMod returns! This is a must-have for servers running worlds from very old verions of Minecraft (pre-Halloween 2010 update), and a best seller for server admins who love a smooth bottom. (that's what she said)

    This is a very simple plugin that exists to help with world consistency and has two features - Bedrock Gap Insurance and Flat Earth.

    Bedrock Gap Insurance automagically replaces every non-bedrock block at the very bottom of the world with bedrock. This will eliminate "gaps" in the world in which players can fall through. This feature is primarily useful for servers running on very old world versions, specifically before this was fixed in the game core around the Halloween 2010 update. Maps that has been newly generated since then can safely leave this feature disabled.

    Flat Earth automagically converts all non-bottom layers of bedrock into smooth stone. This will effectively make the upper 4 layers of bedrock now breakable, giving you an extra 4 layers in your world to build in. Note that this ONLY affects the 4 layers above the bottom layer; anything that may be built with bedrock that is not in this area will be unaffected.

    For both features, the plugin checks all of the 0th to 4th level blocks in world chunks as they are loaded by the server. This is a huge performance improvement over the old version for hMod, which checked a small area around every player as they moved around

    Major thanks to flames for helping with the porting from hMod to Bukkit!

    Download link: msleeper.com

    [​IMG]

    Code:
    Version History
    -- 2.0 (1/20/11)
    . Initial release for Bukkit! Thanks to flames for help with hMod port.
     
  2. Offline

    Redecouverte

    nice one!

    could you make a setting to change smooth stone to something else?
    that way we could set it to replace the bedrock with lapis lazuli (for old maps generated without it)

    that would rock :D
     
  3. Offline

    Raphfrk

    Was having a look at your code

    Code:
                  for ( int x = chunk.getX() * 16; x < (chunk.getX() + 1) * 16; x++ ) {
                            for ( int y = chunk.getX() * 16; y < (chunk.getX() + 1) * 16; y++ ) {
    
    Shouldn't the 2nd for loop using chunk.getZ() ?

    In fact, it shouldn't work at all given the way it is written :).
     
  4. Offline

    ThomasJ

    Very nice. Will be testing this one out shortly.

    Would be neat if we could customize the replacement blocks, or even get it randomized, although that is likely outside the scope of the plugins intention.
     
  5. Thanks a lot :) Been waiting for this to port over ^^.

    EDIT: Doesn't seem to work at all on CraftBukkit #106
     
  6. Offline

    ledhead900

    Awwwww :( oh well I will test it anyway I loved this in Hmod
     
  7. Offline

    theoriginaldude

    Where can i get a mini-map like the one in the pic?
     
  8. Offline

    flames

    --- merged: Jan 20, 2011 2:16 PM ---
    try this one, until msleeper updates her plugin:
    http://mc.citex.net/bedrockgapinsurance-0.0.1-SNAPSHOT.jar

    msleeper, i told you yesterday, that onChunkLoaded / ChunkLoadEvent is not working like expected. because the plugin is loaded AFTER the worlds. only new chunks and chunks that are loaded after plugin is active are gap insured and flattened. since you removed onPlayerMove, the plugin is not really usable. readd onPlayerMove back please. except of onPlayerMove i dont see any alternative yet. i tested that, its not just an assumption.

    i am also working on a way to get all already loaded chunks in the world and ungap+flat them only once at server/plugin start. in addition to that onChunkLoad would be great. but bukkit seems not to have implemented that yet.
     
  9. Offline

    Fewmets

    when the ChunkLoadEvent is implemented, it would be nice if it would load all the tiles that are made, and effect them. then save a list of chunks changed so that the next time the server reboots it ignores those chunks. Otherwise it looks like it will destroy anything on the bottom 5 levels over and over? no?
     
  10. Offline

    flames

    oh, thanks for pointiong that out, i just didnt thought about. but bgi only replaces bedrock with smoothstone on levels 1-4 and all not bedrock with bedrock on level 0, so only if you build some bedrock stuff on the first 1-4 levels would be exchanged with smoothstone, not really destroyed. all other block types will be untouched.
     
  11. Offline

    Nukeofwf

    ok, yes, while interested in the primary thread, i also really want to know where you got the minimap.
     
  12. Offline

    Raphfrk

    Even if you don't save it to file, you could have HashMap with all the chunks that have been checked since the server started.

    This would mean that you could use the onplayermove event and just check if they are in a chunk that hasn't been checked yet.
     
  13. Offline

    ThomasJ

  14. Offline

    msleeper

    Do not link directly to my URL. Thanks.

    The minimap thing really isn't the point of this thread. Google or something.

    This is why I shouldn't port plugins at like 7am. This has been fixed, re-download the plugin.

    That's a good idea about the replacement blocks, though I'm kind of afraid people would use this to turn bedrock into Diamond ore or something insane. Though, in my opinion, a better option is to turn all bedrock into lava...

    I didn't ignore you, I just don't think I should bother with this. You said yourself; the onChunkLoaded method isn't working properly yet, and Bukkit isn't even finished. When Bukkit is more completed, it will work entirely as expected. Until now, it still does as advertised - which is fix Bedrock as players move around the world.

    The only problem you might run into is that the area immediately around players when they first join aren't fixed, but as the players move around the world that will sort itself out. Correct?
     
  15. Offline

    barghest

    Hey, posting to thank msleeper and flames for porting/reimplementing this less than 24 hours after I made a thread in the Plugin Requests forum. I doubt my request was the impetus, specifically; I figure you two were already working on it. Regardless, I can't help but be pleased ;)

    Doesn't seem to cause any errors - I'm using flames' preview update (as he said the current official version doesn't work right?) - pending an official version fix. Haven't gone down to bedrock yet, but I can say at least that performance doesn't appear to have suffered visibly. So that's good.
     
  16. Offline

    msleeper

    Yeah I was already planning on porting my existing and unreleased plugins. flames sort of... spurred me into it.

    As per my previous post, unless I am mistaken, then the "problem" with my version will sort itself out. You might have an instance where a chunk that has not been processed yet, but as you move around your world it should correct itself.

    That is, again, unless I'm wrong and onChunkLoaded just flat out does not work whatsoever.
     
  17. Offline

    barghest

    It appears you were writing that post while I was writing mine. So... should I switch to yours?
     
  18. Offline

    feverdream

    I'm not seeing a download link for source but I see source is mentioned in the thread; I'm at work so I cant check the jar, is it in the jar or at a seperate link?

    You should get a free github, makes things much easier to manage.
     
  19. Offline

    barghest

    Man, feverdream, you request source for every plugin that exists. :p
     
    SAMDAN likes this.
  20. Offline

    flames

    i didnt said it "doesnt working properly", i did said it doesnt work "as expected", i doubt this behaviour wil be ever fixed, since its not a bug of bukkit because of its development status, its is simply behaviour of how bukkit and mc server works. world is loaded before bukkits plugin interface is active, so before the plugin gets its chance to modify chunks.
    but i really hope that i am wrong and you are right with the chunkloaded behaviour.

    but with your second statement your are absolutely correct, if people move around far enough, so chunks will be unloaded and loaded again, it will fix bedrock also there.
     
  21. Offline

    FrozenCow

  22. Offline

    msleeper

    It's in the jar. I hate github, it's confusing and a pain in my ass.
     
  23. Offline

    Raphfrk

    What they could do is create a record of all chunks as the load during startup. Once all plugins are active, they could send the initial chunks in a burst.

    Another option would be a "getLoadedChunks()" method that returns all chunks currently in memory. The plugin could run that after it has loaded.
     
  24. Offline

    flames

    this is what i hope will be implemented in craftbukkit, since i could use this in plugin i am planning to make. and many other plugin devs would love this feature.
     
  25. Offline

    msleeper

    Yeah I like that method. We'll just have to wait and see what options are available as Bukkit gets closer to release.
     
  26. Offline

    Raphfrk

    The code for checking if a chunk exists is in

    src/main/java/org/bukkit/craftbukkit/CraftWorld.java

    Code:
        public boolean isChunkLoaded(Chunk chunk) {
            return world.A.a(chunk.getX(), chunk.getZ());
        }
    
    The a(int, int) method is in
    src/main/java/net/minecraft/server/ChunkProviderServer.java

    Code:
        public boolean a(int i, int j) {
            ChunkCoordinates chunkcoordinates = new ChunkCoordinates(i, j);
    
            return e.containsKey(((chunkcoordinates)));
        }
    
    e is a Map which maps chunk Coordinates to Chunks.

    Thus,

    e.values()

    would give a collection containing all currently loaded chunks. However, it would probably be better to make a copy before returning it from the method.

    For example

    Code:
        public Chunk[] getLoadedChunks() {
           return chunks = Collection.toArray( e.values() );
        }
    
    (haven't actually tested it, but something like that should work)
     
  27. Offline

    FabianN

    Edit:
    nvm, I found flame's fork and loaded that and it's working perfectly for me.
    here:
    https://github.com/flames/BedrockGapInsurance
    in the folder "target" of the download is the prize.
    ----------------------------------------

    just wanted to report that it's not working for me. I went and got myself some new land generated, which with this plugin when I explore to the point that the server is generating new land it ought to flatten bedrock, right? Or, at the least at some point between my travels to and from spawn to the "newland".

    But it is not.

    I was first running craftbucket 121 when I explored the area. Later I updated to 126 and tried to have those chunks re-load by walking back to spawn and then back out, no difference.

    I'm also not getting any errors in the server log.
     
  28. Offline

    msleeper

    I updated it for what should be a working fix. Let me know if it's still not working properly for you. Thanks.
     
  29. Offline

    Trinsec

    I've got Craftbucket 126 and just redownloaded this plugin, but none of my bedrock gets flattened. I did walk large rounds around to enter various chunks, but to no avail.
     
  30. Offline

    msleeper

    Can you confirm that flat-earth is enabled in your config? By default it is not.
     

Share This Page