Can bukkit change biome properties?

Discussion in 'Plugin Development' started by blahsd101, Aug 27, 2014.

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

    blahsd101

    Hey there. This is a question regarding the possibilities of Bukkit so I'm sorry if it's noobish.
    After coding a couple easy peasy plugins in a couple of days to familiarize myself with the bukkit API I wanted to move on something harder, and since I never found a season plugin that works well enough I wanted to give it a shot.

    However, it has occurred to me that I'm not sure if bukkit can change biomes properties, such as temperature, which would be necessarily changed by my plugin (to make it snow in plains and such). That said, can bukkit do that? Or should I turn to Forge?

    Thanks all :)
     
  2. Offline

    CraftBang

    Well, there are ways to set the Biome (if I look at the jd.bukkit.org), and I also found to get the temperature of a block, but setTemperature or something does not exists..

    Code:
    double org.bukkit.World.getTemperature ( int  x, int  z)  
     
  3. Offline

    mncat77 Retired Staff

    Making it snow in a plains biome (snow particle effects) is impossible with a vanilla minecraft client, it's not server-side, however the forming of snow layers can be controlled.
     
  4. Offline

    blahsd101

    Okay, thanks a bunch.
     
  5. Offline

    blahsd101

    Hey there, sorry for this little necro-ing, but I really really thought that a BukkitDev Staff answer was all I needed. After doing some more research though, this came up: http://dev.bukkit.org/bukkit-plugins/seasons/
    It's a season plugin that purports as a feature "Visible effects like snowing". So is the developer just plain lying or there is a way to do it? Maybe through sending packets? Or modifying biome properties? Anything?
     
  6. Offline

    mncat77 Retired Staff

    You can set the biome of a column to a biome in which snow falls and make it rain there, that'll make snow particles appear there.
     
  7. Offline

    blahsd101

    Thank you for coming back to answer this! Wouldn't that affect further terrain generation though? With possibly horrid side effects? And how would you do it?
     
  8. Offline

    mncat77 Retired Staff

    You can only change the biomes of columns in already generated chunks. This does not affect chunks that will be generated after that at all (they are being fetched freshly from the GenLayers rather than the existing world chunk saves).
     
    blahsd101 likes this.
  9. Offline

    blahsd101

    Oh my god, that's fantastic! Thank you, this completely answers my question.

    Just not to create a separate thread since we're already in this one, I will keep being nosey about this and ask how one should go about selecting a very large number of blocks to change their biome. I'm worried about the performance load, and how I should select them not to kill the server altogether.
     
  10. Offline

    fireblast709

    blahsd101 spread it over a set of ticks using a timer task
     
  11. Offline

    blahsd101

    mncat77 I'm asking you because you seem extremely knowledgeable. I'm looking for the proper way to reset the biomes to their original status after I changed them to a snowy biome for the "snow season". I'm not hip on the idea of keeping a database of chunks with their original biome value because if that got messed up/messed with/deleted/reset for any reason the world would be very screwed. Is there a way to know the original biome of a block? Can I access those GenLayers you mentioned (I couldnt find much about them online) and fetch it from there?
    fireblast709 I'll try that. However, how do I select all of the generated blocks? I can't just try every possible coordinate...
     
  12. Offline

    mncat77 Retired Staff

    I think your best bet is to keep the biomes on the server then and just send the client fake packets making it see the desired biome. (I really don't think you want to mess with too much wgen code.)
     
  13. Offline

    blahsd101

    That would work much better for me - I'm not that comfortable with bukkit so the least I change in the world the better off I am. Do you have any pointers for me in how to manage a process like the one you just described? I was reading about ProtocolLib to send fake packets to the player but I'm really lost because there's no tutorial or anything like that.
    I saw you in a thread about this a while ago - whitehooder said he was able to figure it out but he never posted the solution. Hope he can show up here.
     
  14. Offline

    mncat77 Retired Staff

    You'd have to look into this packet: http://wiki.vg/Protocol#Map_Chunk_Bulk .
    Comphenix has a tutorial on using ProtocolLib in your plugin here.
     
    blahsd101 likes this.
  15. Offline

    Comphenix

  16. Offline

    blahsd101

    mncat77 thanks a vinci for those links. It looks terribly complicated but I guess I'll be fine eventually.
    Comphenix what an honor to see you here personally! I'm looking at the code you linked to right now and adapting some parts- it seems to be working nicely so far. Great tool you created- when it comes out, will it be compatible with or updated to 1.8 bukkit you think?
     
  17. Offline

    Comphenix

    Thanks. :)

    As long as they're using Netty, intercepting packets should continue to be fairly straight forward. The question is how long it will take to update all the other features in ProtocolLib, like wrappers, intercepting packet byte buffers, and so on.

    There's also this whole current legal debacle regarding the licensing of CraftBukkit, so who knows if there will even be a CraftBukkit for 1.8. :(

    I suppose we will just have to wait and see.
     
    blahsd101 likes this.
Thread Status:
Not open for further replies.

Share This Page