2016-01-05 04:47:35 +01:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("LensRecipeHandler.java") is part of the Actually Additions mod for Minecraft.
|
2016-01-05 04:47:35 +01:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2016-01-05 04:47:35 +01:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2017-01-01 16:23:26 +01:00
|
|
|
* © 2015-2017 Ellpeck
|
2016-01-05 04:47:35 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
package de.ellpeck.actuallyadditions.mod.items.lens;
|
|
|
|
|
|
|
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
2016-05-05 19:50:59 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.ColorLensChangerByDyeMeta;
|
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger;
|
2016-05-14 13:51:18 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe;
|
2016-01-05 04:47:35 +01: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;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
|
2016-03-18 18:41:37 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.util.RecipeUtil;
|
2016-01-05 04:47:35 +01:00
|
|
|
import net.minecraft.init.Blocks;
|
|
|
|
import net.minecraft.init.Items;
|
2016-05-05 19:50:59 +02:00
|
|
|
import net.minecraft.item.Item;
|
2016-01-05 04:47:35 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
2016-06-17 23:50:38 +02:00
|
|
|
public final class LensRecipeHandler{
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2016-06-17 23:50:38 +02:00
|
|
|
public static final ArrayList<LensConversionRecipe> MAIN_PAGE_RECIPES = new ArrayList<LensConversionRecipe>();
|
2016-05-14 13:51:18 +02:00
|
|
|
public static LensConversionRecipe recipeColorLens;
|
|
|
|
public static LensConversionRecipe recipeSoulSand;
|
|
|
|
public static LensConversionRecipe recipeGreenWall;
|
|
|
|
public static LensConversionRecipe recipeWhiteWall;
|
|
|
|
public static LensConversionRecipe recipeExplosionLens;
|
|
|
|
public static LensConversionRecipe recipeDamageLens;
|
|
|
|
public static LensConversionRecipe recipeLeather;
|
|
|
|
public static LensConversionRecipe recipeNetherWart;
|
2016-08-31 20:47:12 +02:00
|
|
|
public static LensConversionRecipe recipePrismarine;
|
2016-09-11 14:51:52 +02:00
|
|
|
public static LensConversionRecipe recipeCrystallizedCanolaSeed;
|
2016-12-18 12:08:32 +01:00
|
|
|
public static LensConversionRecipe recipeItemLaser;
|
|
|
|
public static LensConversionRecipe recipeFluidLaser;
|
2016-01-05 04:47:35 +01:00
|
|
|
|
|
|
|
public static void init(){
|
|
|
|
//Crystal Blocks
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.REDSTONE_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.REDSTONE.ordinal()), 400);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.LAPIS_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.LAPIS.ordinal()), 400);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.DIAMOND_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), 600);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.EMERALD_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.EMERALD.ordinal()), 1000);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.COAL_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), 600);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.IRON_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), 800);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-01-05 04:47:35 +01:00
|
|
|
|
|
|
|
//Crystal Items
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.REDSTONE), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 40);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.DYE, 1, 4), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 40);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.DIAMOND), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 60);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.EMERALD), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), 100);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.COAL), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 60);
|
2016-06-17 23:50:38 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.IRON_INGOT), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 80);
|
2016-08-03 18:08:07 +02:00
|
|
|
MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe());
|
2016-01-05 04:47:35 +01:00
|
|
|
|
|
|
|
//Lenses
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new ItemStack(InitItems.itemColorLens), 5000);
|
2016-03-18 18:41:37 +01:00
|
|
|
recipeColorLens = RecipeUtil.lastReconstructorRecipe();
|
2016-11-30 17:05:49 +01:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemColorLens), new ItemStack(InitItems.itemExplosionLens), 5000);
|
|
|
|
recipeExplosionLens = RecipeUtil.lastReconstructorRecipe();
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemExplosionLens), new ItemStack(InitItems.itemDamageLens), 5000);
|
|
|
|
recipeDamageLens = RecipeUtil.lastReconstructorRecipe();
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemDamageLens), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), 5000);
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2016-12-18 12:08:32 +01:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelay), new ItemStack(InitBlocks.blockLaserRelayFluids), 2000);
|
|
|
|
recipeFluidLaser = RecipeUtil.lastReconstructorRecipe();
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelayFluids), new ItemStack(InitBlocks.blockLaserRelayItem), 2000);
|
|
|
|
recipeItemLaser = RecipeUtil.lastReconstructorRecipe();
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelayItem), new ItemStack(InitBlocks.blockLaserRelay), 2000);
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
//Misc
|
2016-11-30 17:05:49 +01:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.SAND), new ItemStack(Blocks.SOUL_SAND), 20000);
|
|
|
|
recipeSoulSand = RecipeUtil.lastReconstructorRecipe();
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.ROTTEN_FLESH), new ItemStack(Items.LEATHER), 8000);
|
|
|
|
recipeLeather = RecipeUtil.lastReconstructorRecipe();
|
2016-01-17 20:12:20 +01:00
|
|
|
|
2016-11-30 17:05:49 +01:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.RED_MUSHROOM), new ItemStack(Items.NETHER_WART), 150000);
|
|
|
|
recipeNetherWart = RecipeUtil.lastReconstructorRecipe();
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.QUARTZ), new ItemStack(Items.PRISMARINE_SHARD), 30000);
|
|
|
|
recipePrismarine = RecipeUtil.lastReconstructorRecipe();
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2016-09-11 14:51:52 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemCanolaSeed), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal()), 2000);
|
|
|
|
recipeCrystallizedCanolaSeed = RecipeUtil.lastReconstructorRecipe();
|
|
|
|
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.QUARTZ_BLOCK), new ItemStack(InitBlocks.blockTestifiBucksWhiteWall), 10);
|
2016-03-18 18:41:37 +01:00
|
|
|
recipeWhiteWall = RecipeUtil.lastReconstructorRecipe();
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.QUARTZ_BLOCK, 1, 1), new ItemStack(InitBlocks.blockTestifiBucksGreenWall), 10);
|
2016-03-18 18:41:37 +01:00
|
|
|
recipeGreenWall = RecipeUtil.lastReconstructorRecipe();
|
2016-05-05 19:50:59 +02:00
|
|
|
|
|
|
|
IColorLensChanger changer = new ColorLensChangerByDyeMeta();
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Items.DYE, changer);
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.WOOL), changer);
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_GLASS), changer);
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_GLASS_PANE), changer);
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_HARDENED_CLAY), changer);
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.CARPET), changer);
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(InitBlocks.blockColoredLamp), changer);
|
|
|
|
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(InitBlocks.blockColoredLampOn), changer);
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|
|
|
|
|
2016-05-14 13:51:18 +02:00
|
|
|
public static ArrayList<LensConversionRecipe> getRecipesFor(ItemStack input){
|
|
|
|
ArrayList<LensConversionRecipe> possibleRecipes = new ArrayList<LensConversionRecipe>();
|
2016-05-19 20:05:12 +02:00
|
|
|
for(LensConversionRecipe recipe : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES){
|
2016-10-30 17:13:46 +01:00
|
|
|
if(ItemUtil.areItemsEqual(recipe.inputStack, input, true)){
|
2016-01-05 04:47:35 +01:00
|
|
|
possibleRecipes.add(recipe);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return possibleRecipes;
|
|
|
|
}
|
|
|
|
}
|