@Override
  public void generate(
      Random random,
      int chunkX,
      int chunkZ,
      World world,
      IChunkProvider chunkGenerator,
      IChunkProvider chunkProvider) {

    chunkX *= 16;
    chunkZ *= 16;

    if (!skipPlants && this.generateIn(world, false)) {

      for (int i = 0; i < TieredPlants.list.length; i++) {
        TieredPlants p = TieredPlants.list[i];
        boolean flag = false;
        if (random.nextInt(p.getGenerationChance()) == 0) {
          int n = p.getGenerationCount();
          for (int k = 0; k < n; k++) {
            int posX = chunkX + random.nextInt(16);
            int posZ = chunkZ + random.nextInt(16);
            Coordinate c = p.generate(world, posX, posZ, random);
            if (c != null) {
              c.setBlock(world, p.getBlock(), p.ordinal());
            }
          }
        }
      }
    }

    if (!skipOres && this.generateIn(world, true)) {
      for (int i = 0; i < TieredOres.list.length; i++) {
        TieredOres p = TieredOres.list[i];
        boolean flag = false;
        if (random.nextInt(p.getGenerationChance()) == 0) {
          int n = p.getGenerationCount();
          for (int k = 0; k < n; k++) {
            int posX = chunkX + random.nextInt(16);
            int posZ = chunkZ + random.nextInt(16);
            flag |= p.generate(world, posX, posZ, random);
          }
        }
      }
    }

    skipOres = false;
    skipPlants = false;
  }
Ejemplo n.º 2
0
 @SideOnly(Side.CLIENT)
 private static void registerTexture(TieredOres t, WandCap cap) {
   cap.setTexture(
       DirectResourceManager.getResource(
           "Reika/ChromatiCraft/Textures/Wands/cap_"
               + t.name().toLowerCase(Locale.ENGLISH)
               + ".png"));
 }
Ejemplo n.º 3
0
  public static void addRecipes() {
    int i = -2;
    String ref =
        FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT
            ? ChromaDescriptions.getParentPage() + "thaum.xml"
            : "";
    for (TieredOres t : items.keySet()) {
      WandType wt = items.get(t);
      AspectList al = new AspectList();
      int n = t == TieredOres.FOCAL ? 2 : 1;
      al.add(Aspect.ORDER, 20 * n);
      Aspect a = wt.aspects.get(0);
      al.add(a, 50 * n);
      Object[] recipe = {"AAA", "A A", 'A', wt.raw};
      ShapedArcaneRecipe ir = ThaumcraftApi.addArcaneCraftingRecipe("", wt.item, al, recipe);
      String id = "CAP_TIEREDCAP_" + t.name();
      String desc = "Novel caps";

      MathExpression cost =
          new MathExpression() {
            @Override
            public double evaluate(double arg) throws ArithmeticException {
              return arg / 5D;
            }

            @Override
            public double getBaseValue() {
              return 0;
            }

            @Override
            public String toString() {
              return "/5";
            }
          };

      ReikaThaumHelper.addArcaneRecipeBookEntryViaXML(
          id, desc, "chromaticraft", ir, cost, 2, i, ChromatiCraft.class, ref);
      i++;
    }
  }
Ejemplo n.º 4
0
 private TieredOreCap(TieredOres t) {
   super("TIEREDCAP_" + t.name(), 0.8F, items.get(t).aspects, 0.5F, items.get(t).item, 10);
 }