emptying a chunk

Discussion in 'Plugin Development' started by Megolas, Aug 23, 2012.

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

    Megolas

    Hello - is there a way to empty a chunk without going block by block?
    I want a default world to generate buy with empty chunks over a certain coordinate - nobody seemed to know how to do that, so i'll empty the chunks manually (Unless anyone knows how to do it and read this thread)
    Thanks!

    bump

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

    Megolas

  3. Offline

    Mortiferous

  4. Offline

    sternmin8or

  5. Offline

    Megolas

    I looked into both - about the first one, i checked it a fw days ago, the terrain generator is very problematic to work with, so i'll only use it if i find no other option.
    second - i dont want an empty world, just empty over a certain limit. Now, if i use my own generator (to empty only certain parts), it will override the default one so i'll have to code an exact replica of MC's generator, which im not able to do.
     
  6. Offline

    Sabersamus

    Feel free to modify this as you see fit:
    Code:java
    1.  
    2. public int setBlocks(Material mat){
    3. if(mat == null)return 0;
    4. int startX = Math.min(x1, x2);
    5. int endX = Math.max(x1, x2);
    6.  
    7. int startY = Math.min(y1, y2);
    8. int endY = Math.max(y1, y2);
    9.  
    10. int startZ = Math.min(z1, z2);
    11. int endZ = Math.max(z1, z2);
    12. undo.clear();
    13. for (int x = startX; x <= endX; x++) {
    14. for (int y = startY; y <= endY; y++) {
    15. for (int z = startZ; z <= endZ; z++) {
    16. Location loc = new Location(world, x,y,z);
    17. Block block = loc.getBlock();
    18. undo.put(loc, block.getType());
    19. if(!ChestBless.isBless(block)){
    20. block.setType(mat);
    21. }
    22. }
    23. }
    24. }
    25. return this.getSize();
    26. }
     
  7. Offline

    sternmin8or

    Its a bad idea in general to generate a chunk and then empty it immediately. How hard would it be for you to move around your world to load the chunks, then change chunkgenerator to nullterrain? If it is too hard, I think there was some kind of plugin that had a generatechunks(radius) command.
     
  8. Offline

    Megolas

    thanks saber, but thats what i said i didnt want, going block by block.
    sternmin8or
    if i use this generator, it will override the current one. I could have done this one myself - its very simple, problem is that if i do that, i cant keep the default terrain as i want to.
     
  9. Offline

    sternmin8or

    Right, so generate as much terrain as you want with the minecraft terrain generator and THEN use the nullterrain generator to prevent any more from being generated. Or am I missing something?
     
  10. Offline

    Megolas

    Oh, yea, havent thought of that. But it won't work it my case, as the server is supposed to generate a new map like this each time, and not as a 1 time thing.
     
  11. Offline

    sternmin8or

    well that sucks
     
  12. Offline

    Megolas

Thread Status:
Not open for further replies.

Share This Page