Examples of WeightedRandomBlock


Examples of cofh.lib.util.WeightedRandomBlock

      int z = zStart + rand.nextInt(zVar) - rand.nextInt(zVar);

      if ((!seeSky || world.canBlockSeeTheSky(x, y, z)) &&
          canGenerateInBlock(world, x, y - 1, z, onBlock) && canGenerateInBlock(world, x, y, z, genBlock)) {

        WeightedRandomBlock block = selectBlock(world, cluster);
        int stack = stackHeight > 1 ? rand.nextInt(stackHeight) : 0;
        do {
          if (!checkStay || block.block.canBlockStay(world, x, y, z))
            r |= world.setBlock(x, y, z, block.block, block.metadata, 2);
          ++y;
View Full Code Here

Examples of cofh.lib.util.WeightedRandomBlock

  private final int genVeinSize;
  private final boolean sparse;

  public WorldGenMinableLargeVein(ItemStack ore, int clusterSize) {

    this(new WeightedRandomBlock(ore), clusterSize);
  }
View Full Code Here

Examples of cofh.lib.util.WeightedRandomBlock

    this(resource, clusterSize, Blocks.stone);
  }

  public WorldGenMinableLargeVein(ItemStack ore, int clusterSize, Block block) {

    this(new WeightedRandomBlock(ore, 1), clusterSize, block);
  }
View Full Code Here

Examples of cofh.lib.util.WeightedRandomBlock

  private final int genClusterSize;
  private final WeightedRandomBlock[] genBlock;

  public WorldGenSparseMinableCluster(ItemStack ore, int clusterSize) {

    this(new WeightedRandomBlock(ore), clusterSize);
  }
View Full Code Here

Examples of cofh.lib.util.WeightedRandomBlock

    this(resource, clusterSize, Blocks.stone);
  }

  public WorldGenSparseMinableCluster(ItemStack ore, int clusterSize, Block block) {

    this(new WeightedRandomBlock(ore, 1), clusterSize, block);
  }
View Full Code Here

Examples of cofh.lib.util.WeightedRandomBlock

  }

  public static final List<WeightedRandomBlock> fabricateList(Block resource) {

    List<WeightedRandomBlock> list = new ArrayList<WeightedRandomBlock>();
    list.add(new WeightedRandomBlock(new ItemStack(resource, 1, 0)));
    return list;
  }
View Full Code Here

Examples of cofh.lib.util.WeightedRandomBlock

  private final int genClusterSize;
  private final WeightedRandomBlock[] genBlock;

  public WorldGenMinableCluster(ItemStack ore, int clusterSize) {

    this(new WeightedRandomBlock(ore), clusterSize);
  }
View Full Code Here

Examples of cofh.lib.util.WeightedRandomBlock

    this(resource, clusterSize, Blocks.stone);
  }

  public WorldGenMinableCluster(ItemStack ore, int clusterSize, Block block) {

    this(new WeightedRandomBlock(ore, 1), clusterSize, block);
  }
View Full Code Here

Examples of cofh.lib.util.WeightedRandomBlock

    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;
      }
    }
View Full Code Here

Examples of cofh.lib.util.WeightedRandomBlock

    return false;
  }

  public static boolean generateBlock(World world, int x, int y, int z, List<WeightedRandomBlock> o) {

    WeightedRandomBlock ore = (WeightedRandomBlock) WeightedRandom.getRandomItem(world.rand, o);
    return world.setBlock(x, y, z, ore.block, ore.metadata, 2);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.