本文整理了Java中net.minecraft.item.crafting.IRecipe.getCraftingResult()
方法的一些代码示例,展示了IRecipe.getCraftingResult()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IRecipe.getCraftingResult()
方法的具体详情如下:
包路径:net.minecraft.item.crafting.IRecipe
类名称:IRecipe
方法名:getCraftingResult
暂无
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
this.correctOutput = this.standardRecipe.getCraftingResult( this.crafting );
out.add( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( this.correctOutput ) );
代码示例来源:origin: PrinceOfAmber/Cyclic
public ItemStack getRecipeResult() {
if (this.recipe == null) {
return ItemStack.EMPTY;
}
return recipe.getCraftingResult(this.crafter);
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
return recipe.getCraftingResult(inv);
}
代码示例来源:origin: GregTechCE/GregTech
@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
return delegate.getCraftingResult(inv);
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
private ItemStack getAndUpdateOutput()
{
final World world = this.getPlayerInv().player.world;
final InventoryCrafting ic = new InventoryCrafting( this, 3, 3 );
for( int x = 0; x
ic.setInventorySlotContents( x, this.crafting.getStackInSlot( x ) );
}
if( this.currentRecipe == null || !this.currentRecipe.matches( ic, world ) )
{
this.currentRecipe = CraftingManager.findMatchingRecipe( ic, world );
}
final ItemStack is;
if( this.currentRecipe == null )
{
is = ItemStack.EMPTY;
}
else
{
is = this.currentRecipe.getCraftingResult( ic );
}
this.cOut.setStackInSlot( 0, is );
return is;
}
代码示例来源:origin: Vazkii/Botania
private boolean craft(boolean fullCheck) {
if(fullCheck && !isFull())
return false;
InventoryCrafting craft = new InventoryCrafting(new Container() {
@Override
public boolean canInteractWith(@Nonnull EntityPlayer player) {
return false;
}
}, 3, 3);
for(int i = 0; i
if(stack.isEmpty() || isLocked(i) || stack.getItem() == ModItems.manaResource && stack.getItemDamage() == 11)
continue;
craft.setInventorySlotContents(i, stack);
}
for(IRecipe recipe : ForgeRegistries.RECIPES)
if(recipe.matches(craft, world)) {
itemHandler.setStackInSlot(9, recipe.getCraftingResult(craft));
List
for(int i = 0; i
}
return true;
}
return false;
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
/**
* Callback for when the crafting matrix is changed.
*/
@Override
public void onCraftMatrixChanged( IInventory inventory )
{
final ContainerNull cn = new ContainerNull();
final InventoryCrafting ic = new InventoryCrafting( cn, 3, 3 );
for( int x = 0; x <9; x++ )
{
ic.setInventorySlotContents( x, this.craftingSlots[x].getStack() );
}
if( this.currentRecipe == null || !this.currentRecipe.matches( ic, this.getPlayerInv().player.world ) )
{
this.currentRecipe = CraftingManager.findMatchingRecipe( ic, this.getPlayerInv().player.world );
}
if( this.currentRecipe == null )
{
this.outputSlot.putStack( ItemStack.EMPTY );
}
else
{
final ItemStack craftingResult = this.currentRecipe.getCraftingResult( ic );
this.outputSlot.putStack( craftingResult );
}
}
代码示例来源:origin: OpenMods/OpenModsLib
@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
return enchantItem(source.getCraftingResult(inv));
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
final ItemStack testOutput = this.standardRecipe.getCraftingResult( this.testFrame );
代码示例来源:origin: ForestryMC/ForestryMC
public ItemStack getOutputIcon() {
IRecipe selectedRecipe = getSelectedRecipe();
if (selectedRecipe != null) {
ItemStack recipeOutput = selectedRecipe.getCraftingResult(craftMatrix);
if (!recipeOutput.isEmpty()) {
return recipeOutput;
}
}
return ItemStack.EMPTY;
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
cp.setCount( 1 );
ci.setInventorySlotContents( slot, cp );
if( r.matches( ci, w ) && ItemStack.areItemsEqual( r.getCraftingResult( ci ), output ) )
代码示例来源:origin: ForestryMC/ForestryMC
public ItemStack getCraftingResult(InventoryCrafting inventoryCrafting, World world) {
IRecipe selectedRecipe = getSelectedRecipe();
if (selectedRecipe != null && selectedRecipe.matches(inventoryCrafting, world)) {
ItemStack recipeOutput = selectedRecipe.getCraftingResult(inventoryCrafting);
if (!recipeOutput.isEmpty()) {
return recipeOutput;
}
}
return ItemStack.EMPTY;
}
代码示例来源:origin: OpenMods/OpenModsLib
private static void addTurtleForUpgrade(List
final InventoryCrafting inv = new InventoryCrafting(DUMMY_CONTAINER, 3, 3);
inv.setInventorySlotContents(0, left);
inv.setInventorySlotContents(1, turtle);
inv.setInventorySlotContents(2, right);
final ItemStack upgradedTurtle = recipe.getCraftingResult(inv);
if (upgradedTurtle != null) result.add(upgradedTurtle);
}
代码示例来源:origin: raoulvdberge/refinedstorage
public ItemStack getOutput(NonNullList
if (processing) {
throw new IllegalStateException("Cannot get crafting output from processing pattern");
}
if (took.size() != inputs.size()) {
throw new IllegalArgumentException("The items that are taken (" + took.size() + ") should match the inputs for this pattern (" + inputs.size() + ")");
}
InventoryCrafting inv = new InventoryCraftingDummy();
for (int i = 0; i
}
ItemStack result = recipe.getCraftingResult(inv);
if (result.isEmpty()) {
throw new IllegalStateException("Cannot have empty result");
}
return result;
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
is = r.getCraftingResult( ic );
代码示例来源:origin: raoulvdberge/refinedstorage
@Override
public void onCraftingMatrixChanged() {
if (currentRecipe == null || !currentRecipe.matches(matrix, world)) {
currentRecipe = CraftingManager.findMatchingRecipe(matrix, world);
}
if (currentRecipe == null) {
result.setInventorySlotContents(0, ItemStack.EMPTY);
} else {
result.setInventorySlotContents(0, currentRecipe.getCraftingResult(matrix));
}
craftingListeners.forEach(IGridCraftingListener::onCraftingMatrixChanged);
markDirty();
}
代码示例来源:origin: CoFH/ThermalExpansion
public void calcCraftingGridClient() {
ItemStack stack = ItemStack.EMPTY;
IRecipe recipe = CraftingManager.findMatchingRecipe(craftMatrix, myTile.getWorld());
if (recipe != null && CrafterRecipe.validRecipe(recipe)) {
craftResult.setRecipeUsed(recipe);
stack = recipe.getCraftingResult(craftMatrix);
}
craftResult.setInventorySlotContents(0, stack);
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
final IItemList
final ItemStack is = r.getCraftingResult( ic );
if( rr == r && Platform.itemComparisons().isSameItem( rr.getCraftingResult( real ), is ) )
代码示例来源:origin: McJtyMods/RFToolsControl
private void updateRecipe() {
if (getStackInSlot(WorkbenchContainer.SLOT_CRAFTOUTPUT) == null || realItems == 0) {
InventoryCrafting workInventory = makeWorkInventory();
IRecipe recipe = CraftingManager.findMatchingRecipe(workInventory, this.getWorld());
if (recipe != null) {
ItemStack stack = recipe.getCraftingResult(workInventory);
getInventoryHelper().setInventorySlotContents(getInventoryStackLimit(), WorkbenchContainer.SLOT_CRAFTOUTPUT, stack);
} else {
getInventoryHelper().setInventorySlotContents(getInventoryStackLimit(), WorkbenchContainer.SLOT_CRAFTOUTPUT, ItemStack.EMPTY);
}
}
}
代码示例来源:origin: CyclopsMC/EvilCraft
@Override
public void onCraftMatrixChanged(IInventory inventory) {
if(initialized && !this.world.isRemote) {
ItemStack itemstack = ItemStack.EMPTY;
// Slightly altered logic from Container#slotChangedCraftingGrid
IRecipe irecipe = CraftingManager.findMatchingRecipe(craftingGrid, world);
if (irecipe != null && (irecipe.isDynamic()
|| !this.world.getGameRules().getBoolean("doLimitedCrafting")
|| ((EntityPlayerMP) this.player).getRecipeBook().isUnlocked(irecipe))) {
result.setRecipeUsed(irecipe);
itemstack = irecipe.getCraftingResult(craftingGrid);
}
result.setInventorySlotContents(0, itemstack);
((EntityPlayerMP) this.player).connection.sendPacket(new SPacketSetSlot(this.windowId, 9, itemstack));
craftingGrid.save();
}
}