本文整理汇总了Java中ic2.api.recipe.IRecipeInput类的典型用法代码示例。如果您正苦于以下问题:Java IRecipeInput类的具体用法?Java IRecipeInput怎么用?Java IRecipeInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRecipeInput类属于ic2.api.recipe包,在下文中一共展示了IRecipeInput类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scan
import ic2.api.recipe.IRecipeInput; //导入依赖的package包/类
@Override
public void scan() {
Map<IRecipeInput, RecipeOutput> recipeMap = Maps.newHashMap();
recipeMap.putAll(Recipes.metalformerCutting.getRecipes());
recipeMap.putAll(Recipes.metalformerExtruding.getRecipes());
recipeMap.putAll(Recipes.metalformerRolling.getRecipes());
for (Map.Entry<IRecipeInput, RecipeOutput> entry : recipeMap.entrySet()) {
IStackWrapper input = IC2ClassHelper.convert(entry.getKey());
for (ItemStack itemStack : entry.getValue().items) {
if (input instanceof VanillaStackWrapper) {
addRecipe(new VanillaStackWrapper(itemStack), (VanillaStackWrapper) input);
} else if (input instanceof OreStackWrapper) {
for (ItemStack oreStack : OreDictionary.getOres(((OreStackWrapper) input).getOreTag())) {
addRecipe(new VanillaStackWrapper(itemStack), new VanillaStackWrapper(oreStack));
}
}
}
}
}
示例2: addEntryToMap
import ic2.api.recipe.IRecipeInput; //导入依赖的package包/类
private static void addEntryToMap(Entry<IRecipeInput, RecipeOutput> entry)
{
List<ItemStack> recipeStackOutputs = entry.getValue().items;
if (!(recipeStackOutputs.size() > 1))
{
ItemStack recipeOutput = recipeStackOutputs.get(0);
if (recipeOutput != null)
{
WrappedStack stackOutput = getWrappedStack(recipeOutput);
List<ItemStack> recipeStackInputs = entry.getKey().getInputs();
for (ItemStack recipeInput : recipeStackInputs)
{
if (recipeInput != null)
{
recipeInput.stackSize = entry.getKey().getAmount();
WrappedStack stackInput = new WrappedStack(recipeInput);
Ic2Recipes.put(stackOutput, Arrays.asList(stackInput));
}
}
}
}
}
示例3: processRecipes
import ic2.api.recipe.IRecipeInput; //导入依赖的package包/类
private void processRecipes(final IMachineRecipeManager manager) {
for (final Entry<IRecipeInput, RecipeOutput> e : manager.getRecipes().entrySet()) {
final IC2MachineRecipeAdaptor adaptor = new IC2MachineRecipeAdaptor(e);
final ItemStack input = RecipeDecomposition.getInput(adaptor);
if (!ItemRegistry.isRecipeIgnored(input)) {
final List<ItemStack> output = RecipeDecomposition.decompose(adaptor);
recycler.input(input).useRecipe(output).save();
}
}
}
示例4: convert
import ic2.api.recipe.IRecipeInput; //导入依赖的package包/类
public static IStackWrapper convert(IRecipeInput input) {
if (input instanceof RecipeInputItemStack) {
return new VanillaStackWrapper(((RecipeInputItemStack) input).input);
} else if (input instanceof RecipeInputOreDict) {
return new OreStackWrapper(((RecipeInputOreDict) input).input);
} else {
return null;
}
}
示例5: init
import ic2.api.recipe.IRecipeInput; //导入依赖的package包/类
@Override
public void init(){
ItemStack advancedCircuit = IC2Items.getItem("advancedCircuit");
ItemStack glassFibreCable = IC2Items.getItem("glassFiberCableItem");
ItemStack advancedAlloy = IC2Items.getItem("advancedAlloy");
ItemStack generator = IC2Items.getItem("generator");
if(Config.enablePneumaticGeneratorRecipe) GameRegistry.addRecipe(new ItemStack(pneumaticGenerator), "pca", "trg", "pca", 'p', Itemss.printedCircuitBoard, 'c', advancedCircuit, 'a', advancedAlloy, 't', new ItemStack(Blockss.advancedPressureTube, 1, 0), 'r', Itemss.turbineRotor, 'g', glassFibreCable);
if(Config.enableElectricCompressorRecipe) GameRegistry.addRecipe(new ItemStack(electricCompressor), "acp", "frt", "agp", 'p', Itemss.printedCircuitBoard, 'c', advancedCircuit, 'a', advancedAlloy, 't', new ItemStack(Blockss.advancedPressureTube, 1, 0), 'r', Itemss.turbineRotor, 'f', glassFibreCable, 'g', generator);
try {
if(Class.forName("ic2.api.recipe.Recipes") != null && Recipes.class.getField("macerator") != null && IMachineRecipeManager.class.getMethod("addRecipe", IRecipeInput.class, NBTTagCompound.class, ItemStack[].class) != null) {
if(Config.enableCreeperPlantMaceratorRecipe) {
Recipes.macerator.addRecipe(new IC2RecipeInput(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.CREEPER_PLANT_DAMAGE)), null, new ItemStack(Items.gunpowder));
Recipes.macerator.addRecipe(new IC2RecipeInput(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.CREEPER_PLANT_DAMAGE + 16)), null, new ItemStack(Items.gunpowder));
}
if(Config.enableHeliumPlantMaceratorRecipe) {
Recipes.macerator.addRecipe(new IC2RecipeInput(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.HELIUM_PLANT_DAMAGE)), null, new ItemStack(Items.glowstone_dust));
Recipes.macerator.addRecipe(new IC2RecipeInput(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.HELIUM_PLANT_DAMAGE + 16)), null, new ItemStack(Items.glowstone_dust));
}
if(Config.enableFlyingFlowerExtractorRecipe) {
Recipes.extractor.addRecipe(new IC2RecipeInput(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.FLYING_FLOWER_DAMAGE)), null, new ItemStack(Items.feather));
Recipes.extractor.addRecipe(new IC2RecipeInput(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.FLYING_FLOWER_DAMAGE + 16)), null, new ItemStack(Items.feather));
}
if(Config.enablePropulsionPlantExtractorRecipe) {
Recipes.extractor.addRecipe(new IC2RecipeInput(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.PROPULSION_PLANT_DAMAGE)), null, new ItemStack(Items.sugar, 2, 1));
Recipes.extractor.addRecipe(new IC2RecipeInput(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.PROPULSION_PLANT_DAMAGE + 16)), null, new ItemStack(Items.sugar, 2, 1));
}
}
} catch(Exception e) {
System.err.println("[PneumaticCraft] Failed to load IC2's macerator, extractor and compressor recipes!");
e.printStackTrace();
}
}
示例6: IC2MachineRecipeAdaptor
import ic2.api.recipe.IRecipeInput; //导入依赖的package包/类
public IC2MachineRecipeAdaptor(final Entry<IRecipeInput, RecipeOutput> entry) {
this(entry.getValue(), entry.getKey());
}
示例7: addRecipe
import ic2.api.recipe.IRecipeInput; //导入依赖的package包/类
@Override
public boolean addRecipe(IRecipeInput iRecipeInput, NBTTagCompound nbtTagCompound, boolean b, ItemStack... itemStacks) {
processList.add(new RecipePart(iRecipeInput.getInputs().get(0), itemStacks[0])); //TODO Implement this
return true;
}