Exemplo n.º 1
0
  private void installRecipes() {
    addRecipe(
        new ShapelessOreRecipe(
            new ItemStack(getJaffaItem(JaffaItem.lemons)), LEMON, LEMON, LEMON, LEMON));

    addRecipe(
        new ShapelessOreRecipe(
            new ItemStack(getJaffaItem(JaffaItem.oranges)), ORANGE, ORANGE, ORANGE, ORANGE));

    GameRegistry.addShapelessRecipe(
        new ItemStack(getJaffaItem(JaffaItem.plums)),
        new ItemStack(JaffasTrees.itemPlum),
        new ItemStack(JaffasTrees.itemPlum),
        new ItemStack(JaffasTrees.itemPlum),
        new ItemStack(JaffasTrees.itemPlum));

    GameRegistry.addShapelessRecipe(
        new ItemStack(getJaffaItem(JaffaItem.strawberries)),
        new ItemStack(bushesList().get(BushType.Strawberry).itemFruit),
        new ItemStack(bushesList().get(BushType.Strawberry).itemFruit),
        new ItemStack(bushesList().get(BushType.Strawberry).itemFruit),
        new ItemStack(bushesList().get(BushType.Strawberry).itemFruit));
    GameRegistry.addShapelessRecipe(
        new ItemStack(getJaffaItem(JaffaItem.raspberries)),
        new ItemStack(bushesList().get(BushType.Raspberry).itemFruit),
        new ItemStack(bushesList().get(BushType.Raspberry).itemFruit),
        new ItemStack(bushesList().get(BushType.Raspberry).itemFruit),
        new ItemStack(bushesList().get(BushType.Raspberry).itemFruit));

    GameRegistry.addSmelting(
        bushesList().get(BushType.Coffee).itemFruit,
        new ItemStack(getJaffaItem(JaffaItem.coffeeRoasted)),
        0.5F);

    RecipesBoard.addRecipe(
        getFruitStack(BushType.Paprika), new ItemStack(getJaffaItem(JaffaItem.paprikaChopped)));
    RecipesBoard.addRecipe(
        getFruitStack(BushType.Tomato), new ItemStack(getJaffaItem(JaffaItem.tomatoChopped)));

    if (!ModuleManager.isModuleEnabled(technic)) {
      GameRegistry.addRecipe(
          new ItemStack(blockFruitCollector),
          "IDI",
          "DRD",
          "IGI",
          'I',
          new ItemStack(Blocks.iron_block),
          'D',
          new ItemStack(Items.diamond),
          'R',
          new ItemStack(Blocks.redstone_torch),
          'G',
          new ItemStack(Blocks.gold_block));
    }

    installTreeSeedsRecipes();
    BushManager.installSeedRecipes();

    Recipes.addShapelessOreRecipe(
        new ItemStack(itemStick, 4),
        Recipes.WOOD_STICK,
        Recipes.WOOD_STICK,
        Recipes.WOOD_STICK,
        Recipes.WOOD_STICK,
        Items.slime_ball);
    GameRegistry.addRecipe(
        new ItemStack(itemRod), " S ", "ISI", " S ", 'S', itemStick, 'I', Items.iron_ingot);
    GameRegistry.addRecipe(
        new ItemStack(itemFruitPickerHead),
        "III",
        "WWW",
        " W ",
        'I',
        Items.iron_ingot,
        'W',
        new ItemStack(Blocks.wool, 1, ANY_DMG));
    GameRegistry.addRecipe(
        new ItemStack(itemFruitPicker),
        "H ",
        " R",
        'H',
        new ItemStack(itemFruitPickerHead),
        'R',
        new ItemStack(itemRod));

    Recipes.addMalletShapedRecipe(
        new ItemStack(getJaffaItem(JaffaItem.coconutPowder)), new ItemStack(itemCoconut));

    GameRegistry.addShapelessRecipe(
        new ItemStack(getItem(JaffaItem.browniesPastry)),
        getFruitStack(BushType.Peanuts),
        new ItemStack(getItem(JaffaItem.pastrySweet)),
        new ItemStack(getItem(JaffaItem.chocolate)));

    RecipesBoard.addRecipe(
        JaffasTrees.getFruitStack(BushType.Onion), new ItemStack(getItem(JaffaItem.onionSliced)));
    GameRegistry.addShapelessRecipe(
        new ItemStack(getJaffaItem(JaffaItem.bottleKetchup)),
        Items.sugar,
        getJaffaItem(JaffaItem.bottleEmpty),
        getFruitStack(BushType.Tomato),
        getFruitStack(BushType.Tomato));
    GameRegistry.addShapelessRecipe(
        new ItemStack(getItem(JaffaItem.bottleMustard)),
        getItem(JaffaItem.bottleEmpty),
        getFruit(BushType.Mustard),
        getFruit(BushType.Mustard));

    addPieRecipe(
        getFruit(BushType.Strawberry),
        pieStrawberryRaw,
        TilePie.PieType.STRAWBERRY,
        true,
        getItem(jamStrawberry));
    addPieRecipe(
        getFruit(BushType.Raspberry),
        pieRaspberryRaw,
        TilePie.PieType.RASPBERRY,
        true,
        getItem(jamRaspberry));
    addPieRecipe(null, pieVanillaRaw, TilePie.PieType.VANILLA, true, getItem(jamV));
    addPieRecipe(itemPlum, piePlumRaw, TilePie.PieType.PLUM, true, getItem(jamP));

    // new juice recipes
    Juices$.MODULE$.addRecipes();

    GameRegistry.addShapelessRecipe(
        new ItemStack(getItem(peanutsSugar)), Items.sugar, getFruit(BushType.Peanuts));
    GameRegistry.addRecipe(
        new ItemStack(getItem(pepperStuffedRaw)),
        "M",
        "P",
        'M',
        getItem(mincedMeat),
        'P',
        getFruit(BushType.Paprika));

    // raw mutton
    // pea         -> raw lamb with peas => lamb with peas (in tin) | + plate -> lamb with peas
    // (plate) + tin
    // tin
    GameRegistry.addRecipe(
        getItemStack(lambWithPeasInTinRaw),
        " M ",
        "PPP",
        " T ",
        'M',
        getItem(muttonRaw),
        'P',
        getFruit(BushType.Pea),
        'T',
        getItem(cakeTin));
    GameRegistry.addSmelting(getItem(lambWithPeasInTinRaw), getItemStack(lambWithPeasInTin), 5f);
    GameRegistry.addShapelessRecipe(
        getItemStack(lambWithPeas, 3),
        getItemStack(lambWithPeasInTin),
        getItem(plate),
        getItem(plate),
        getItem(plate));
    PersistentItemsCraftingHandler.AddPersistentItemRetuningNonJaffaItem(
        lambWithPeasInTin, false, getItem(cakeTin));

    // beans
    // chopped tomatoes   ->  raw beans with tomato sauce => baked beans with tomato sauce
    // dish
    GameRegistry.addRecipe(
        getItemStack(beansWithTomatoRaw),
        "B",
        "T",
        "D",
        'B',
        getFruit(BushType.Bean),
        'T',
        getItem(tomatoChopped),
        'D',
        getItem(woodenBowl));
    GameRegistry.addSmelting(getItem(beansWithTomatoRaw), getItemStack(beansWithTomato), 3f);

    addRecipe(
        new ShapedOreRecipe(
            getItemStack(tinDuckOrangeRaw),
            "OSO",
            "ODO",
            " T ",
            'D',
            getItem(duckRaw),
            'O',
            ORANGE,
            'S',
            Items.sugar,
            'T',
            getItem(cakeTin)));

    GameRegistry.addSmelting(getItem(tinDuckOrangeRaw), getItemStack(tinDuckOrange), 5f);
    GameRegistry.addShapelessRecipe(
        getItemStack(plateDuckOrange, 3),
        getItemStack(tinDuckOrange),
        getItem(plate),
        getItem(plate),
        getItem(plate));
    PersistentItemsCraftingHandler.AddPersistentItemRetuningNonJaffaItem(
        tinDuckOrange, false, getItem(cakeTin));

    GameRegistry.addShapelessRecipe(
        getItemStack(bananaInChocolate, 2), itemBanana, getItem(chocolate), itemBanana);

    addRecipe(
        new ShapedOreRecipe(
            getItemStack(fruitSalad), "FFF", " B ", 'B', getItem(woodenBowl), 'F', FRUIT));
    addRecipe(
        new ShapedOreRecipe(
            getItemStack(fruitSalad, 3),
            "FFF",
            "FFF",
            "BBB",
            'B',
            getItem(woodenBowl),
            'F',
            FRUIT));

    Recipes.addSoupRecipes(getFruit(BushType.Pea), soupPeaRaw, soupPeaCooked, false);
    Recipes.addSoupRecipes(getFruit(BushType.Tomato), soupTomatoRaw, soupTomatoCooked, false);

    Recipes.addOreRecipe(
        new ItemStack(ContentHolder.blockCoconutLamp, 2),
        "S",
        "C",
        'S',
        Recipes.STRING,
        'C',
        itemCoconut);
  }
Exemplo n.º 2
0
  @Mod.EventHandler
  @Override
  public void preLoad(FMLPreInitializationEvent event) {
    super.preLoad(event);
    BushManager.populateBushInfo();

    try {
      config.load();

      dummyLeaves = new BlockFruitLeavesDummy();

      debug = config.get(Configuration.CATEGORY_GENERAL, "debug", false).getBoolean(false);
      bonemealingAllowed =
          config.get(Configuration.CATEGORY_GENERAL, "bonemeal", true).getBoolean(true);

      for (int i = 0; i < leavesBlocksAllocated; i++) {
        leavesList.add(new LeavesInfo(i));
      }

      ItemBagPlanting.blackList()
          .loadFromString(
              config
                  .get(
                      Configuration.CATEGORY_GENERAL,
                      "plantingBagBlackList",
                      "",
                      "Planting bag will ignore these items. Format of item (separated by ',' or ';'): <id>[:meta]")
                  .getString());
      ItemBagPlanting.blackList().printToLog(Log);
      TileFruitCollector.fruitCollectorRange =
          config.get(Configuration.CATEGORY_GENERAL, "fruitCollectorRange", 16).getInt();
    } catch (Exception e) {
      FMLLog.log(Level.FATAL, e, "Mod Jaffas (trees) can't read config file.");
    } finally {
      config.save();
    }

    if (!ModuleManager.isModuleEnabled(ModulesEnum.trees)) return;

    creativeTab = new JaffaCreativeTab("jaffas.trees");
    guiHandler = new GuiHandlerTrees();
    NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler);

    JaffasRegistryHelper.registerTileEntity(TileFruitLeaves.class, "fruitLeaves");
    JaffasRegistryHelper.registerTileEntity(TileJaffaCrops.class, "jaffaCrops");

    CompostRegister.init();
    createItems();

    MinecraftForge.addGrassSeed(new ItemStack(itemUnknownSeeds), SEEDS_WEIGHT);

    installRecipes();

    // texture stuff
    proxy.registerRenderThings();

    registerForestryStuff();

    creativeTab.setup(ItemManager.getItem(JaffaItem.oranges));
    LanguageRegistry.instance()
        .addStringLocalization("itemGroup.jaffas.trees", "en_US", "Jaffas and more! Trees");
  }