Mishap while replacing blocks

Discussion in 'Plugin Development' started by pers2981, May 24, 2012.

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

    pers2981



    Listener (open)

    Code:
    @EventHandler
        public void OnChunkGen(ChunkPopulateEvent event)
        {
            Chunk curchunk = event.getChunk();
            for (int x = 0; x < 16; x++)
            {
                for (int z = 0; z < 16; z++)
                {
                    for (int y = 0; y < 255; y++)
                    {
                        Block block = curchunk.getBlock(x, y, z);
                        int id = block.getTypeId();
                       
                        if (id == Material.GRASS.getId())
                        {
                        block.setType(Material.DIRT);
                        }
                       
                        if (id == Material.LEAVES.getId())
                        {
                        block.setType(Material.AIR);
                        }
                       
                        if (id == Material.RED_ROSE.getId())
                        {
                        block.setType(Material.AIR);
                        }
                       
                        if (id == Material.YELLOW_FLOWER.getId())
                        {
                        block.setType(Material.AIR);
                        }
                       
                        if (id == 31 || id == 32 || id == 78 || id == 106)
                        {
                        block.setType(Material.AIR);
                        }
                       
                        if (id == Material.SUGAR_CANE.getId() || id == Material.SUGAR_CANE_BLOCK.getId())
                        {
                        block.setType(Material.AIR);
                        }
                       
                        if (id == Material.ICE.getId())
                        {
                        block.setType(Material.AIR);
                        }
                       
                        if (id == Material.WATER.getId() || id == Material.STATIONARY_WATER.getId())
                        {
                        block.setType(Material.AIR);
                        }
     
  2. Offline

    TheTrixsta

    You should make a worldgen, I think you would get better results :)
     
  3. Offline

    pers2981

    TheTrixsta
    I was using a custom block populator before however that was giving me the same results.
    I want the same minecraft generation, except without grass +/ leaves etc. I lack the skill to create my own realistic generation system.
     
  4. Offline

    TheTrixsta

    There are a couple of world gens that have been release, id go look at there source code :)
     
  5. Offline

    pers2981

    TheTrixsta
    I have made my own world gen in the past, It just didn't look the way I wanted it to. It would be much easier to simply do it my current way plus it would give the desired effect.
     
  6. Offline

    TheTrixsta

    Mhh, im not familiar with world generators of any kind, but this plugin would be cool when its finished :D
     
  7. Those water "walls" could mean a logic mistake in your loops :-?
     
  8. Offline

    pers2981

    Digi
    I played around with them a little while ago, they appeared to be working correctly. Do you see something I don't?
     
  9. Offline

    pers2981

    Digi

    I was using a custom block populator before however that was giving me the same results.
    I want the same minecraft generation, except without grass +/ leaves etc. I lack the skill to create my own realistic generation system.


    Anyone have any ideas?

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

    pers2981

    Anyone have any ideas?
     
  11. Offline

    theholeymonkey

    Bump for this thread!

    This needs to be fixed!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
Thread Status:
Not open for further replies.

Share This Page