Plugin Help Check if Block is Solid.

Discussion in 'Plugin Help/Development/Requests' started by MineCrypt, Nov 16, 2014.

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

    MineCrypt

    Hey, I'm currently playing around with some random stuff however I recently came up with a new issue. I want to make it easier on myself and having a method to determine if a block is solid or not would be amazing. I saw this code using CraftBukkit earlier:
    Code:
    public boolean isSolidBlock(Block block) {
     
            return block.getTypeId() != 0
                    && net.minecraft.server.Block.byID[block.getTypeId()]
                            .a();
     
        }
    So I just filled in my version with:
    Code:
    public boolean isSolidBlock(Block block) {
     
            return block.getTypeId() != 0
                    && net.minecraft.server.v1_7_R3.Block.byID[block.getTypeId()]
                            .a();
     
        }
    However, the .byID is not recognized. Can someone help by fixing this certain code or offering another method to check if a block is solid or not?

    Something might of changed from the time this older code was made.

    Thanks
     
  2. Offline

    Cloaking_Ocean

    I belive u have to have craftbukkit specifically in your referenced jars instead of bukkit and I think you could possibly just try myBlock.getMaterial().isSolid();
     
Thread Status:
Not open for further replies.

Share This Page