Solved Find if Block is Slab

Discussion in 'Plugin Development' started by rtainc, Jun 5, 2013.

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

    rtainc

    Is there an easier way to get this other than going if(getType() = Material.getMaterial(slabId)) {} 8 or so times to find if a block is a slab?

    Never mind, easier than I thought... code:

    Code:java
    1.  
    2. int[] slabs = {44, 126};
    3. for(int id : slabs) {
    4. if(block.getType() == Material.getMaterial(id))
    5. return true;
    6. }
    7. return false;
    8.  


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

Share This Page