Package net.minecraft.block

Examples of net.minecraft.block.Block


        if (name == null) return 0;

        int index = name.indexOf(':');

        if (index != -1 && index != 0 && index != name.length() - 1) {
            Block block = Block.getBlockFromName(name);
            if (block != null) {
                return Block.getIdFromBlock(block);
            }
        }
View Full Code Here


        if (notifyAndLight) {
            world.func_147451_t(x, y, z);
            world.markBlockForUpdate(x, y, z);
            world.notifyBlockChange(x, y, z, Block.getBlockById(previousId));

            Block mcBlock = Block.getBlockById(previousId);
            if (mcBlock != null && mcBlock.hasComparatorInputOverride()) {
                world.func_147453_f(x, y, z, Block.getBlockById(block.getId()));
            }
        }

        return successful;
View Full Code Here

public class Util
{
  public static boolean isBlockUnbreakable(World world, int x, int y, int z)
  {
    Block b = Block.blocksList[world.getBlockId(x, y, z)];
    return b instanceof BlockFluid || b.getBlockHardness(world, x, y, z) < 0;
  }
View Full Code Here

  /* FLUID FUNCTIONS */
  public static final int getDensity(IBlockAccess world, int x, int y, int z)
  {

    Block block = Block.blocksList[world.getBlockId(x, y, z)];
    if(!(block instanceof BlockFluidRoot))
    {
      return Integer.MAX_VALUE;
    }
    return ((BlockFluidRoot) block).density;
View Full Code Here

  @SideOnly(Side.CLIENT)
  public static double getFlowDirection(IBlockAccess world, int x, int y, int z)
  {

    Block block = Block.blocksList[world.getBlockId(x, y, z)];
    if(!(Block.blocksList[world.getBlockId(x, y, z)] instanceof BlockFluidRoot))
    {
      return -1000.0;
    }
    Vec3 vec = ((BlockFluidRoot) block).getFlowVector(world, x, y, z);
View Full Code Here

    }

    @Override
    public HashMap<BlockTuple, BlockTuple> getBlockTransformation(World w, int x, int y, int z) {

        Block block = w.getBlock(x, y, z);
        int meta = w.getBlockMetadata(x, y, z);
        if (!fireResults.containsKey(new BlockTuple(block, meta))) {
            Block result = null;
            int resultMeta = 0;

            ArrayList<ItemStack> drops = block.getDrops(w, x, y, z, meta, 0);
            if (drops.size() > 0 && (drops.size() == 1 || allEqual(drops))) {
View Full Code Here

  public static int getSurfaceBlockY(World world, int x, int z) {

    int y = world.getChunkFromBlockCoords(x, z).getTopFilledSegment() + 16;

    Block block;
    do {
      if (--y <= 0) {
        break;
      }
      block = world.getBlock(x, y, z);
    } while (block.isAir(world, x, y, z) || block.isReplaceable(world, x, y, z) || block.isLeaves(world, x, y, z)
        || block.isFoliage(world, x, y, z) || block.canBeReplacedByLeaves(world, x, y, z));
    return y;
  }
View Full Code Here

  public static int getTopBlockY(World world, int x, int z) {

    int y = world.getChunkFromBlockCoords(x, z).getTopFilledSegment() + 16;

    Block block;
    do {
      if (--y <= 0) {
        break;
      }
      block = world.getBlock(x, y, z);
    } while (block.isAir(world, x, y, z));
    return y;
  }
View Full Code Here

            int var1 = par0ItemStack.getItem().itemID;
            Item var2 = par0ItemStack.getItem();

            if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[var1] != null)
            {
                Block var3 = Block.blocksList[var1];

                if (var3 == Block.woodSingleSlab)
                {
                    return 150;
                }
View Full Code Here

    if(blockIdToBePlaced == null) {
      return null;
    }

    Block block = world.getBlock(x, y, z);

    if(block == Blocks.snow_layer && (world.getBlockMetadata(x, y, z) & 7) < 1) {
      side = 1;
    } else if(block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush
        && (block == null || !block.isReplaceable(world, x, y, z))) {

      if(side == 0) {
        --y;
      } else if(side == 1) {
        ++y;
View Full Code Here

TOP

Related Classes of net.minecraft.block.Block

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.