Strange Error

Discussion in 'Plugin Development' started by pers2981, May 29, 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

    theholeymonkey

    This needs to be fixed!
     
  3. Offline

    BobbyD441

    try setting the for loops to:
    Code:
    for(int x = 0; x <= 16; x++)
    for(int z = 0; z <= 16; z++)
    for(int y = 0; y <= 255; y++)
    Because the water looks like its missing 1 row, no idea what could be the issue with the leaves tho =/
     
  4. Offline

    Wundark

    I don't seam to be getting any of that. Any water just disappears after a few seconds. I'm running CB 2175.

     
  5. Offline

    BobbyD441

    the video is private =/
     
  6. Offline

    Wundark

    Fixed.
     
  7. Offline

    BobbyD441

    Well, looks like the plugin is working =)
     
  8. Offline

    pers2981

    I made a custom popular and I got the same results. Also i'm already using a chunk populate event.

    That's odd, I will have to change CB versions and see if anything changes.
    EDIT: Didn't change anything.

    I'll check that out thanks.
    EDIT: Didn't change anything.
     
  9. ChunkPopulateEvent is the wrong place to do it, whit an BlockPopulator users of you pugin can easy use it on 1 world, and not on another,
     
  10. Offline

    theholeymonkey

    Bump for the thread

    Can ANYONE fix this!!!

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

    theholeymonkey

    LAST HOPE D:
    Then I am done...
     
Thread Status:
Not open for further replies.

Share This Page