mezz.jei.api.IJeiHelpers Java Examples

The following examples show how to use mezz.jei.api.IJeiHelpers. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AdvancedAggregatorRecipeMaker.java    From TofuCraftReload with MIT License 6 votes vote down vote up
public static List<SimpleRecipe> getRecipes(IJeiHelpers helpers)
{
  IStackHelper stackHelper = helpers.getStackHelper(); 
  List<SimpleRecipe> recipes = new ArrayList<>();
  
  for (AdvancedAggregatorRecipes recipe : AdvancedAggregatorRecipes.aggregatorRecipesList) {
  	List<List<ItemStack>> inputs = new ArrayList<>();
  	for (Object obj : recipe.inputItems) {
  		List<ItemStack> subinputs = stackHelper.toItemStackList(obj);
   	inputs.add(subinputs);
}
  	ItemStack output = recipe.resultItem;
  	SimpleRecipe newrecipe = new SimpleRecipe(inputs,output);
  	recipes.add(newrecipe);
     }
  return recipes;
}
 
Example #2
Source File: ElectrolyzerRecipeMaker.java    From AdvancedRocketry with MIT License 6 votes vote down vote up
public static List<ElectrolyzerWrapper> getMachineRecipes(IJeiHelpers helpers, Class clazz) {
	
	List<ElectrolyzerWrapper> list = new LinkedList<ElectrolyzerWrapper>();
	for(IRecipe rec : RecipesMachine.getInstance().getRecipes(clazz)) {
		list.add(new ElectrolyzerWrapper(rec));
	}
	
	List<ItemStack> output = new LinkedList<ItemStack>();
	output.add(new ItemStack(AdvancedRocketryItems.itemBucketHydrogen));
	output.add(new ItemStack(AdvancedRocketryItems.itemBucketOxygen));
	
	List<ItemStack> input = new LinkedList<ItemStack>();
	List<List<ItemStack>> finalInput  = new LinkedList<List<ItemStack>>();
	input.add(new ItemStack(Items.WATER_BUCKET));
	finalInput.add(input);
	
	IRecipe waterElectro = new RecipesMachine.Recipe(output, finalInput, 0, 0, null);
	
	list.add(new ElectrolyzerWrapper(waterElectro));
	
	return list;
}
 
Example #3
Source File: BarrelRecipeMaker.java    From Sakura_mod with MIT License 6 votes vote down vote up
public static List<BarrelRecipe> getRecipes(IJeiHelpers helpers){
  IStackHelper stackHelper = helpers.getStackHelper();

  List<BarrelRecipe> recipes = new ArrayList<BarrelRecipe>();

  for (Entry<FluidStack, Map<Object[], FluidStack>> entry : BarrelRecipes.RecipesList.entrySet()) {
  	for(Entry<Object[], FluidStack> entry2 : entry.getValue().entrySet()){
  	List<List<ItemStack>> inputs = new ArrayList<List<ItemStack>>();
  	List<List<FluidStack>> fluidlist=new ArrayList<List<FluidStack>>();
  	List<FluidStack> fluid = new ArrayList<FluidStack>();
  	
  	for (Object obj : entry2.getKey()) {
  		List<ItemStack> subinputs = stackHelper.toItemStackList(obj);
   	inputs.add(subinputs);
}
  	
   fluid.add(entry.getKey());
   fluidlist.add(fluid);
  	
  	BarrelRecipe newrecipe = new BarrelRecipe(inputs,fluidlist,entry2.getValue());
  	recipes.add(newrecipe);
  	}
  }
  return recipes;
}
 
Example #4
Source File: DistillationRecipeMaker.java    From Sakura_mod with MIT License 6 votes vote down vote up
public static List<BarrelRecipe> getRecipes(IJeiHelpers helpers){
  IStackHelper stackHelper = helpers.getStackHelper();

  List<BarrelRecipe> recipes = new ArrayList<BarrelRecipe>();

  for (Entry<FluidStack, Map<Object[], FluidStack>> entry : DistillationRecipes.RecipesList.entrySet()) {
  	for(Entry<Object[], FluidStack> entry2 : entry.getValue().entrySet()){
  	List<List<ItemStack>> inputs = new ArrayList<List<ItemStack>>();
  	List<List<FluidStack>> fluidlist=new ArrayList<List<FluidStack>>();
  	List<FluidStack> fluid = new ArrayList<FluidStack>();
  	
  	for (Object obj : entry2.getKey()) {
  		List<ItemStack> subinputs = stackHelper.toItemStackList(obj);
   	inputs.add(subinputs);
}
  	
   fluid.add(entry.getKey());
   fluidlist.add(fluid);
  	
  	BarrelRecipe newrecipe = new BarrelRecipe(inputs,fluidlist,entry2.getValue());
  	recipes.add(newrecipe);
  	}
  }
  return recipes;
}
 
Example #5
Source File: PotRecipeMaker.java    From Sakura_mod with MIT License 6 votes vote down vote up
public static List<ItemFluidRecipe> getRecipes(IJeiHelpers helpers) {
  IStackHelper stackHelper = helpers.getStackHelper();
  List<ItemFluidRecipe> recipes = new ArrayList<ItemFluidRecipe>();
  for (Entry<FluidStack, Map<Object[], ItemStack>> entry : PotRecipes.RecipesList.entrySet()) {
  	for(Entry<Object[], ItemStack> entry2 : entry.getValue().entrySet()){
  	List<List<ItemStack>> inputs = new ArrayList<List<ItemStack>>();
  	List<List<FluidStack>> fluidlist=new ArrayList<List<FluidStack>>();
  	List<FluidStack> fluid = new ArrayList<FluidStack>();
  	for (Object obj : entry2.getKey()) {
  		List<ItemStack> subinputs = stackHelper.toItemStackList(obj);
   	inputs.add(subinputs);
}
  	
   fluid.add(entry.getKey());
   fluidlist.add(fluid);
  	
  	ItemFluidRecipe newrecipe = new ItemFluidRecipe(inputs,fluidlist,entry2.getValue());
  	recipes.add(newrecipe);
  	}
  }
  return recipes;
  
}
 
Example #6
Source File: L2ISRecipeMaker.java    From Sakura_mod with MIT License 6 votes vote down vote up
public static List<ItemFluidRecipe> getRecipes(IJeiHelpers helpers) {
   IStackHelper stackHelper = helpers.getStackHelper();
   List<ItemFluidRecipe> recipes = new ArrayList<ItemFluidRecipe>();
   for (Entry<FluidStack, Map<Object, ItemStack>> entry : LiquidToItemRecipe.RecipesList.entrySet()) {
	for (Entry<Object, ItemStack> entry2 : entry.getValue().entrySet()) {
   	List<List<ItemStack>> inputs = new ArrayList<List<ItemStack>>();
   	List<ItemStack> main = stackHelper.toItemStackList(entry2.getKey());
   	List<List<FluidStack>> fluidlist=new ArrayList<List<FluidStack>>();
   	List<FluidStack> fluid = new ArrayList<FluidStack>();
   	
   	inputs.add(main);
    fluid.add(entry.getKey());
    fluidlist.add(fluid);
   	
   	ItemFluidRecipe newrecipe = new ItemFluidRecipe(inputs,fluidlist,entry2.getValue());
   	recipes.add(newrecipe);
	}
}
   return recipes;
   
 }
 
Example #7
Source File: BaseMetalsJEIPlugin.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void register(IModRegistry registry) {

	IItemRegistry itemRegistry = registry.getItemRegistry();
	IJeiHelpers jeiHelpers = registry.getJeiHelpers();
	IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
	
	registry.addRecipeCategories(new JEICrusherRecipeCategory(guiHelper));
	registry.addRecipeHandlers(new CrusherRecipeHandler());
	
	registry.addRecipes(CrusherRecipeRegistry.getInstance().getAllRecipes().stream()
			.map((ICrusherRecipe in)->new CrusherRecipeJEI(Arrays.asList(in.getValidInputs().toArray(new ItemStack[0])), in.getOutput()))
			.collect(Collectors.toList()));
}
 
Example #8
Source File: AggregatorRecipeMaker.java    From TofuCraftReload with MIT License 5 votes vote down vote up
public static List<SimpleRecipe> getRecipes(IJeiHelpers helpers)
{
  IStackHelper stackHelper = helpers.getStackHelper(); 
  List<SimpleRecipe> recipes = new ArrayList<SimpleRecipe>();

  for (Map.Entry<Object, ItemStack> entry : AggregatorRecipes.recipesList.entrySet()) {
Object input = entry.getKey();
ItemStack output = entry.getValue();
List<ItemStack> inputs = stackHelper.toItemStackList(input);
SimpleRecipe newrecipe = new SimpleRecipe(Collections.singletonList(inputs),output);
  	recipes.add(newrecipe);
     }
  return recipes;
}
 
Example #9
Source File: BlastFurnaceRecipeMaker.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public static List<BlastFurnaceWrapper> getMachineRecipes(IJeiHelpers helpers, Class clazz) {
	
	List<BlastFurnaceWrapper> list = new LinkedList<BlastFurnaceWrapper>();
	for(IRecipe rec : RecipesMachine.getInstance().getRecipes(clazz)) {
		list.add(new BlastFurnaceWrapper(rec));
	}
	return list;
}
 
Example #10
Source File: PlatePressRecipeMaker.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public static List<PlatePressWrapper> getMachineRecipes(IJeiHelpers helpers, Class clazz) {
	
	List<PlatePressWrapper> list = new LinkedList<PlatePressWrapper>();
	for(IRecipe rec : RecipesMachine.getInstance().getRecipes(clazz)) {
		list.add(new PlatePressWrapper(rec));
	}
	return list;
}
 
Example #11
Source File: RollingMachineRecipeMaker.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public static List<RollingMachineWrapper> getMachineRecipes(IJeiHelpers helpers, Class clazz) {
	
	List<RollingMachineWrapper> list = new LinkedList<RollingMachineWrapper>();
	for(IRecipe rec : RecipesMachine.getInstance().getRecipes(clazz)) {
		list.add(new RollingMachineWrapper(rec));
	}
	return list;
}
 
Example #12
Source File: CrystallizerRecipeMaker.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public static List<CrystallizerWrapper> getMachineRecipes(IJeiHelpers helpers, Class clazz) {
	
	List<CrystallizerWrapper> list = new LinkedList<CrystallizerWrapper>();
	for(IRecipe rec : RecipesMachine.getInstance().getRecipes(clazz)) {
		list.add(new CrystallizerWrapper(rec));
	}
	return list;
}
 
Example #13
Source File: LatheRecipeMaker.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public static List<LatheWrapper> getMachineRecipes(IJeiHelpers helpers, Class clazz) {
	
	List<LatheWrapper> list = new LinkedList<LatheWrapper>();
	for(IRecipe rec : RecipesMachine.getInstance().getRecipes(clazz)) {
		list.add(new LatheWrapper(rec));
	}
	return list;
}
 
Example #14
Source File: SawMillRecipeMaker.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public static List<SawMillWrapper> getMachineRecipes(IJeiHelpers helpers, Class clazz) {
	
	List<SawMillWrapper> list = new LinkedList<SawMillWrapper>();
	for(IRecipe rec : RecipesMachine.getInstance().getRecipes(clazz)) {
		list.add(new SawMillWrapper(rec));
	}
	return list;
}
 
Example #15
Source File: PrecisionAssemblerRecipeMaker.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public static List<PrecisionAssemblerWrapper> getMachineRecipes(IJeiHelpers helpers, Class clazz) {
	
	List<PrecisionAssemblerWrapper> list = new LinkedList<PrecisionAssemblerWrapper>();
	for(IRecipe rec : RecipesMachine.getInstance().getRecipes(clazz)) {
		list.add(new PrecisionAssemblerWrapper(rec));
	}
	return list;
}
 
Example #16
Source File: JEICyberwarePlugin.java    From Cyberware with MIT License 5 votes vote down vote up
@Override
public void register(IModRegistry registry)
{
	System.out.println("Augmenting JEI");
	
	IJeiHelpers jeiHelpers = registry.getJeiHelpers();
	//registry.addRecipeCategories(recipeCategories);
}
 
Example #17
Source File: CS4JEIPlugin.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void register(IModRegistry registry)
{
    IJeiHelpers jeiHelpers = registry.getJeiHelpers();

    addMachineRecipes(registry, jeiHelpers);
    addCraftingRecipes(registry, jeiHelpers);
    addDescriptions(registry);
}
 
Example #18
Source File: MachineRecipeWrapper.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
public MachineRecipeWrapper(MachineRecipe recipe, MachineRecipeOutput output, IJeiHelpers jeiHelpers)
{
    this.recipe = recipe;
    this.output = output;
    this.jeiHelpers = jeiHelpers;

    if (recipe.getCookTime() > 0)
        cookTimeString = I18n.format("gui.cs4.jei.machineRecipe.cookTime", recipe.getCookTime());
    else
        cookTimeString = "";
}
 
Example #19
Source File: JEICompat.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
public void register(IModRegistry registry) {
	IJeiHelpers jeiHelpers = registry.getJeiHelpers();
	IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
	
	registry.addRecipes(PotRecipeMaker.getRecipes(jeiHelpers),"sakura.cooking_pot");
	registry.addRecipes(MortarRecipeMaker.getRecipes(jeiHelpers),"sakura.mortar");
	registry.addRecipes(BarrelRecipeMaker.getRecipes(jeiHelpers),"sakura.barrel");
	registry.addRecipes(DistillationRecipeMaker.getRecipes(jeiHelpers),"sakura.distillation");
	registry.addRecipes(L2ISRecipeMaker.getRecipes(jeiHelpers),"sakura.liquid_item");

	registry.addRecipeClickArea(GuiCampfirePot.class, 91, 41, 28, 23,"sakura.cooking_pot");
	registry.addRecipeClickArea(GuiStoneMortar.class, 77, 32, 28, 23,"sakura.mortar");
	registry.addRecipeClickArea(GuiBarrel.class, 62, 33, 24, 21,"sakura.barrel");
	registry.addRecipeClickArea(GuiDistillation.class, 62, 33, 24, 21,"sakura.distillation");
	registry.addRecipeClickArea(GuiBarrel.class, 130, 29, 18, 21,"sakura.liquid_item");
	registry.addRecipeClickArea(GuiDistillation.class, 130, 29, 18, 21,"sakura.liquid_item");
	
	recipeTransferRegistry.addRecipeTransferHandler(ContainerCampfirePot.class,"sakura.cooking_pot", 0, 9, 10, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerStoneMortar.class,"sakura.mortar", 0, 4, 6, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerBarrel.class,"sakura.barrel", 0, 3, 5, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerDistillation.class,"sakura.distillation", 0, 3, 5, 36);

	registry.addRecipeCatalyst(new ItemStack(ItemLoader.POT),"sakura.cooking_pot");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.STONEMORTAR),"sakura.mortar");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.BARREL),"sakura.barrel");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.BARREL_DISTILLATION),"sakura.distillation");
	
}
 
Example #20
Source File: CrusherRecipeMaker.java    From TofuCraftReload with MIT License 5 votes vote down vote up
public static List<SimpleRecipe> getRecipes(IJeiHelpers helpers)
{
  IStackHelper stackHelper = helpers.getStackHelper(); 
  List<SimpleRecipe> recipes = new ArrayList<SimpleRecipe>();

  for (Map.Entry<Object, ItemStack> entry : CrasherRecipes.recipesList.entrySet()) {
Object input = entry.getKey();
ItemStack output = entry.getValue();
List<ItemStack> inputs = stackHelper.toItemStackList(input);
SimpleRecipe newrecipe = new SimpleRecipe(Collections.singletonList(inputs),output);
  	recipes.add(newrecipe);
     }
  return recipes;
}
 
Example #21
Source File: JEICompat.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
public void register(IModRegistry registry) {
	IJeiHelpers jeiHelpers = registry.getJeiHelpers();
	IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
	
	registry.addRecipes(CrusherRecipeMaker.getRecipes(jeiHelpers),"tofucraft.crusher");
	registry.addRecipes(CompressorRecipeMaker.getRecipes(jeiHelpers),"tofucraft.compressor");
	registry.addRecipes(AggregatorRecipeMaker.getRecipes(jeiHelpers),"tofucraft.aggregator");
	registry.addRecipes(AdvancedAggregatorRecipeMaker.getRecipes(jeiHelpers),"tofucraft.advanced_aggregator");

	registry.addRecipeClickArea(GuiTFCrasher.class, 68,15, 28, 17,"tofucraft.crusher");
	registry.addRecipeClickArea(GuiTFCompressor.class, 68,15, 28, 17,"tofucraft.compressor");
	registry.addRecipeClickArea(GuiTFAggreagator.class, 73,31, 30, 20,"tofucraft.aggregator");
	registry.addRecipeClickArea(GuiTFAdvancedAggreagator.class, 80,27, 30, 20,"tofucraft.advanced_aggregator");
	registry.addRecipeClickArea(GuiTFOven.class, 68,15, 28, 17,VanillaRecipeCategoryUid.SMELTING);

	recipeTransferRegistry.addRecipeTransferHandler(ContainerTFCrasher.class,"tofucraft.crusher", 0, 1, 2, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerTFCompressor.class,"tofucraft.compressor", 0, 1, 2, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerTFAggregator.class,"tofucraft.aggregator", 0, 1, 2, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerTFAdvancedAggregator.class,"tofucraft.advanced_aggregator", 0, 4, 5, 36);
	recipeTransferRegistry.addRecipeTransferHandler(ContainerTFOven.class,VanillaRecipeCategoryUid.SMELTING, 0, 1, 2, 36);
	
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.TFCRASHER),"tofucraft.crusher");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.TFCOMPRESSOR),"tofucraft.compressor");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.TFAGGREGATOR),"tofucraft.aggregator");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.TFAdvancedAGGREGATOR),"tofucraft.advanced_aggregator");
	registry.addRecipeCatalyst(new ItemStack(BlockLoader.TFOVEN),VanillaRecipeCategoryUid.SMELTING);
}
 
Example #22
Source File: CompressorRecipeMaker.java    From TofuCraftReload with MIT License 5 votes vote down vote up
public static List<SimpleRecipe> getRecipes(IJeiHelpers helpers)
{
  IStackHelper stackHelper = helpers.getStackHelper(); 
  List<SimpleRecipe> recipes = new ArrayList<SimpleRecipe>();

  for (Map.Entry<Object, ItemStack> entry : CompressorRecipes.recipesList.entrySet()) {
Object input = entry.getKey();
ItemStack output = entry.getValue();
List<ItemStack> inputs = stackHelper.toItemStackList(input);
SimpleRecipe newrecipe = new SimpleRecipe(Collections.singletonList(inputs),output);
  	recipes.add(newrecipe);
     }
  return recipes;
}
 
Example #23
Source File: ShapedRecipeWrapper.java    From customstuff4 with GNU General Public License v3.0 4 votes vote down vote up
public ShapedRecipeWrapper(DamageableShapedOreRecipe recipe, IJeiHelpers jeiHelpers)
{
    this.jeiHelpers = jeiHelpers;
    this.recipe = recipe;
}
 
Example #24
Source File: ShapelessRecipeWrapper.java    From customstuff4 with GNU General Public License v3.0 4 votes vote down vote up
public ShapelessRecipeWrapper(DamageableShapelessOreRecipe recipe, IJeiHelpers jeiHelpers)
{
    this.jeiHelpers = jeiHelpers;
    this.recipe = recipe;
}
 
Example #25
Source File: MultiblockInfoCategory.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
public MultiblockInfoCategory(IJeiHelpers helpers) {
    this.background = helpers.getGuiHelper().createBlankDrawable(176, 166);
    ResourceLocation iconLocation = new ResourceLocation(GTValues.MODID, "textures/gui/icon/coke_oven.png");
    this.icon = helpers.getGuiHelper().createDrawable(iconLocation, 0, 0, 16, 16, 16, 16);
}
 
Example #26
Source File: CustomItemReturnRecipeWrapper.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
public CustomItemReturnRecipeWrapper(IJeiHelpers jeiHelpers, CustomItemReturnShapedOreRecipeRecipe recipe) {
    super(jeiHelpers, recipe);
    this.customRecipe = recipe;
    this.craftingGridHelper = new CraftingGridHelper(craftInputSlot1, craftOutputSlot);
}
 
Example #27
Source File: ChemicalReactorRecipeMaker.java    From AdvancedRocketry with MIT License 3 votes vote down vote up
public static List<ChemicalReactorlWrapper> getMachineRecipes(IJeiHelpers helpers, Class clazz) {
	
	List<ChemicalReactorlWrapper> list = new LinkedList<ChemicalReactorlWrapper>();
	for(IRecipe rec : RecipesMachine.getInstance().getRecipes(clazz)) {
		list.add(new ChemicalReactorlWrapper(rec));
	}
	
	List<ItemStack> input = new LinkedList<ItemStack>();
	input.add(new ItemStack(AdvancedRocketryItems.itemBucketHydrogen));
	
	
	
	List<List<ItemStack>> finalInput  = new LinkedList<List<ItemStack>>();
	finalInput.add(input);
	input = new LinkedList<ItemStack>();
	input.add(new ItemStack(AdvancedRocketryItems.itemBucketOxygen));
	finalInput.add(input);
	
	List<ItemStack> output = new LinkedList<ItemStack>();
	output.add(new ItemStack(AdvancedRocketryItems.itemBucketRocketFuel));
	
	
	IRecipe rocketFuel = new RecipesMachine.Recipe(output, finalInput, 0, 0, null);
	
	list.add(new ChemicalReactorlWrapper(rocketFuel));
	
	return list;
}