Solved Generating smooth brick

Discussion in 'Plugin Development' started by larperdoodle, Aug 20, 2014.

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

    larperdoodle

    I'm basically doing this a bunch
    Code:java
    1. loc.setX(loc.getX()-1);
    2. Block av = loc.getBlock();
    3. av.setType(Material.SMOOTH_BRICK);

    And its working almost exactly as intended, generating the structure I want, where I want it.

    The part I don't understand is why, if the block it is replacing is tall grass, it generates mossy stone brick instead of stone brick.
    I've decided I like this little "bug" and have decided to call it a feature.

    But I would like to know why it happens at all.
     
  2. Offline

    Necrodoom

    larperdoodle this is because the long grass has extra block data, like coloured wool, which stays when you set the material. You'd want to set a materialdata to the blockstate.
     
  3. Offline

    larperdoodle

    Ah, ok. I figured it would be something like that, but wasn't sure. Thanks, I think I'll just keep it as a feature.
     
Thread Status:
Not open for further replies.

Share This Page