making a glass outline

Discussion in 'Plugin Development' started by boardinggamer, Dec 4, 2012.

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

    boardinggamer

    I want to surround the area between 2 blocks with glass. I tried this but it didn't work at all
    Code:java
    1. int x1 = block1.getX();
    2. int z1 = block1.getZ();
    3. int x2 = block2.getX();
    4. int z2 = block2.getZ();
    5. int startx = x1;
    6. int endx = x2;
    7. int startz = z1;
    8. int endz = z2;
    9. if (x1 >= x2){
    10. startx = x2;
    11. endx = x1;
    12. }
    13. if (z1 >= z2){
    14. startx = z2;
    15. endx = z1;
    16. }
    17. for (int xx = startx; xx < endx; xx++){
    18. for (int zz = startz; zz < endz; zz++){
    19. int yy = block1.getWorld().getHighestBlockYAt(xx, zz);
    20. Block b = block1.getWorld().getBlockAt(xx, yy, zz);
    21. if (b.getX() == startx || b.getX() == endx){
    22. b.setType(Material.GLASS);
    23. }
    24. if (b.getZ() == startz || b.getZ() == endz){
    25. b.setType(Material.GLASS);
    26. }
    27. }
    28. }
    29. }
    Can someone help me with this? tell me how or at least what I am doing wrong.
     
  2. Offline

    gomeow

    You could look at the world edit source,
     
  3. Offline

    boardinggamer

    Have you seen that source code? I can't understand like any of it. It's way to much for me to handle haha
     
  4. Offline

    gomeow

    Just looked at it... *Mind Blown*
     
    chasechocolate likes this.
  5. Offline

    chasechocolate

Thread Status:
Not open for further replies.

Share This Page