本文整理汇总了Java中thaumcraft.api.crafting.IArcaneRecipe类的典型用法代码示例。如果您正苦于以下问题:Java IArcaneRecipe类的具体用法?Java IArcaneRecipe怎么用?Java IArcaneRecipe使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IArcaneRecipe类属于thaumcraft.api.crafting包,在下文中一共展示了IArcaneRecipe类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findMatchingArcaneResult
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
/**
* Searches for a matching arcane crafting recipe result
*
* @return ItemStack of the result if found, null otherwise.
*/
private ItemStack findMatchingArcaneResult()
{
ItemStack arcaneResult = null;
// Is there a matching recipe?
IArcaneRecipe matchingRecipe = ArcaneRecipeHelper.INSTANCE.findMatchingArcaneResult( this.terminal, 0,
ContainerPartArcaneCraftingTerminal.CRAFTING_GRID_TOTAL_SIZE, this.player );
if( matchingRecipe != null )
{
// Found a match, validate it.
arcaneResult = this.validateWandVisAmount( matchingRecipe );
}
// Return the result
return arcaneResult;
}
示例2: ResearchPage
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
/**
* @param recipe an arcane worktable crafting recipe.
*/
public ResearchPage(IArcaneRecipe recipe)
{
this.type = PageType.ARCANE_CRAFTING;
this.recipe = recipe;
this.recipeOutput = recipe.getRecipeOutput();
}
示例3: getCraftingRecipeKey
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
/**
* @param stack the item
* @return the thaumcraft recipe key that produces that item. Used by the thaumonomicon drilldown feature.
*/
public static String getCraftingRecipeKey(ItemStack stack) {
for (Object r:getCraftingRecipes()) {
if (r instanceof IArcaneRecipe) {
if (ThaumcraftApiHelper.areItemsEqual(stack,((IArcaneRecipe)r).getRecipeOutput()))
return ((IArcaneRecipe)r).getKey();
}
if (r instanceof IInfusionRecipe) {
if (ThaumcraftApiHelper.areItemsEqual(stack,((IInfusionRecipe)r).getRecipeOutput()))
return ((IInfusionRecipe)r).getKey();
}
}
return "";
}
示例4: getArcaneRecipe
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
private static IArcaneRecipe getArcaneRecipe(String research)
{
for (Object recipe : ThaumcraftApi.getCraftingRecipes())
{
if (recipe instanceof IArcaneRecipe)
{
if (((IArcaneRecipe)recipe).getResearch().equals(research))
{
return (IArcaneRecipe) recipe;
}
}
}
return null;
}
示例5: getRecipeAspectCost
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
/**
* Gets the base aspect cost of this recipe. Can return null.
*
* @param sourceInventory
* @param firstSlotIndex
* @param gridSize
* @param recipe
* @return
*/
public AspectList getRecipeAspectCost( final IInventory sourceInventory, final int firstSlotIndex, final int gridSize,
final IArcaneRecipe recipe )
{
// Ensure the recipe is valid
if( recipe == null )
{
return null;
}
return recipe.getAspects( this.createBridgeInventory( sourceInventory, firstSlotIndex, gridSize ) );
}
示例6: getRecipeOutput
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
/**
* Gets the item that results from this recipe. Can be null.
*
* @param sourceInventory
* @param firstSlotIndex
* @param gridSize
* @param recipe
* @return
*/
public ItemStack getRecipeOutput( final IInventory sourceInventory, final int firstSlotIndex, final int gridSize, final IArcaneRecipe recipe )
{
// Ensure the recipe is valid
if( recipe == null )
{
return null;
}
return recipe.getCraftingResult( this.createBridgeInventory( sourceInventory, firstSlotIndex, gridSize ) );
}
示例7: addResearch
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
public static void addResearch() {
ResearchCategories.registerCategory("FORBIDDEN", new ResourceLocation("forbidden", "textures/misc/forbidden.png"), new ResourceLocation("forbidden", "textures/misc/runecircle.png"));
addInfernalism();
addTaint();
if(thaumcraft.common.config.Config.researchDifficulty != -1)
(new DarkResearchItem("CRYSTALWELL", "FORBIDDEN", (new AspectList()).add(Aspect.MIND, 3).add(Aspect.CRYSTAL, 2).add(Aspect.MAGIC, 1), -2, -8, 1, new ItemStack(ForbiddenItems.crystalwell, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.CRYSTALWELL.1"), new ResearchPage((IArcaneRecipe) recipes.get("Crystalwell")) }).setParents(new String[] { "RESEARCH" }).registerResearchItem();
else
(new DarkResearchItem("CRYSTALWELL", "FORBIDDEN", (new AspectList()).add(Aspect.MIND, 3).add(Aspect.CRYSTAL, 2).add(Aspect.MAGIC, 1), -2, -8, 1, new ItemStack(ForbiddenItems.crystalwell, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.CRYSTALWELL.1b"), new ResearchPage((IArcaneRecipe) recipes.get("Crystalwell")) }).setParents(new String[] { "RESEARCH" }).registerResearchItem();
(new DarkResearchItem("PRIMEWELL", "FORBIDDEN", (new AspectList()).add(Aspect.MIND, 3).add(Aspect.ELDRITCH, 6).add(Aspect.CRAFT, 1), 2, -8, 1, new ItemStack(ForbiddenItems.primewell, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.PRIMEWELL.1"), new ResearchPage((IArcaneRecipe) recipes.get("Primewell")) }).setParents(new String[] { "PRIMPEARL" }).setConcealed().registerResearchItem();
if (Config.emeraldTrans)
(new DarkResearchItem("TRANSEMERALD", "FORBIDDEN", (new AspectList()).add(Aspect.CRYSTAL, 2).add(Aspect.EXCHANGE, 5).add(Aspect.GREED, 4), 0, -6, 3, new ItemStack(ForbiddenItems.resource, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.TRANSEMERALD.1"), new ResearchPage((CrucibleRecipe) recipes.get("TransEmerald")) }).setSecondary().setConcealed().setParents(new String[] { "TRANSGOLD" }).registerResearchItem();
(new DarkResearchItem("BLACKFLOWER", "FORBIDDEN", (new AspectList()).add(Aspect.PLANT, 3).add(Aspect.SENSES, 2).add(Aspect.DARKNESS, 4), -2, -6, 1, new ItemStack(ForbiddenBlocks.blackFlower, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.BLACKFLOWER.1"), new ResearchPage((CrucibleRecipe) recipes.get("BlackFlower")), new ResearchPage((IRecipe) recipes.get("BlackInk")) }).setAspectTriggers(new Aspect[] { Aspect.SENSES }).registerResearchItem();
(new DarkResearchItem("RIDINGCROP", "FORBIDDEN", new AspectList(), 0, -8, 0, new ItemStack(ForbiddenItems.ridingCrop))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.RIDINGCROP.1"), new ResearchPage((IRecipe) recipes.get("RidingCrop")) }).setStub().setRound().setAutoUnlock().registerResearchItem();
if(Config.enchanting) {
(new DarkResearchItem("CONSUMING", "FORBIDDEN", (new AspectList()).add(Aspect.VOID, 4).add(Aspect.ENTROPY, 3).add(Aspect.MAGIC, 2), -4, -8, 1, new ResourceLocation("forbidden", "textures/misc/consuming.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.CONSUMING.1"), new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Consuming"))}).setParents(new String[]{"INFUSIONENCHANTMENT"}).setSecondary().setConcealed().registerResearchItem();
(new DarkResearchItem("EDUCATIONAL", "FORBIDDEN", (new AspectList()).add(Aspect.MIND, 5).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 3), -4, -7, 2, new ResourceLocation("forbidden", "textures/misc/educational.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.EDUCATIONAL.1"), new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Educational"))}).setParents(new String[]{"INFUSIONENCHANTMENT"}).setSecondary().setConcealed().registerResearchItem();
}
if(Compat.botan || Compat.bm || Compat.am2)
(new DarkResearchItem("SCHOOLS", "FORBIDDEN", new AspectList(), -1, 1, 0, new ItemStack(Blocks.enchanting_table))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.SCHOOLS.1") }).setRound().setStub().setAutoUnlock().registerResearchItem();
}
示例8: addTaint
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
public static void addTaint() {
(new DarkResearchItem("TAINTSHOVEL", "FORBIDDEN", (new AspectList()).add(Aspect.CRYSTAL, 3).add(Aspect.TAINT, 2).add(Aspect.TOOL, 1), -8, 1, 2, new ItemStack(ForbiddenItems.taintShovel))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.TAINTSHOVEL.1"), new ResearchPage((InfusionRecipe) recipes.get("TaintShovel")), new ResearchPage("forbidden.research_page.TAINTSHOVEL.2") }).setParents(new String[] { "THAUMIUM", "INFUSION", "ETHEREALBLOOM" }).setConcealed().registerResearchItem();
(new DarkResearchItem("TAINTPICK", "FORBIDDEN", (new AspectList()).add(Aspect.TOOL, 2).add(Aspect.TAINT, 4).add(Aspect.ENTROPY, 3), -10, 1, 2, new ItemStack(ForbiddenItems.taintPickaxe))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.TAINTPICK.1"), new ResearchPage((InfusionRecipe) recipes.get("TaintPick")) }).setParents(new String[] { "THAUMIUM", "INFUSION" }).setConcealed().registerResearchItem();
(new DarkResearchItem("ROD_tainted", "FORBIDDEN", (new AspectList()).add(Aspect.MAGIC, 4).add(Aspect.TAINT, 5).add(Aspect.TOOL, 2), -8, 3, 3, new ItemStack(ForbiddenItems.wandCore, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.ROD_tainted.1"), new ResearchPage((InfusionRecipe) recipes.get("WandRodTainted")) }).setParents(new String[] { "ROD_silverwood", "TAINTSHOVEL", "INFUSION" }).setConcealed().registerResearchItem();
(new DarkResearchItem("TAINTTREE", "FORBIDDEN", (new AspectList()).add(Aspect.TREE, 4).add(Aspect.TAINT, 6).add(Aspect.POISON, 2).add(Aspect.PLANT, 3), -11, 3, 3, new ItemStack(ForbiddenBlocks.taintSapling))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.TAINTTREE.1"), new ResearchPage((CrucibleRecipe) recipes.get("TaintTree")), new ResearchPage((IRecipe) recipes.get("TaintPlank")), new ResearchPage(new ItemStack(ForbiddenBlocks.taintLog, 1, 0)) }).setParents(new String[]{"THAUMIUM", "INFUSION", "ETHEREALBLOOM"}).setConcealed().registerResearchItem();
ThaumcraftApi.addWarpToResearch("TAINTTREE", 1);
ThaumcraftApi.addWarpToItem(new ItemStack(ForbiddenBlocks.taintSapling, 1, 0), 1);
(new DarkResearchItem("TAINTSTONE", "FORBIDDEN", (new AspectList()).add(Aspect.EARTH, 4).add(Aspect.TAINT, 6).add(Aspect.ORDER, 2), -10, 3, 2, new ItemStack(ForbiddenBlocks.taintStone, 1, 1))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.TAINTSTONE.1"), new ResearchPage((IArcaneRecipe) recipes.get("TaintStone")), new ResearchPage((IRecipe) recipes.get("TaintBrick"))}).setParents(new String[]{"THAUMIUM", "INFUSION", "ETHEREALBLOOM"}).setConcealed().registerResearchItem();
ThaumcraftApi.addWarpToResearch("ROD_tainted", 2);
}
示例9: arcaneRecipePage
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
private static ResearchPage arcaneRecipePage(String ... names) {
IArcaneRecipe[] recipes = new IArcaneRecipe[names.length];
for (int i = 0; i < names.length; i++) {
recipes[i] = (IArcaneRecipe) getRecipe(names[i]);
}
return new ResearchPage(recipes);
}
示例10: ResearchPage
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
/**
* @param recipe
* a collection of arcane crafting recipes.
*/
public ResearchPage(IArcaneRecipe[] recipe) {
this.type = PageType.ARCANE_CRAFTING;
this.recipe = recipe;
}
示例11: ResearchPage
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
/**
* @param recipe a collection of arcane crafting recipes.
*/
public ResearchPage(IArcaneRecipe[] recipe) {
this.type = PageType.ARCANE_CRAFTING;
this.recipe = recipe;
}
示例12: ResearchPage
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
/**
* @param recipe a collection of arcane crafting recipes.
*/
public ResearchPage(IArcaneRecipe[] recipe) {
this.type = PageType.ARCANE_CRAFTING;
this.recipe = recipe;
}
示例13: registerResearch
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
@Override
protected void registerResearch()
{
// Set the research aspects
AspectList storageAspectList = new AspectList();
storageAspectList.add( Aspect.VOID, 5 );
storageAspectList.add( Aspect.ENERGY, 5 );
storageAspectList.add( Aspect.CRYSTAL, 3 );
storageAspectList.add( Aspect.METAL, 3 );
// Set the icon
ItemStack storageIcon = ThEApi.instance().items().EssentiaCell_64k.getStack();
// Get the component recipes
IArcaneRecipe[] storageComponentRecipes = new IArcaneRecipe[] { RecipeRegistry.ITEM_STORAGE_COMPONENT_4K,
RecipeRegistry.ITEM_STORAGE_COMPONENT_16K,
RecipeRegistry.ITEM_STORAGE_COMPONENT_64K };
// Get the cell shaped recipes
IRecipe[] storageCellsShaped = new IRecipe[] { RecipeRegistry.ITEM_STORAGE_CELL_1K_SHAPED, RecipeRegistry.ITEM_STORAGE_CELL_4K_SHAPED,
RecipeRegistry.ITEM_STORAGE_CELL_16K_SHAPED, RecipeRegistry.ITEM_STORAGE_CELL_64K_SHAPED };
// Get the cell shapeless recipes
IRecipe[] storageCellsShapeless = new IRecipe[] { RecipeRegistry.ITEM_STORAGE_CELL_1K_SHAPELESS,
RecipeRegistry.ITEM_STORAGE_CELL_4K_SHAPELESS,
RecipeRegistry.ITEM_STORAGE_CELL_16K_SHAPELESS, RecipeRegistry.ITEM_STORAGE_CELL_64K_SHAPELESS };
// Set the pages
ResearchPage[] storagePages = new ResearchPage[] { new ResearchPage( ResearchTypes.STORAGE.getPageName( 1 ) ),
new ResearchPage( ResearchTypes.STORAGE.getPageName( 2 ) ), new ResearchPage( RecipeRegistry.ITEM_STORAGE_COMPONENT_1K ),
new ResearchPage( storageComponentRecipes ), new ResearchPage( RecipeRegistry.ITEM_STORAGE_HOUSING ),
new ResearchPage( storageCellsShaped ), new ResearchPage( storageCellsShapeless ),
new ResearchPage( RecipeRegistry.BLOCK_CELL_WORKBENCH ) };
String[] storageParents;
// Is the warded stone research enabled?
if( Config.wardedStone )
{
storageParents = new String[3];
storageParents[2] = PseudoResearchTypes.WARDED.getKey();
}
else
{
storageParents = new String[2];
}
storageParents[0] = this.getFirstValidParentKey( false );
storageParents[1] = PseudoResearchTypes.DISTILESSENTIA.getKey();
// Create the storage research
ResearchTypes.STORAGE.createResearchItem( storageAspectList, ResearchRegistry.COMPLEXITY_MEDIUM, storageIcon, storagePages );
ResearchTypes.STORAGE.researchItem.setParents( storageParents );
ResearchTypes.STORAGE.researchItem.setParentsHidden( "DISTILESSENTIA" );
ResearchTypes.STORAGE.researchItem.registerResearchItem();
}
示例14: validateWandVisAmount
import thaumcraft.api.crafting.IArcaneRecipe; //导入依赖的package包/类
/**
* Checks if the wand has enough vis to complete the craft.
* Takes into consideration the players multiplier.
*
* @param forRecipe
* @return ItemStack of the result if wand has enough vis, null otherwise.
*/
private ItemStack validateWandVisAmount( final IArcaneRecipe forRecipe )
{
boolean hasAll = true;
AspectList wandAspectList = null;
ItemWandCasting wandItem = null;
// Get the cost
this.requiredAspects = ArcaneRecipeHelper.INSTANCE.getRecipeAspectCost( this.terminal, 0,
ContainerPartArcaneCraftingTerminal.CRAFTING_GRID_TOTAL_SIZE, forRecipe );
// Ensure there is a cost
if( this.requiredAspects == null )
{
return null;
}
// Cache the recipes aspects
Aspect[] recipeAspects = this.requiredAspects.getAspects();
// Do we have a wand?
if( this.wand != null )
{
// Get the wand item
wandItem = ( (ItemWandCasting)this.wand.getItem() );
// Cache the wand's aspect list
wandAspectList = wandItem.getAllVis( this.wand );
}
// Check the wand amounts vs recipe aspects
for( Aspect currentAspect : recipeAspects )
{
// Get the base required vis
int baseVis = this.requiredAspects.getAmount( currentAspect );
// Get the adjusted amount
int requiredVis = baseVis * 100;
// Assume we do not have enough
boolean hasEnough = false;
// Do we have a wand?
if( ( wandItem != null ) && ( wandAspectList != null ) )
{
// Adjust the required amount by the wand modifier
requiredVis = (int)( requiredVis * wandItem.getConsumptionModifier( this.wand, this.player, currentAspect, true ) );
// Does the wand not have enough of vis of this aspect?
hasEnough = ( wandAspectList.getAmount( currentAspect ) >= requiredVis );
}
if( !hasEnough )
{
// Mark that we do not have enough vis to complete crafting
hasAll = false;
}
// Add to the cost list
this.craftingCost.add( new ArcaneCrafingCost( requiredVis / 100.0F, currentAspect, hasEnough ) );
}
// Did we have all the vis required?
if( hasAll )
{
// Get the result of the recipe.
return ArcaneRecipeHelper.INSTANCE.getRecipeOutput( this.terminal, 0,
ContainerPartArcaneCraftingTerminal.CRAFTING_GRID_TOTAL_SIZE, forRecipe );
}
return null;
}