Block is solid check

Discussion in 'Plugin Development' started by LRFLEW, Jul 26, 2011.

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

    LRFLEW

    I need to check if a block is solid and can be stood on if teleported there. Is there an easy function for it, or will I have to write a ton of if statements?
     
  2. Offline

    Shamebot

    Using craftbukkit you could do something like
    Code:
    net.minecraft.server.Block.byId[block.getTypeId()].material.isSolid();
    Where block is a instance of org.bukkit.block.Block
     
  3. Offline

    LRFLEW

    I could, but 1) It would be nice to not use craftbukkit, as it's harder to keep up with code changes, and 2) that would require I get the block instance for each block. This will be in a for loop, and this will cause each block to be cached, causing memory issues.
     
  4. Offline

    Shamebot

    You don't need a block, just an id.
     
Thread Status:
Not open for further replies.

Share This Page