Package net.minecraft.block

Examples of net.minecraft.block.Block


    return var6;
  }

  // Copied from ItemInWorldManager, seems to do the trick.
  private boolean removeBlock(int par1, int par2, int par3) {
    Block var4 = worldObj.getBlock(par1, par2, par3);
    int var5 = worldObj.getBlockMetadata(par1, par2, par3);

    if (var4 != null)
      var4.onBlockHarvested(worldObj, par1, par2, par3, var5, player);

    boolean var6 = var4 != null && var4.removedByPlayer(worldObj, player, par1, par2, par3);

    if (var4 != null && var6)
      var4.onBlockDestroyedByPlayer(worldObj, par1, par2, par3, var5);

    return var6;
  }
View Full Code Here


    int obsidianFound = 0;
    for (int i = 0; true; i++) {
      if (y + i >= 256)
        return -1;

      Block id = worldObj.getBlock(x, y + i, z);
      int meta = worldObj.getBlockMetadata(x, y + i, z);
      if (id == ConfigBlocks.blockCosmeticSolid && meta == 0) {
        ++obsidianFound;
        continue;
      }
View Full Code Here

          IAppEngApi api = AEApi.instance();

          //Prevent the passenger from popping off. Not sent to clients.
          worldObj.setBlock(targetX, yCoord, targetZ, Block.getBlockFromName("stone"), 0, 0);
          //Move non-TE blocks
          Block passengerId = worldObj.getBlock(xCoord, yCoord + 1, zCoord);

          if (worldObj.isAirBlock(xCoord, yCoord + 1, zCoord) || passengerId.canPlaceBlockAt(worldObj, targetX, yCoord + 1, targetZ)) {

            if (passenger == null) {
              if (passengerId != Block.getBlockFromName("bedrock") && passengerId != Block.getBlockFromName("")) {
                worldObj.setBlock(targetX, yCoord + 1, targetZ, passengerId, worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord), 3);
                if (passengerId != Block.getBlockFromName("air") && passengerId != Block.getBlockFromName("piston_head")) {
View Full Code Here

      if (!canGenerateInBiome(world, x, z, random))
        continue;

      int y = BlockHelper.getTopBlockY(world, x, z);
      l: {
        Block block = world.getBlock(x, y, z);
        if (!block.isAir(world, x, y, z)) {

          for (WeightedRandomBlock mat : matList) {
            if (block.isReplaceableOreGen(world, x, y, z, mat.block)) {
              break l;
            }
          }
        }
        continue;
View Full Code Here

      if (!canGenerateInBiome(world, x, z, random))
        continue;

      int y = BlockHelper.getSurfaceBlockY(world, x, z);
      l: {
        Block block = world.getBlock(x, y, z);
        if (!block.isAir(world, x, y, z)) {

          for (WeightedRandomBlock mat : matList) {
            if (block.isReplaceableOreGen(world, x, y, z, mat.block)) {
              break l;
            }
          }
        }
        continue;
View Full Code Here

          if (fluid == null)
            continue;
          if (Arrays.binarySearch(fluidList, fluid.getID()) < 0)
            continue;
        }
        Block block = world.getBlock(x, y, z);
        if (!block.isAir(world, x, y, z)) {

          for (WeightedRandomBlock mat : matList) {
            if (block.isReplaceableOreGen(world, x, y, z, mat.block)) {
              break l;
            }
          }
        }
        continue;
View Full Code Here

    return fluid == null ? 0 : fluid.getLuminosity();
  }

  public static FluidStack getFluidFromWorld(World world, int x, int y, int z) {

    Block bId = world.getBlock(x, y, z);
    int bMeta = world.getBlockMetadata(x, y, z);

    if (Block.isEqualTo(bId, Blocks.water)) {
      if (bMeta == 0) {
        return WATER.copy();
View Full Code Here

      } catch (Throwable t) {
        Log.warn(t, "Failed to map class %s to name", cls);
      }

      try {
        Block block = te.getBlockType();
        if (block != null) {
          int dmg = te.getBlockMetadata();

          ItemStack is = new ItemStack(block, 1, dmg);
          try {
            String name = is.getDisplayName();
            if (!Strings.isNullOrEmpty(name)) return name;
          } catch (Throwable t) {
            Log.warn(t, "Can't get display name for %s", cls);
          }

          try {
            String name = StringUtils.removeStart(block.getUnlocalizedName(), "tile.");
            if (!Strings.isNullOrEmpty(name)) return name;
          } catch (Throwable t) {
            Log.warn(t, "Can't get unlocalized name for %s", cls);
          }
View Full Code Here

  public static boolean canGenerateInBlock(World world, int x, int y, int z, WeightedRandomBlock[] mat) {

    if (mat == null || mat.length == 0)
      return true;

    Block block = world.getBlock(x, y, z);
    for (int j = 0, e = mat.length; j < e; ++j) {
      WeightedRandomBlock genBlock = mat[j];
      if ((-1 == genBlock.metadata || genBlock.metadata == world.getBlockMetadata(x, y, z)) &&
          (block.isReplaceableOreGen(world, x, y, z, genBlock.block) || block.isAssociatedBlock(genBlock.block))) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

  }

  public static void renderTextureAsBlock(RenderBlocks renderer, IIcon texture, double translateX, double translateY, double translateZ) {

    Tessellator tessellator = Tessellator.instance;
    Block block = Blocks.stone;

    if (texture == null) {
      return;
    }
    renderer.setRenderBoundsFromBlock(block);
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.