Solved How can I get the blocks on which it snows?

Discussion in 'Plugin Development' started by LukeSFT, Oct 19, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    LukeSFT

    Is there a way to get the blocks where it snows upon them?
     
  2. Offline

    Tirelessly

    Get the biome and hardcore in a list of what biomes it snows in as opposed to rains.

    I wasn't 100% sure what you meant, but I think that's what you mean.
     
  3. Offline

    LukeSFT

    nearly.
    I wanted to get every block where snow is falling uppon.
     
  4. Offline

    Tirelessly

    Oh. Not sure how to do that really, sorry.
     
  5. Offline

    LukeSFT

    okay.
    You tryed it.
    Thanks
     
  6. try doing it with another way, make an map with nearly all the block types, set the biome to an snow biome, and make an plugin, that creates an unique list of block id where snow is on allowed using that map, you got it?
     
  7. Offline

    LukeSFT

    Idon't want to set the blocks, where snow can fall.
    I want to get every block where snow is falling uppon.
     
  8. Offline

    avatarDr

    It depends on how many times do you need to call this method. Or, exactly, do you need to keep database of these blocks. If no, you can simply filter highest block at each coordinate for biome and material id.
     
  9. Offline

    LukeSFT

    I want to get these blocks, every time, when it snows on them

    does nobody knows this??

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

    Tirelessly

    What are you trying to do? Maybe there's a better way.
     
  11. Offline

    LukeSFT

    for example: I want to set every block where snow is falling upon to a gold block (but not only those, where a snow layer forms.).
     
  12. Offline

    chenr1

    Event Handler For when a block changes to a snow block. Something like when lava and water makes a cobblestone block. It's like that.
     
  13. Offline

    LukeSFT

    but when it snows on snow?
     
  14. Offline

    nathanaelps

    Checking through the code on Github, it doesn't look like there's an event handler for falling snow. In other words: With Bukkit, you can't get the blocks on which it snows. However, using NMS classes, you should be able to. It looks like you'd *probably* need to @Override the
    net.minecraft.server.BlockSnow.n(World, int, int, int)
    method. (as long as we're talking 1.3.2. Any changes, and the method name will most likely change as well.)

    But be very careful. NMS classes are not kept squeaky clean by the Bukkit team for you--they can go rotten when you're not watching. You've been warned.
     
  15. Offline

    travja

    Use BlockFormEvent, get the block that formed, if it is a snowcover block, get the block underneath of it using b.getRelative(BlockFace.DOWN) and go from there!
     
    MrBluebear3 likes this.
  16. Offline

    LukeSFT

    travja: But when It snows on a snowcovered block, nothing forms, so I don't get this block.
     
  17. Offline

    LukeSFT

    nathanaelps: Can you give my a code example for this?

    Another question: Who can I check if it rains/snows?

    Found a way to do it.
    :D

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

    nathanaelps

    Share!
     
  19. Offline

    LukeSFT

    tomorrow
     
  20. Offline

    SnowGears

    Yes please share! I need to do this as well
     
  21. Offline

    LukeSFT

    get the all loaded chunks if it storms get all highest blocks of the loaded chunks then get their biome and test whether it snows in this biome or not.
     
  22. Offline

    SnowGears

    And this will get all blocks it is currently snowing on? It seems like this would lag the server quite a bit when it starts to snow.
     
  23. Offline

    LukeSFT

    That's right, but i didn't jound a better solution.
    Do you have one?
     
Thread Status:
Not open for further replies.

Share This Page