Examples of canDismantle()


Examples of cofh.api.block.IDismantleable.canDismantle()

  public void toolUsed(ItemStack item, EntityLivingBase user, int x, int y, int z) {
    Block block = user.worldObj.getBlock(x, y, z);
    if (user.isSneaking() && block instanceof IDismantleable && user instanceof EntityPlayer) {
      EntityPlayer player = (EntityPlayer) user;
      IDismantleable machine = (IDismantleable) block;
      if (machine.canDismantle(player, player.worldObj, x, y, z) && !player.worldObj.isRemote) {
          machine.dismantleBlock(player, player.worldObj, x, y, z, false);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.