Package net.minecraft.block.material

Examples of net.minecraft.block.material.Material


  }

  @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 (!ToolCommons.isRightMaterial(mat, materialsShovel))
      return false;
    MovingObjectPosition block = ToolCommons.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
      return false;
View Full Code Here


    int meta = world.getBlockMetadata(x, y, z);

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

    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) {
      new ArrayList();

      if(!blk.canHarvestBlock(player, meta) || !isRightMaterial(mat, materialsListing))
        return;
View Full Code Here

  boolean isPlant(int x, int y, int z) {
    Block block = supertile.getWorldObj().getBlock(x, y, z);
    if(block == Blocks.grass || block == Blocks.leaves || block == Blocks.leaves2 || block instanceof BlockBush && !(block instanceof BlockCrops) && !(block instanceof BlockSapling))
      return false;

    Material mat = block.getMaterial();
    return mat != null && (mat == Material.plants || mat == Material.cactus || mat == Material.grass || mat == Material.leaves || mat == Material.gourd);
  }
View Full Code Here

  public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
    if(!isEnabled(stack))
      return false;

    World world = player.worldObj;
    Material mat = world.getBlock(x, y, z).getMaterial();
    if(!ToolCommons.isRightMaterial(mat, MATERIALS))
      return false;

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

          return par1ItemStack;

        if(!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
          return par1ItemStack;

        Material material = par2World.getBlock(i, j, k).getMaterial();
        int l = par2World.getBlockMetadata(i, j, k);

        if(material == Material.water && l == 0) {
          par2World.setBlockToAir(i, j, k);
          return par1ItemStack;
View Full Code Here

              World world = server.worldServerForDimension(worldId);

              Block srcBlock = world.getBlock(x, y, z);
              int srcMeta = world.getBlockMetadata(x, y, z);
              TileEntity tile = world.getTileEntity(x, y, z);
              Material mat = srcBlock.getMaterial();

              if(!sticky && tile == null && mat.getMaterialMobility() == 0 && srcBlock.getBlockHardness(world, x, y, z) != -1 && !srcBlock.isAir(world, x, y, z)) {
                Material destMat = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).getMaterial();
                if(world.isAirBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) || destMat.isReplaceable()) {
                  world.setBlock(x, y, z, Blocks.air);
                  world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, srcBlock, srcMeta, 1 | 2);
                  mappedPositions.put(s, getCoordsAsString(world.provider.dimensionId, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ));
                }
              }
View Full Code Here

            final World world = tileEntity.getWorldObj();
            final int x = tileEntity.xCoord;
            final int y = tileEntity.yCoord;
            final int z = tileEntity.zCoord;
            final Material material = world.getBlock(x, y + 1, z).getMaterial();
            final boolean canTrigger = material == Material.air;

            tileEntity.triggerNote(world, x, y, z);
            return new Object[]{canTrigger};
        }
View Full Code Here

        if(getFluidStack(itemstack) == null || !getFluidStack(itemstack).getFluid().canBePlacedInWorld())
        {
            return false;
        }
        else {
            Material material = world.getBlock(x, y, z).getMaterial();
            boolean flag = !material.isSolid();

            if(!world.isAirBlock(x, y, z) && !flag)
            {
                return false;
            }
            else {
                if(world.provider.isHellWorld && getFluidStack(itemstack).getFluid() == FluidRegistry.WATER)
                {
                    world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);

                    for(int l = 0; l < 8; l++)
                    {
                        world.spawnParticle("largesmoke", x + Math.random(), y + Math.random(), z + Math.random(), 0.0D, 0.0D, 0.0D);
                    }
                }
                else {
                    if(!world.isRemote && flag && !material.isLiquid())
                    {
                        world.func_147480_a(x, y, z, true);
                    }
                   
                    world.setBlock(x, y, z, MekanismUtils.getFlowingBlock(getFluidStack(itemstack).getFluid()), 0, 3);
View Full Code Here

            int i1 = EnchantmentHelper.getFortuneModifier(player);
            harvesters.set(player);
            this.dropBlockAsItem(world, x, y, z, meta, i1);
            harvesters.set(null);
            Material material = world.getBlock(x, y - 1, z).getMaterial();

            if (material.blocksMovement() || material.isLiquid())
            {
                world.setBlock(x, y, z, Blocks.flowing_water);
            }
        }
    }
View Full Code Here

        {
            return true;
        }
        else
        {
            final Material var5 = var4.getMaterial();
            return var5 == Material.water || var5 == Material.lava;
        }
    }
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.