Package net.minecraft.block.material

Examples of net.minecraft.block.material.Material


    if (player.isSwingInProgress && pos != null) {
      Block block = par2World.getBlock(pos.blockX, pos.blockY, pos.blockZ);

      if (block != null) {
        Material mat = block.getMaterial();
        if (ToolHandler.isRightMaterial(mat, ToolHandler.materialsPick))
          typeToFind = "pick";
        else if (ToolHandler.isRightMaterial(mat, ToolHandler.materialsShovel))
          typeToFind = "shovel";
        else if (ToolHandler.isRightMaterial(mat, ToolHandler.materialsAxe))
View Full Code Here


  }

  @Override
  public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
    World world = player.worldObj;
    Material mat = world.getBlock(x, y, z).getMaterial();
    if (!ToolHandler.isRightMaterial(mat, ToolHandler.materialsAxe))
      return false;

    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
View Full Code Here

  }

  @Override
  public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
    World world = player.worldObj;
    Material mat = world.getBlock(x, y, z).getMaterial();
    if (!ToolHandler.isRightMaterial(mat, ToolHandler.materialsPick))
      return false;

    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
View Full Code Here

  }

  @Override
  public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
    World world = player.worldObj;
    Material mat = world.getBlock(x, y, z).getMaterial();
    if (!ToolHandler.isRightMaterial(mat, ToolHandler.materialsShovel))
      return false;
    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
      return false;
View Full Code Here

    if (block != null && blk != block)
      return;

    int meta = world.getBlockMetadata(x, y, z);
    Material mat = world.getBlock(x, y, z).getMaterial();
    if (blk != null && !blk.isAir(world, x, y, z) && ((blk.getPlayerRelativeBlockHardness(player, world, x, y, z) != 0 || (blk == Blocks.bedrock && (y <= 253 && world.provider instanceof WorldProviderBedrock))))) {
      if (!blk.canHarvestBlock(player, meta) || !isRightMaterial(mat, materialsListing))
        return;
      if (ConfigHandler.bedrockDimensionID != 0 && block == Blocks.bedrock && ((world.provider.isSurfaceWorld() && y < 5) || (y > 253 && world.provider instanceof WorldProviderBedrock))) {
        world.setBlock(x, y, z, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockBedrockPortal.class));
View Full Code Here

              (y < H && spawnBlock[(x * width + z) * height + (y + 1)]) ||
              (y > 0 && spawnBlock[(x * width + z) * height + (y - 1)]));

          if (flag) {
            if (y >= heightOff) {
              Material material = world.getBlock(xStart + x, yStart + y, zStart + z).getMaterial();
              if (material.isLiquid())
                return false;
            } else {
              if (!canGenerateInBlock(world, xStart + x, yStart + y, zStart + z, genBlock)) {
                return false;
              }
View Full Code Here

      this.setParticleTextureIndex(114);
      this.motionX *= 0.699999988079071D;
      this.motionZ *= 0.699999988079071D;
    }
    if (this.particleGravity > 0) {
      Material material = this.worldObj.getBlock(MathHelper.floor(this.posX), MathHelper.floor(this.posY), MathHelper.floor(this.posZ)).getMaterial();

      if (material.isLiquid() || material.isSolid()) {
        double d0 = MathHelper.floor(this.posY)
            + 1
            - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor(this.posX), MathHelper.floor(this.posY),
                MathHelper.floor(this.posZ)));
        if (this.posY < d0) {
          this.setDead();
        }
      }
    } else {
      Material material = this.worldObj.getBlock(MathHelper.ceil(this.posX), MathHelper.ceil(this.posY), MathHelper.ceil(this.posZ)).getMaterial();

      if (material.isLiquid() || material.isSolid()) {
        double d0 = MathHelper.ceil(this.posY)
            + 1
            - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.ceil(this.posX), MathHelper.ceil(this.posY),
                MathHelper.ceil(this.posZ)));
        if (this.posY > d0) {
View Full Code Here

    }
    if(displacementIds.containsKey(bId))
    {
      return displacementIds.get(bId);
    }
    Material material = Block.blocksList[bId].blockMaterial;
    if(material.blocksMovement() || material == Material.water || material == Material.lava || material == Material.portal)
    {
      return false;
    }
    return true;
  }
View Full Code Here

        Block.blocksList[bId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
        return true;
      }
      return false;
    }
    Material material = Block.blocksList[bId].blockMaterial;
    if(material.blocksMovement() || material == Material.water || material == Material.lava || material == Material.portal)
    {
      return false;
    }
    Block.blocksList[bId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
    return true;
View Full Code Here

    }
    if(displacementIds.containsKey(bId))
    {
      return displacementIds.get(bId);
    }
    Material material = Block.blocksList[bId].blockMaterial;
    if(material.blocksMovement() || material == Material.water || material == Material.lava || material == Material.portal)
    {
      return false;
    }
    return true;
  }
View Full Code Here

TOP

Related Classes of net.minecraft.block.material.Material

Copyright © 2018 www.massapicom. 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.