Regenerate snow on land

Discussion in 'Archived: Plugin Requests' started by Digi, Mar 9, 2011.

  1. I read that the snow effect isn't possbile atm, but I think just placing snow blocks on ground is possible.

    So, can anyone make a plugin that places snow blocks on an area that has other snow blocks (or if you can detect the biome) from the sky angle (the way it's generated from the start, no snow under trees and etc, just fill sky with snow and drop'em down... while ignoring the blocks that already have snow on them ofc...

    And I repeat, I don't request any visual effects, just the snow blocks beeing updated, because is a pain to place them manually on houses and trees...
     
  2. Offline

    Raphfrk

    So basically, whenever a block is placed, you want it to be covered with snow (if it is a top block)?
     
  3. Offline

    zeph

    If it gets "sunlight" (or moonlight) then spawn snow cover block within a pre-defined area... should be doable.

    However, the pre-defined area is a snow biome... Can you "get biome zone"?
     
  4. Offline

    Raphfrk

    You can use

    Biome b = block.getBiome();
    if(b == Biome.ICE_DESERT || b == Biome.TUNDRA) {
    <code>
    }
    [MERGETIME="1299686266"][/MERGETIME]
    One point is that CraftBukkit actually checks biome on a per-chunk basis. This means that the edges will be chunk aligned.
     
  5. Not exacly, not right away at least... once every few days it should make all snowy areas with snow again if there are view-from-above blocks that don't have snow.

    And yeah, only in biome areas, not user defined areas, completly automatic :}

    So, anyone up to the task ? :p
     
  6. Offline

    Gea

    Second this. I am really surprised this isn't a standard request.
     
  7. Offline

    leslieliang

    You can use WorldEdit. There is a /snow [radius] command that will drop snow. Drop it from the tallest building or structure around.
     
  8. Offline

    opatut

    When do you want the snow to spawn? A while after it is removed or when you type a command? Second would be easier.
     
  9. Offline

    Gea

    Awhile after it's removed would be ideal, since World Edit already supports the latter. Even if it's just every time the server is run it would be great, since every good server should reboot every few hours.
     
  10. Nah, that's too administrative... I want something more natural.. see below.

    Neither. Automatic once every 60 minutes or so, drop snow over snow biome areas.

    But to make it not lag the whole server the snow should be placed slowly, 1 block per second or something... it would also be nice to be notified, something like "It's snowing (effects are not possible at the moment)", when entering an snowy area that is currently beeing updated with snow.

    As for advanced settings... I'd recommend a "skip block" setting so it doesn't drop snow on top of specified blocks... but the basic snow adding plugin would be great for now !
     
  11. Offline

    feverdream

    Tagging @narrowtux as he and I have had a pretty in depth discussion about this exact topic recently.
     
  12. Offline

    nerdnosyd

    Couldn't you make it spread on a per biome basis like the vegetation mod spreads plants?
     
  13. Offline

    feverdream

    My advice is wait for @narrowtux to respond..
     
  14. Offline

    narrowtux

    The plugin is WIP at the moment and spawns 30 snow blocks every 10 ticks.
    I plan it to be configureable which biomes should be snowed. I re-coded my own getBiome-method because the bukkit-call is just faulty.
    To make sure which blocks should be snowed, the plugin checks each loaded chunk if there are blocks which have got a snow biome. (it just checks the most-top blocks first(that are 256) and if they are snow-biomes, it detects the most-top block (by going down in the y-coord).
    I optimised the code so it doesn't lag when players walk around and load new chunks. On server start, all the currently loaded chunks have to be checked, though, this takes about 5 seconds on my machine(2.0 GHz Core2Duo).
    I will release the plugin when I added a configuration file in which you can adjust:
    • The biomes which should be snowed. If you like snow, you can place all biomes here and they will all be snowed.
    • The frequency of snow spawning in ticks
    • The number of snows that should be spawned each spawning-process
    • The users that can use /snow /melt and /biome. /snow spawns snow in the chunk in which you stand (including turning water to ice) /melt reverses this process. /biome tells you the biome in which you are standing.
    EDIT: Oh and @Digi :
    The idea with blocks that should not be snowed is great. Will add this too ;)

    The thing is that the bukkit-method just doesn't work at all. The minecraft-server call wants to have the block x and z coords and returns the biome-generator then.
    Bukkit calls the same method with the chunk x and z coords and this is absolutely returning the false biome.

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

    Raphfrk

    Hmm, would something like this work then:

    Code:
    Block blockTemp = world.getBlock(block.getX()<<4, block.getZ()<<4);
    Biome b = blockTemp.getBiome();
    
    Ofc, that would load a chunk way out in the middle of nowhere.

    Btw, wasn't there a pull request relating to this at some point?

    This one line change seems to fix it:

    Code:
    --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
    +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
    @@ -331,7 +331,7 @@ public class CraftBlock implements Block {
         }
    
         public Biome getBiome() {
    -        BiomeBase base = chunk.getHandle().d.a().a(chunk.getX(), chunk.getZ());
    +        BiomeBase base = chunk.getHandle().d.a().a(x, z);
    
             if (base == BiomeBase.RAINFOREST) {
                 return Biome.RAINFOREST;
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 11, 2016
  16. Offline

    narrowtux

    Yup, I made an own method for that in my code that already does that.

    UPDATE: the bukkit team has changed it just now!
     
  17. Offline

    Raphfrk

    I submitted a pull request for it.

    Pull request was accepted, so biomes should be fixed for the next RB.

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

    doug johnson


    weasel5i2 in da works
     
  19. Serverside effects ? I'd prefer a client side effect, but until that happens, my request would be good for now.
     
  20. Offline

    Gea

    So are we on a waiting game for this?
     
  21. Offline

    ZachBora

    IMO water at lv 64 should be ice in a snow biome.
    I don't know if it would be possible but, say one block of ice is present and is touching a water block that has a bloc over it to make that block is too. But we wouldnt want the water inside a building to turn to ice if said water is at lv 64.
     

Share This Page