2016-08-03 04:01:47 +02:00
|
|
|
/*
|
|
|
|
* This file ("EmpowererHandler.java") is part of the Actually Additions mod for Minecraft.
|
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
|
|
|
* http://ellpeck.de/actaddlicense
|
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2017-01-01 16:23:26 +01:00
|
|
|
* © 2015-2017 Ellpeck
|
2016-08-03 04:01:47 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
package de.ellpeck.actuallyadditions.mod.recipe;
|
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2016-08-03 04:01:47 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
2016-08-03 19:01:12 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
|
2016-08-03 04:01:47 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
|
2016-08-03 19:01:12 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.util.RecipeUtil;
|
2018-06-24 02:44:47 +02:00
|
|
|
import net.minecraft.block.Block;
|
2016-08-31 20:47:12 +02:00
|
|
|
import net.minecraft.init.Blocks;
|
|
|
|
import net.minecraft.init.Items;
|
2018-06-24 02:44:47 +02:00
|
|
|
import net.minecraft.item.Item;
|
2016-08-03 04:01:47 +02:00
|
|
|
import net.minecraft.item.ItemStack;
|
2018-06-24 02:44:47 +02:00
|
|
|
import net.minecraft.item.crafting.Ingredient;
|
2016-08-31 20:47:12 +02:00
|
|
|
import net.minecraftforge.oredict.OreDictionary;
|
2018-06-24 02:44:47 +02:00
|
|
|
import net.minecraftforge.oredict.OreIngredient;
|
2016-08-03 04:01:47 +02:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public final class EmpowererHandler {
|
2016-08-03 04:01:47 +02:00
|
|
|
|
2016-08-03 19:01:12 +02:00
|
|
|
public static final ArrayList<EmpowererRecipe> MAIN_PAGE_RECIPES = new ArrayList<EmpowererRecipe>();
|
2016-09-17 12:03:03 +02:00
|
|
|
public static EmpowererRecipe recipeEmpoweredCanolaSeed;
|
2016-08-03 19:01:12 +02:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public static void init() {
|
|
|
|
addCrystalEmpowering(TheCrystals.REDSTONE, "dyeRed", Ingredient.fromItem(Items.NETHERBRICK), Ingredient.fromItem(Items.REDSTONE), Ingredient.fromItem(Items.BRICK));
|
|
|
|
addCrystalEmpowering(TheCrystals.LAPIS, "dyeCyan", Ingredient.fromItem(Items.PRISMARINE_SHARD), Ingredient.fromItem(Items.PRISMARINE_SHARD), Ingredient.fromItem(Items.PRISMARINE_SHARD));
|
|
|
|
addCrystalEmpowering(TheCrystals.DIAMOND, "dyeLightBlue", Ingredient.fromItem(Items.CLAY_BALL), Ingredient.fromItem(Items.CLAY_BALL), fromBlock(Blocks.CLAY));
|
|
|
|
addCrystalEmpowering(TheCrystals.IRON, "dyeGray", Ingredient.fromItem(Items.SNOWBALL), fromBlock(Blocks.STONE_BUTTON), fromBlock(Blocks.COBBLESTONE));
|
2016-08-31 20:47:12 +02:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
addCrystalEmpowering(TheCrystals.COAL, "dyeBlack", igd(new ItemStack(Items.COAL, 1, 1)), Ingredient.fromItem(Items.FLINT), fromBlock(Blocks.STONE));
|
2016-08-31 20:47:12 +02:00
|
|
|
|
|
|
|
List<ItemStack> balls = OreDictionary.getOres("slimeball");
|
2018-06-24 02:44:47 +02:00
|
|
|
for (ItemStack ball : balls) {
|
|
|
|
addCrystalEmpowering(TheCrystals.EMERALD, "dyeLime", igd(new ItemStack(Blocks.TALLGRASS, 1, 1)), igd(new ItemStack(Blocks.SAPLING)), igd(ball.copy()));
|
2016-08-03 04:01:47 +02:00
|
|
|
}
|
2016-09-13 20:40:26 +02:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
Ingredient seed = Ingredient.fromItem(InitItems.itemCanolaSeed);
|
|
|
|
ActuallyAdditionsAPI.addEmpowererRecipe(Ingredient.fromStacks(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal())), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.EMPOWERED_CANOLA_SEED.ordinal()), seed, seed, seed, seed, 1000, 30, new float[] { 1F, 91F / 255F, 76F / 255F });
|
2016-09-17 12:03:03 +02:00
|
|
|
recipeEmpoweredCanolaSeed = RecipeUtil.lastEmpowererRecipe();
|
2016-08-03 04:01:47 +02:00
|
|
|
}
|
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
private static void addCrystalEmpowering(TheCrystals type, String dye, Ingredient modifier1, Ingredient modifier2, Ingredient modifier3) {
|
2016-08-31 20:47:12 +02:00
|
|
|
float[] color = type.conversionColorParticles;
|
2016-10-29 12:29:13 +02:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
ActuallyAdditionsAPI.addEmpowererRecipe(Ingredient.fromStacks(new ItemStack(InitItems.itemCrystal, 1, type.ordinal())), new ItemStack(InitItems.itemCrystalEmpowered, 1, type.ordinal()), new OreIngredient(dye), modifier1, modifier2, modifier3, 5000, 50, color);
|
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastEmpowererRecipe());
|
|
|
|
ActuallyAdditionsAPI.addEmpowererRecipe(Ingredient.fromStacks(new ItemStack(InitBlocks.blockCrystal, 1, type.ordinal())), new ItemStack(InitBlocks.blockCrystalEmpowered, 1, type.ordinal()), new OreIngredient(dye), modifier1, modifier2, modifier3, 50000, 500, color);
|
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastEmpowererRecipe());
|
|
|
|
}
|
|
|
|
|
|
|
|
private static Ingredient igd(ItemStack s) {
|
|
|
|
return Ingredient.fromStacks(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static Ingredient fromBlock(Block b) {
|
|
|
|
return Ingredient.fromItem(Item.getItemFromBlock(b));
|
2016-08-31 20:47:12 +02:00
|
|
|
}
|
2016-08-03 04:01:47 +02:00
|
|
|
}
|