当前位置: 首页>>代码示例>>Java>>正文


Java OreDictionary.itemMatches方法代码示例

本文整理汇总了Java中net.minecraftforge.oredict.OreDictionary.itemMatches方法的典型用法代码示例。如果您正苦于以下问题:Java OreDictionary.itemMatches方法的具体用法?Java OreDictionary.itemMatches怎么用?Java OreDictionary.itemMatches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.oredict.OreDictionary的用法示例。


在下文中一共展示了OreDictionary.itemMatches方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isItemValid

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
@Override
public boolean isItemValid(ItemStack stack) {
	if(!stack.isEmpty())
	{
		if(stack.getItem() instanceof ItemBlock)
		{
			for(ItemStack ore : ores)
				if(OreDictionary.itemMatches(ore, stack, false))
				{
					return true;
				}
		}
		
		else
		{
			ItemStack result = FurnaceRecipes.instance().getSmeltingResult(getStack());
			if (result.getItem().equals(Items.field_191525_da))
			{
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:ArtixAllMighty,项目名称:ExSartagine,代码行数:25,代码来源:SlotSmelterInput.java

示例2: stackMatchesRecipeInput

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static boolean stackMatchesRecipeInput(ItemStack stack, RecipeInput input, boolean checkCount)
{
    if (input.isItemStack())
    {
        ItemStack inputStack = input.getStack().getItemStack();
        if (OreDictionary.itemMatches(inputStack, stack, false)
            && (!checkCount || inputStack.getCount() <= stack.getCount()))
            return true;
    } else
    {
        if (OreDictionary.containsMatch(false, OreDictionary.getOres(input.getOreClass().getOreName()), stack))
            return true;
    }

    return false;
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:17,代码来源:ItemHelper.java

示例3: isSameOreDictStack

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static boolean isSameOreDictStack(ItemStack stack1, ItemStack stack2) {
    int[] oredictIds = OreDictionary.getOreIDs(stack1);
    for (int oredictId : oredictIds) {
        List<ItemStack> oreDictStacks = OreDictionary.getOres(OreDictionary.getOreName(oredictId));
        for (ItemStack oreDictStack : oreDictStacks) {
            if (OreDictionary.itemMatches(oreDictStack, stack2, false)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:13,代码来源:PneumaticCraftUtils.java

示例4: areInputsEqual

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
/**@Deprecated use HarshenStack version instead*/
@Deprecated
public static boolean areInputsEqual(ArrayList<ItemStack> inputList, ArrayList<ItemStack> worldInputList)
{
	ArrayList<ItemStack> doneItems = new ArrayList<>(worldInputList);
	stackTestingLoop:
	for(ItemStack stack : inputList)
		for(ItemStack stack1 : worldInputList)
			if(OreDictionary.itemMatches(stack, stack1, false) && doneItems.contains(stack1))
			{
				doneItems.remove(stack1);
				continue stackTestingLoop;
			}
	return doneItems.isEmpty();
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:16,代码来源:HarshenUtils.java

示例5: isValidInput

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static boolean isValidInput(ItemStack stack){
	if(stack.isEmpty())
		return false;
	for(int i=0;i<recipes.size();i++){
		if(OreDictionary.itemMatches(stack, recipes.get(i).input, false))
			return true;
	}
	return false;
}
 
开发者ID:EnderiumSmith,项目名称:CharcoalPit,代码行数:10,代码来源:PotteryKilnRecipe.java

示例6: getResult

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static ItemStack getResult(ItemStack in){
	if(in.isEmpty())
		return ItemStack.EMPTY;
	for(int i=0;i<recipes.size();i++){
		if(OreDictionary.itemMatches(in, recipes.get(i).input, false)){
			return recipes.get(i).output.copy();
		}
	}
	return ItemStack.EMPTY;
}
 
开发者ID:EnderiumSmith,项目名称:CharcoalPit,代码行数:11,代码来源:PotteryKilnRecipe.java

示例7: matches

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public boolean matches(ItemStack stack) {
    int[] ids = OreDictionary.getOreIDs(stack);
    for(int id : ids) {
        String name = OreDictionary.getOreName(id);
        if(matches(name)) {
            return true;
        }
    }
    return !stack.isEmpty() && OreDictionary.itemMatches(stack, input, false);
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:11,代码来源:RecipeMachineBase.java

示例8: getBrewAmount

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static int getBrewAmount(ItemStack fuel) {
	for (IBrewingFuel advFuel : advFuels) {
		int time = advFuel.getBrewingAmount(fuel);
		if (time > 0)
			return time;
	}

	for (Entry<ItemStack, Integer> entry : fuels.entrySet())
		if (OreDictionary.itemMatches(entry.getKey(), fuel, false))
			return entry.getValue();

	return 0;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:14,代码来源:BrewingFuelRegistry.java

示例9: accepts

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
@Override
public boolean accepts(ItemStack stack)
{
    if (itemStack == ItemStack.EMPTY)
    {
        itemStack = wrappedStack.getItemStack();
    }
    return !itemStack.isEmpty() && OreDictionary.itemMatches(itemStack, stack, false);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:10,代码来源:ItemFilterDeserializer.java

示例10: getIsRepairable

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
/** Custom repairability method */
@Override
   public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) {
	for(ItemStack r : repairStacks) {
		if(OreDictionary.itemMatches(r, repair, false)) return true;
	}
   	return false;
   }
 
开发者ID:sblectric,项目名称:AdvancedCombat,代码行数:9,代码来源:SwordCustomRepair.java

示例11: matchesOreName

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static boolean matchesOreName(String oreName, ItemStack stack) {
	if (!OreDictionary.doesOreNameExist(oreName)) return false;
	
	NonNullList<ItemStack> oreItems = OreDictionary.getOres(oreName);
	for(ItemStack oreItem : oreItems) {
		if (OreDictionary.itemMatches(stack, oreItem, false)) return true;
	}
	
	return false;
}
 
开发者ID:elytra,项目名称:Thermionics,代码行数:11,代码来源:ToolHelper.java

示例12: isIngredient

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
@Override
public boolean isIngredient(ItemStack stack)
{
    for (ItemStack target : this.getIngredient())
    {
        if (OreDictionary.itemMatches(target, stack, false))
        {
            return true;
        }

    }
    return false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:BrewingOreRecipe.java

示例13: matchStackLoosely

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static boolean matchStackLoosely(@Nonnull ItemStack stack, @Nonnull  ItemStack other) {
    if (stack.isEmpty()) return other.isEmpty();
    return OreDictionary.itemMatches(other, stack, false);
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:5,代码来源:ItemUtils.java

示例14: isItemEqual

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static boolean isItemEqual(String oreDictName, ItemStack stack) {
    for (ItemStack s : OreDictionary.getOres(oreDictName)) {
        if (OreDictionary.itemMatches(stack, s, false)) return true;
    }
    return false;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:7,代码来源:OreDictionaryHelper.java

示例15: transferStackInSlot

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
/**
 * Take a stack from the specified inventory slot.
 */
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
	ItemStack itemstack = ItemStack.EMPTY;
	Slot slot = (Slot)this.inventorySlots.get(index);

	if (slot != null && slot.getHasStack())
	{
		ItemStack itemstack1 = slot.getStack();
		itemstack = itemstack1.copy();

		if (index == 1 || index == 2)
		{
			if (!this.mergeItemStack(itemstack1, 3, 39, true))
			{
				return ItemStack.EMPTY;
			}

			slot.onSlotChange(itemstack1, itemstack);
		}
		else if (index != 0)
		{
			if (itemstack1.getItem() instanceof ItemBlock)
			{
				for(ItemStack stack : ores)
					if(OreDictionary.itemMatches(stack, itemstack1, false))
					{
						if (!this.mergeItemStack(itemstack1, 0, 1, false))
						{
							return ItemStack.EMPTY;
						}
						break;
					}
			}
			else if (index >= 3 && index < 30)
			{
				if (!this.mergeItemStack(itemstack1, 30, 39, false))
				{
					return ItemStack.EMPTY;
				}
			}
			else if (index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
			{
				return ItemStack.EMPTY;
			}
		}
		else if (!this.mergeItemStack(itemstack1, 3, 39, false))
		{
			return ItemStack.EMPTY;
		}

		if (itemstack1.isEmpty())
		{
			slot.putStack(ItemStack.EMPTY);
		}
		else
		{
			slot.onSlotChanged();
		}

		if (itemstack1.getCount() == itemstack.getCount())
		{
			return ItemStack.EMPTY;
		}

		slot.onTake(playerIn, itemstack1);
	}

	return itemstack;
}
 
开发者ID:ArtixAllMighty,项目名称:ExSartagine,代码行数:73,代码来源:ContainerSmelter.java


注:本文中的net.minecraftforge.oredict.OreDictionary.itemMatches方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。