當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。