本文整理匯總了Java中net.minecraftforge.common.ForgeHooks.defaultRecipeGetRemainingItems方法的典型用法代碼示例。如果您正苦於以下問題:Java ForgeHooks.defaultRecipeGetRemainingItems方法的具體用法?Java ForgeHooks.defaultRecipeGetRemainingItems怎麽用?Java ForgeHooks.defaultRecipeGetRemainingItems使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.common.ForgeHooks
的用法示例。
在下文中一共展示了ForgeHooks.defaultRecipeGetRemainingItems方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Nonnull
@Override
public NonNullList<ItemStack> getRemainingItems(@Nonnull InventoryCrafting inv) {
NonNullList<ItemStack> remainingItems = ForgeHooks.defaultRecipeGetRemainingItems(inv);
ItemStack sword;
for (int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if (stack.getItem() == Items.GOLDEN_SWORD) {
sword = stack.copy();
sword.setItemDamage(sword.getItemDamage() + 1);
if (sword.getItemDamage() > sword.getMaxDamage()) sword = null;
if (sword != null) {
remainingItems.set(i, sword);
}
break;
}
}
return remainingItems;
}
示例2: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
{
NonNullList<ItemStack> remains = ForgeHooks.defaultRecipeGetRemainingItems(inv);
for (int i = 0; i < height * width; i++)
{
ItemStack stack = inv.getStackInSlot(i);
NonNullList<Ingredient> matchedIngredients = this.input;
if (matchedIngredients.get(i) instanceof IngredientFluidStack)
{
if (!stack.isEmpty())
{
ItemStack copy = stack.copy();
copy.setCount(1);
remains.set(i, copy);
}
IFluidHandlerItem handler = FluidUtil.getFluidHandler(remains.get(i));
if (handler != null)
{
FluidStack fluid = ((IngredientFluidStack) matchedIngredients.get(i)).getFluid();
handler.drain(fluid.amount, true);
remains.set(i, handler.getContainer());
}
}
}
return remains;
}
示例3: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public ItemStack[] getRemainingItems(InventoryCrafting inv) {
ItemStack[] remainingItems = new ItemStack[inv.getSizeInventory()];
if (returnContainers) {
remainingItems = ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
return remainingItems;
}
示例4: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public ItemStack[] getRemainingItems(InventoryCrafting ic) {
return ForgeHooks.defaultRecipeGetRemainingItems(ic);
}
示例5: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public ItemStack[] getRemainingItems(InventoryCrafting inv) //getRecipeLeftovers
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
示例6: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
示例7: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) //getRecipeLeftovers
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
示例8: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
示例9: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Nonnull
@Override
public NonNullList<ItemStack> getRemainingItems(@Nonnull InventoryCrafting inv) {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
示例10: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
@Nonnull
public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
示例11: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
@Nonnull
public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) {
ItemStack ring = null;
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if (stack != null) {
if (ring != null) {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
if (stack.getItem() instanceof IBauble) {
ring = stack.copy();
} else {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
}
}
if (ring != null && NBTHelper.getBoolean(ring, IJCConstants.NBT.BAUBLE_HOLDER)) {
ItemStack output = getCraftingResult(inv);
if (output == null) {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
if (output.getItem() instanceof ItemBaubleRingHolder) {
NBTHelper.getTag(ring).removeTag(IJCConstants.NBT.BAUBLE_HOLDER);
if (NBTHelper.getBoolean(ring, IJCConstants.NBT.ADVANCED_BAUBLE_HOLDER)) {
NBTHelper.getTag(ring).removeTag(IJCConstants.NBT.ADVANCED_BAUBLE_HOLDER);
}
} else {
boolean advanced = NBTHelper.getBoolean(ring, IJCConstants.NBT.ADVANCED_BAUBLE_HOLDER);
ItemStack ring0 = NBTHelper.getItemStack(ring, IJCConstants.NBT.BAUBLE_ATTACHED(0));
if (ring0 == null) {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
if (advanced) {
ItemStack ring1 = NBTHelper.getItemStack(ring, IJCConstants.NBT.BAUBLE_ATTACHED(1));
if (ring1 == null) {
NBTHelper.getTag(ring).removeTag(IJCConstants.NBT.BAUBLE_ATTACHED(0));
} else {
NBTHelper.getTag(ring).removeTag(IJCConstants.NBT.BAUBLE_ATTACHED(1));
}
} else {
NBTHelper.getTag(ring).removeTag(IJCConstants.NBT.BAUBLE_ATTACHED(0));
}
}
inv.clear();
return new ItemStack[] {ring};
} else {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
}
示例12: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
@Nonnull
public NonNullList<ItemStack> getRemainingItems(@Nonnull InventoryCrafting inv) {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
示例13: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@NotNull
@Override
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
示例14: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public ItemStack[] getRemainingItems(InventoryCrafting inv) {
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
示例15: getRemainingItems
import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) //getRecipeLeftovers
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}