本文整理汇总了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);
}