Package net.minecraft.block.material

Examples of net.minecraft.block.material.Material


        int[] map = new int[4096];
        ArrayList<Material> mats = new ArrayList<Material>();
        for (int i = 0; i < map.length; i++) {
            Block b = getBlockByID(i);
            if(b != null) {
                Material mat = getBlockMaterial(b);
                if (mat != null) {
                    map[i] = mats.indexOf(mat);
                    if (map[i] < 0) {
                        map[i] = mats.size();
                        mats.add(mat);
View Full Code Here


      //If we hit block
      if(hit != null && hit.typeOfHit == MovingObjectType.BLOCK)
      {
        //Get the blockID and block material
        Block block = worldObj.getBlock(hit.blockX, hit.blockY, hit.blockZ);
        Material mat = block.getMaterial();
       
        //If this grenade detonates on impact, do so
        if(type.explodeOnImpact)
          detonate();
       
View Full Code Here

        if(breakingBlock != null)
        {
          //Get block and material
          Block blockHit = worldObj.getBlock(breakingBlock.x, breakingBlock.y, breakingBlock.z);
          int metadata = worldObj.getBlockMetadata(breakingBlock.x, breakingBlock.y, breakingBlock.z);
          Material material = blockHit.getMaterial();
         
          //Get the itemstacks in each hand
          ItemStack leftStack = inventory.getStackInSlot(EnumMechaSlotType.leftTool);
          ItemStack rightStack = inventory.getStackInSlot(EnumMechaSlotType.rightTool);
         
View Full Code Here

          int zTile = raytraceResult.blockZ;
          if(FlansMod.DEBUG)
            worldObj.spawnEntityInWorld(new EntityDebugDot(worldObj, new Vector3f(raytraceResult.hitVec.xCoord, raytraceResult.hitVec.yCoord, raytraceResult.hitVec.zCoord), 1000, 0F, 1F, 0F));

          Block block = worldObj.getBlock(xTile, yTile, zTile);
          Material mat = block.getMaterial();
          //If the bullet breaks glass, and can do so according to FlansMod, do so.
          if(type.breaksGlass && mat == Material.glass)
          {
            if(TeamsManager.canBreakGlass)
                        {
View Full Code Here

      }
      return r;
    }
    BlockWrapper result = buckets.inverse().get(new ItemWrapper(bucket));

    Material material = world.getBlock(x, y, z).getMaterial();
    boolean solid = !material.isSolid();
    if (world.isAirBlock(x, y, z) || solid) {
      if (!world.isRemote && solid && !material.isLiquid()) {
        world.func_147480_a(x, y, z, true);
      }
      r = world.setBlock(x, y, z, result.block, result.metadata, 3); // this can fail
      world.markBlockForUpdate(x, y, z);
    }
View Full Code Here

            for (int z = zS; z <= zL; ++z) {
              Chunk chunk = world.getChunkFromBlockCoords(x, z);
              int cX = x & 15, cZ = z & 15;
              for (int y = yS; y <= yL; ++y) {
                Block block = chunk.getBlock(cX, y, cZ);
                Material m = block.getMaterial();
                if (m == Material.grass || m == Material.ground || m == Material.clay || m == Material.snow
                    || m == Material.craftedSnow || m == Material.ice || m == Material.packedIce) {
                  if (chunk.func_150807_a(cX, y, cZ, Blocks.air, 0)) {
                    set.add(chunk);
                  }
                }
              }
            }
          }
        } else if (blockRaw.equals("*plants")) {
          for (int x = xS; x <= xL; ++x) {
            for (int z = zS; z <= zL; ++z) {
              Chunk chunk = world.getChunkFromBlockCoords(x, z);
              int cX = x & 15, cZ = z & 15;
              for (int y = yS; y <= yL; ++y) {
                Block block = chunk.getBlock(cX, y, cZ);
                Material m = block.getMaterial();
                if (m == Material.plants || m == Material.vine || m == Material.cactus || m == Material.leaves) {
                  if (chunk.func_150807_a(cX, y, cZ, Blocks.air, 0)) {
                    set.add(chunk);
                  }
                }
              }
            }
          }
        } else if (blockRaw.equals("*fire")) {
          for (int x = xS; x <= xL; ++x) {
            for (int z = zS; z <= zL; ++z) {
              Chunk chunk = world.getChunkFromBlockCoords(x, z);
              int cX = x & 15, cZ = z & 15;
              for (int y = yS; y <= yL; ++y) {
                Block block = chunk.getBlock(cX, y, cZ);
                Material m = block.getMaterial();
                if (m == Material.fire || m == Material.lava || block.isBurning(world, x, y, z)) {
                  if (chunk.func_150807_a(cX, y, cZ, Blocks.air, 0)) {
                    set.add(chunk);
                  }
                }
View Full Code Here

        if (displacements.containsKey(block))
        {
            return displacements.get(block);
        }

        Material material = block.getMaterial();
        if (material.blocksMovement() || material == Material.portal)
        {
            return false;
        }

        int density = getDensity(world, x, y, z);
View Full Code Here

                return true;
            }
            return false;
        }

        Material material = block.getMaterial();
        if (material.blocksMovement() || material == Material.portal)
        {
            return false;
        }

        int density = getDensity(world, x, y, z);
View Full Code Here

        if (displacements.containsKey(block))
        {
            return displacements.get(block);
        }

        Material material = block.getMaterial();
        if (material.blocksMovement()  ||
            material == Material.water ||
            material == Material.lava  ||
            material == Material.portal)
        {
            return false;
View Full Code Here

            this.motionX *= 0.699999988079071D;
            this.motionZ *= 0.699999988079071D;
        }

        Material material = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial();

        if (material.isLiquid() || material.isSolid()) {
            double d0 = (double) ((float) (MathHelper.floor_double(this.posY) + 1) - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))));

            if (this.posY < d0)
                this.setDead();
        }
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.