(Spout) BlockPopulator - Generating a block

Discussion in 'Plugin Development' started by russjr08, Apr 28, 2013.

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

    russjr08

    Good morning / afternoon / evening folks!

    I'm trying to write a module in my plugin (which uses the Spoutplugin API) to generate a cluster of ores. I do see that it generates, but it only generates with one block -- instead of a group that I wanted. It's fairly late over here so maybe I'm not thinking straight, does anyone have any clues?

    Code:
    public void populate(World world, Random random, Chunk chunk) {
     
            int randX, randY, randZ;
     
            randX = random.nextInt(16);
            randY = random.nextInt(16);
            randZ = random.nextInt(16);
     
            for(int i = 0; i < 10; i++){
     
     
     
                int facX, facY, facZ;
     
                facX = random.nextInt(50);
                facY = random.nextInt(50);
                facZ = random.nextInt(50);
     
                Block block = chunk.getBlock(randX, randY, randZ);
     
                if(block.getType() == Material.STONE){
                    for(int x = 0; x < facX; x++){
                        for(int z = 0; z < facZ; z++){
                            for(int y = 0; y < facY; y++){
                                Spout.getServer().getWorld(world.getName()).getChunkAt(block).setCustomBlock(randX + facX, randY + facY, randZ + facZ, customBlock);
     
                            }
                        }
                    }
     
                }
     
            }
     
     
        }
    I even have the numbers ramped up to 50 (which is extreme..) to see if it worked, but no, it does not. :/

    I could use another pair of eyes. :)
     
  2. You should post in the Spout forums instead.
     
  3. Offline

    russjr08

    Honestly, there's one line of Spout code in that snippet, the majority of it is from the Bukkit API. If I was messing with Vanilla*, or the Spout Server, then I would feel its more appropriate to post there.

    *Vanilla of course being the Spout Server plugin, not vanilla Minecraft.
     
  4. Offline

    stuntguy3000

    Spout forums, not here
     
  5. russjr08
    Yes, that one line is also the source of your problem as you say, we're not familiar with that API which is why it's best for you to post there.
     
  6. Offline

    russjr08

    Alright, that's good enough I didn't know if at first you guys were just being rude to me, but I see that's not the case. :oops:

    Thanks for providing an explanation and not just leave me wondering.:p
     
Thread Status:
Not open for further replies.

Share This Page