Package net.minecraft.src

Examples of net.minecraft.src.Block


        int meta = blockAccess.getBlockMetadata(i, j, k);
        i += offset[0];
        j += offset[1];
        k += offset[2];
        int neighborID = blockAccess.getBlockId(i, j, k);
        Block neighbor = Block.blocksList[neighborID];
        if (exclude(blockAccess, neighbor, tileNum, i, j, k, face)) {
            return false;
        } else if (metamask != -1 && (blockAccess.getBlockMetadata(i, j, k) & ~metamask) != (meta & ~metamask)) {
            return false;
        }
        switch (connectType) {
            case CONNECT_BY_BLOCK:
                return neighborID == block.blockID;

            case CONNECT_BY_TILE:
                return neighbor.getBlockTexture(blockAccess, i, j, k, face) == tileNum;

            case CONNECT_BY_MATERIAL:
                return block.blockMaterial == neighbor.blockMaterial;

            default:
View Full Code Here


    } else if (!player.canPlayerEdit(x, y, z, side, item)) {
      return false;
    } else if (y == 255) {
      return false;
    } else if (world.canPlaceEntityOnSide(id, x, y, z, false, side, player, item)) {
      Block var12 = Block.blocksList[id];
      int var13 = this.getMetadata(item.getItemDamage());
      int var14 = Block.blocksList[id].onBlockPlaced(world, x, y, z, side, xOffset, yOffset, zOffset, var13);

      if (world.setBlock(x, y, z, id, var14, 3)) {
        if (world.getBlockId(x, y, z) == id) {
View Full Code Here

    String[] mappings = new String[Block.blocksList.length];
    int flags;

    for (flags = 0; flags < Block.blocksList.length; ++flags) {
      Block meta = Block.blocksList[flags];

      if (meta != null) {
        mappings[flags] = meta.getUnlocalizedName();
      }
    }

    this.matchBlocks = this.getIDList(properties, "matchBlocks", "block", mappings);
    this.matchTiles = this.getIDList(properties, "matchTiles");
View Full Code Here

    i += offset[0];
    j += offset[1];
    k += offset[2];
    int neighborID = blockAccess.getBlockId(i, j, k);
    int neighborMeta = blockAccess.getBlockMetadata(i, j, k);
    Block neighbor = Block.blocksList[neighborID];

    if (this.exclude(neighbor, face, neighborMeta)) {
      return false;
    } else {
      int orientation = getOrientationFromMetadata(block, metadata);
      int neighborOrientation = getOrientationFromMetadata(neighbor, neighborMeta);

      if ((orientation & -65536) != (neighborOrientation & -65536)) {
        return false;
      } else if (this.metadata != -1 && (orientation & 65535) != (neighborOrientation & 65535)) {
        return false;
      } else {
        if (face >= 0 && this.innerSeams) {
          int[] normal = NORMALS[face];

          if (!neighbor.shouldSideBeRendered(blockAccess, i + normal[0], j + normal[1], k + normal[2], face)) {
            return false;
          }
        }

        switch (this.connectType) {
          case 0:
            return neighborID == blockID;

          case 1:
            return neighbor.getBlockTexture(blockAccess, i, j, k, face) == icon;

          case 2:
            return block.blockMaterial == neighbor.blockMaterial;

          default:
View Full Code Here

    RenderPass.access$102(1);
    Arrays.fill(RenderPass.access$200(), -1);
    Arrays.fill(RenderPass.access$300(), -1);

    for (int i = 0; i < Block.blocksList.length; ++i) {
      Block block = Block.blocksList[i];

      if (block != null) {
        RenderPass.access$200()[i] = block.getRenderBlockPass();
      }
    }
  }
View Full Code Here

  @Override
  public void onLivingUpdate() {
    super.onLivingUpdate();
    int id = worldObj.getBlockId((int) posX, (int) posY - 1, (int) posZ);
    Block b = Block.blocksList[id];
    if (id != 0 && b.blockMaterial != null && !inventory.contains(b.blockID))
      if (b.blockMaterial.isHarvestable()) {
        inventory.add(b.blockID);
        worldObj.setBlock((int) posX, (int) posY - 1, (int) posZ, 0);
        List l = CraftingManager.getInstance().getRecipeList();
View Full Code Here

      Item i = new ItemIngot(mod_Dragon.LAST_ID + x).setItemName(oreList[x].toLowerCase()
          + "Ingot");
      if (x != 3) {
        int m = ModLoader.addOverride("/terrain.png",
            "/dragons/ores/" + oreList[x].toLowerCase() + ".png");
        Block b = new BlockOre(150 + x, m, Material.rock).setBlockName("ore" + oreList[x]);
        ModLoader.addName(b, oreList[x] + " Ore");
        ModLoader.registerBlock(b);
        ores.add(b);
        ModLoader.addSmelting(b.blockID, new ItemStack(i.shiftedIndex, 1, 0));
      }
View Full Code Here

                flag1 = true;
            }

            if (Item.itemsList[i] != null && (Item.itemsList[i] instanceof ItemBlock))
            {
                Block block = Block.blocksList[i];
                int l = block.idDropped(j, thePlayer.worldObj.rand, 0);

                if (l > 0)
                {
                    i = l;
                }
View Full Code Here

  protected void setLeafBlock(World world, final int x, int y, int z)
  {
    if (!world.getChunkProvider().chunkExists(x >> 4, z >> 4))
      return;

    final Block block = Block.blocksList[world.getBlockId(x, y, z)];

    if (block == null
        || block.canBeReplacedByLeaves(world, x, y, z))
      setBlockAndMetadata(world, x, y, z, blockLeaf, metaLeaf);
  }
View Full Code Here

TOP

Related Classes of net.minecraft.src.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.