Snow

Discussion in 'Plugin Development' started by FTC_WTFire7, Dec 8, 2013.

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

    FTC_WTFire7

    Hey everyone, I was wondering if it was possible to change a biome to a winter biome, and make it continuously snow, and then after reset it back to a normal biome. The reason I am asking is because I want to make a holiday themed spawn, so it starts snowing, but its not possible to make it snow in a normal biome, so is there a plugin to change a biome, and is there a plugin to make it always snow (downfall)?
     
  2. Offline

    Iroh

    Moved to plugin development.
     
  3. Iroh
    I dont think this is plugin development. This is a request for a plugin that does this.
     
  4. Offline

    Iroh

    FTC are you asking if it is possible and if so what the code would look like, or for a plugin that does it?
     
  5. Offline

    FTC_WTFire7

    I think a little bit of both, I am experienced with Java a little bit, not much though, but if there such a plugin? If not then yes, I would like to know how it would look.
     
  6. Offline

    L33m4n123

    In the ChunkGenerator Class of bukkit itself there is a method called setBiome(); probably would need to work with that
     
  7. Offline

    FTC_WTFire7

    Ok I got BiomeEdit todo the main job, changing the biome to Winter Biome, but now what I need is for the downfall to always be on for this world
     
  8. Offline

    L33m4n123


    Listen for the WeatherChangeEvent and whenever it is called, cancel it and set the current weather to RAIN
     
  9. Offline

    FTC_WTFire7

    Would it be rain or snow, and how would I put this into code, I am not a pro at coding in Java.
     
  10. Offline

    The_Doctor_123

    FTC_WTFire7
    In Minecraft, weather takes place everywhere and at the same time. So if it's raining one place, it's snowing in another. If it's clear at one place, it's clear at the other.
     
  11. Offline

    FTC_WTFire7

    Ahh yes, so how would I go about coding this?
     
  12. Offline

    scarabcoder

    Code:java
    1.  
    2. @EventHandler
    3. public void weatherChangeEvent(WeatherChangeEvent e){
    4. e.getWorld().setWeatherDuration(Integer.MAX_VALUE);
    5. }
    6.  
    7.  

    Or something along that line. You can also check if the changed weather is clear (Aka if the snow stops) and use e.setCancelled(true). I'm not using any program for the code above, it may need a little tweaking.
     
  13. Offline

    The_Doctor_123

  14. Offline

    FTC_WTFire7

    Hmm... So I can assign a command to that, so what would the code look like if I were to make it so if it is cancelled, it will be automattcly uncanceled
     
  15. Offline

    scarabcoder

    FTC_WTFire7 I don't understand... You want a toggle command for the snowing?
     
  16. Offline

    FTC_WTFire7

    Ohh, never mind, its just a mod kind of thing, so uh what would the code look like
     
  17. Offline

    scarabcoder

    FTC_WTFire7 I already posted it, but here it is again:

    @EventHandler
    public void weatherChangeEvent(WeatherChangeEvent e){
    e.getWorld().setWeatherDuration(Integer.MAX_VALUE);
    }

    This is what it does. It first detects if the weather changes, then makes it rain for infinity. I guess you could put thebinfinity bit on the onEnable() method, but I put it in the event.
     
  18. Offline

    FTC_WTFire7

    Hmm, alright ill try that out, thanks for your help.

    Wait, one more question, will this do something for all worlds, or just one, because I just want it on the spawn world.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  19. Offline

    The_Doctor_123

    FTC_WTFire7
    All worlds, obviously. You need to check if it is the world that you want weather enabled in.
     
  20. Offline

    maxben34

    That would be for all worlds. You can do
    Code:
    @EventHandler
    public void onSnow(WeatherChangeEvent e){
    if(e.getWorld().equals(Bukkit.getWorld("YOUR_WORLD"){
    e.getWorld().setWeatherDuration(Integer.MAX_VALUE)
    }
    }
     
  21. Offline

    Compressions

    FTC_WTFire7 Also, to check if it is beginning to rain or not:
    Code:
    if(e.toWeatherState()) {
    //now raining
    } else {
    //no longer raining
    }
     
Thread Status:
Not open for further replies.

Share This Page