Need a small push in the right direction

Discussion in 'Plugin Development' started by Chief149, Nov 18, 2012.

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

    Chief149

    So I am working on a very large plugin with a friend of mine, and this is hopefully going to be a very original gametype that has never before been featured on Bukkit servers. One of the functions this plugin has, or will eventually have, is regenerating landscape.

    Basically in the game, the map will need to regenerate under the following criteria:

    What causes the map to regenerate: When X% of Y types of blocks get destroyed. I have ideas for how to code that part.

    How is regeneration supposed to work?
    When the map needs to regenerate, it needs to be rebuilt. I mean I need to keep that map, but recreate all of the chunks. Literally destroy the chunks, and create them again, BUT I need certain areas to not be regenerated. These areas would be the same as world guard regions, and everything but those regions needs to be destroyed and regenerated. Secondly I need ore placement, tree placement, etc. to change completely. I don't want the map to just regenerate with the diamonds in the same spot they were originally. I would like them to be in different places. Same with trees, and landscape. If it's the same then players will see a pattern and learn where all of the resources are. Anyone have an idea of how to do this? Sample code would be nice, but I need the general idea of what my code would have to do to accomplish the above more than anything.
     
  2. Offline

    leiger

    The biggest problem you will have here is the edges of the world generation, and where they meet up with existing WorldEdit regions (which you said you would not be regenerating). End result would be a large number of steep cliff faces at the edge of people's homes.

    Try looking at WorldEdit's API. I've never used it myself, but it should give you access to world regeneration (which it uses for the //regen command). I suspect your plugin would have to do something like this:
    1. Determine which areas to regenerate (i.e. which blocks are not part of an existing WG region)
    2. Change the world seed value to something random
    3. Regenerate using the WorldEdit API
     
  3. Offline

    Chief149

    Well I was writing down some other ideas and thought up this:

    When a user destroys a block, it goes into a list queue. Once >X blocks are broken, then every few minutes the plugin grabs blocks from the bottom of the list (enough to bring the broken blocks down to X) and regenerates them, and then waits a while before doing the process over again. I could probably set up some sort of logic which would make things a little more random, but without craziness with sudden drops.
     
Thread Status:
Not open for further replies.

Share This Page