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


Java OreDictionary.WILDCARD_VALUE属性代码示例

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


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

示例1: matches

@Override
public boolean matches(ItemStack subject) {
	List<ItemStack> inputs = getOres();
	boolean useOreStackMeta = (meta == null);
	Item subjectItem = subject.getItem();
	int subjectMeta = subject.getItemDamage();

	for (ItemStack oreStack : inputs) {
		Item oreItem = oreStack.getItem();
		if (oreItem == null) continue; // ignore invalid

		int metaRequired = useOreStackMeta ? oreStack.getItemDamage() : meta;

		if (subjectItem == oreItem &&
				(subjectMeta == metaRequired || metaRequired == OreDictionary.WILDCARD_VALUE)) {
			return true;
		}
	}

	return false;
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:21,代码来源:RecipeInputOreDict.java

示例2: HarshenStack

/**
 * Used to create a list of stacks, from oreDictionary
 * @param oreDictName A list of OreDictionary value you want to use
 */
public HarshenStack(String... oreDictNames) {
	for(String oreDictName : oreDictNames)
	{
		NonNullList<ItemStack> stackList = OreDictionary.getOres(oreDictName);
		if(stackList.isEmpty())
			new IllegalArgumentException("Oredictionary vaule " + oreDictName + " doesnt exist").printStackTrace(System.out);
		else
			for(ItemStack stack : stackList)
				if(stack.getMetadata() == OreDictionary.WILDCARD_VALUE)
				{
			    		NonNullList<ItemStack> innerStacklist = NonNullList.create();
			    		stack.getItem().getSubItems(CreativeTabs.SEARCH, innerStacklist);
					for(ItemStack wildStack : innerStacklist)
						this.stackList.add(stack.copy());
				}
				else
					this.stackList.add(stack);
	}
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:23,代码来源:HarshenStack.java

示例3: stackEqualsNonNBT

public static boolean stackEqualsNonNBT(@Nonnull ItemStack stack, @Nonnull  ItemStack other) {
    if (stack.isEmpty() && other.isEmpty())
        return true;
    if (stack.isEmpty() || other.isEmpty())
        return false;
    Item sItem = stack.getItem();
    Item oItem = other.getItem();
    if (sItem.getHasSubtypes() || oItem.getHasSubtypes()) {
        return sItem.equals(other.getItem()) &&
                (stack.getItemDamage() == other.getItemDamage() ||
                        stack.getItemDamage() == OreDictionary.WILDCARD_VALUE ||
                        other.getItemDamage() == OreDictionary.WILDCARD_VALUE);
    } else {
        return sItem.equals(other.getItem());
    }
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:16,代码来源:ItemUtils.java

示例4: parseItemPart

private Pair<String, Integer> parseItemPart(String input)
{
    int meta = 0;

    if (input.contains("@"))
    {
        String metaPart = input.substring(input.lastIndexOf('@') + 1);
        input = input.substring(0, input.lastIndexOf('@'));

        if (metaPart.equalsIgnoreCase(WILDCARD_STRING))
        {
            meta = OreDictionary.WILDCARD_VALUE;
        } else
        {
            meta = Integer.parseInt(metaPart);
        }
    }

    return Pair.of(input, meta);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:20,代码来源:WrappedItemStackDeserializer.java

示例5: getBoostFromBooster

public static float getBoostFromBooster(ItemStack stack)
{
	if (stack == null)
	{
		return Float.NaN;
	}

	for (Map.Entry<ItemStack, Float> entry : boosterRegistry.entrySet())
	{
		ItemStack tested = entry.getKey();
		if (tested.getMetadata() == OreDictionary.WILDCARD_VALUE)
		{
			if (tested.getItem() == stack.getItem())
			{
				return entry.getValue();
			}
		}
		else
		{
			if (tested.getItem() == stack.getItem() && tested.getMetadata() == stack.getMetadata())
			{
				return entry.getValue();
			}
		}
	}

	return Float.NaN;
}
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:28,代码来源:TileEntitySmelterBase.java

示例6: getDamage

public int getDamage()
{
	if (isWildcard)
	{
		return OreDictionary.WILDCARD_VALUE;
	}

	return damage;
}
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:9,代码来源:JsonLoadedItemStack.java

示例7: worksWith

protected boolean worksWith(final Block referenceBlock, final int referenceMetadata) {
    for (ItemStack stack : blocks) {
        if (stack != null && stack.getItem() instanceof ItemBlock) {
            final ItemBlock item = (ItemBlock) stack.getItem();
            final Block supportedBlock = item.getBlock();
            final int supportedMetadata = item.getMetadata(stack.getItemDamage());
            if (referenceBlock == supportedBlock && (referenceMetadata == supportedMetadata || stack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:13,代码来源:DriverBlock.java

示例8: add

@ZenMethod
public static void add(IItemStack output, ILiquidStack liquid, @NotNull IItemStack stamp, @Optional IItemStack input) {
    ItemStack stack = InputHelper.toStack(input);
    ItemStack stampStack = InputHelper.toStack(stamp); //This is pointless but also the easiest way.
    ItemStampingRecipe recipe = new ItemStampingRecipe(stack,InputHelper.toFluid(liquid), EnumStampType.getType(stampStack),InputHelper.toStack(output),stack.getMetadata() != OreDictionary.WILDCARD_VALUE,stack.hasTagCompound());
    CraftTweakerAPI.apply(new Add(recipe));
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:7,代码来源:Stamper.java

示例9: getStacksWithWildCard

public static ArrayList<ItemStack> getStacksWithWildCard(ItemStack wildCardStack)
  {
  	if(wildCardStack.getMetadata() != OreDictionary.WILDCARD_VALUE)
  		return toArray();
  	ArrayList<ItemStack> stackList = new ArrayList<>();
  	NonNullList<ItemStack> innerStacklist = NonNullList.create();
  	wildCardStack.getItem().getSubItems(CreativeTabs.SEARCH, innerStacklist);
for(ItemStack stack : innerStacklist)
	stackList.add(stack.copy());
return stackList;
  }
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:11,代码来源:HarshenUtils.java

示例10: containsItem

/**
 * Can the input stack be used as an input item. Returns true if the stackList ({@link HarshenStack#getStackList})
 * contains the input item.
 * @param stack the stack to test with
 * @return true if the stack can be used, false if not
 */
public boolean containsItem(ItemStack stack)
{
	for(ItemStack innerStack :  getStackList())
		if(((innerStack.getMetadata() == OreDictionary.WILDCARD_VALUE ? innerStack.getItem() == stack.getItem() : innerStack.isItemEqual(stack)) && 
				(dependOnNBT ? ItemStack.areItemStackShareTagsEqual(innerStack, stack) : true)) || (innerStack.isEmpty() && stack.isEmpty()))
			return true;
	return false;
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:14,代码来源:HarshenStack.java

示例11: isSameStackForFuel

public static boolean isSameStackForFuel(ItemStack fuel, ItemStack stack)
{
    boolean itemEqual = stack.getMetadata() == OreDictionary.WILDCARD_VALUE
                        ? fuel.isItemEqualIgnoreDurability(stack)
                        : fuel.isItemEqual(stack);

    boolean nbtEqual = !stack.hasTagCompound() || ItemStack.areItemStackTagsEqual(stack, fuel);

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

示例12: isCorrectItem

private boolean isCorrectItem(ItemStack eventStack)
{
    boolean itemEqual = eventStack.getMetadata() == OreDictionary.WILDCARD_VALUE
                        ? stack.isItemEqualIgnoreDurability(eventStack)
                        : stack.isItemEqual(eventStack);

    boolean nbtEqual = !eventStack.hasTagCompound() || ItemStack.areItemStackTagsEqual(eventStack, stack);

    return itemEqual && nbtEqual;
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:10,代码来源:ToolTip.java

示例13: matches

public static final boolean matches(ItemStack template, ItemStack item) {
	boolean templatePresent = template!=null && !template.isEmpty();
	boolean itemPresent     = item!=null     && !item.isEmpty();
	if (!templatePresent &&  itemPresent) return false; // Empty    !=  NonEmpty
	if ( templatePresent && !itemPresent) return false; // NonEmpty !=  Empty
	if (!templatePresent && !itemPresent) return true;  // Empty    ==  Empty
	
	if (template.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
		return ItemStack.areItemsEqualIgnoreDurability(template, item) &&
				ItemStack.areItemStackTagsEqual(template, item);
	} else {
		return ItemStack.areItemsEqual(template, item) &&
				ItemStack.areItemStackTagsEqual(template, item);
	}
}
 
开发者ID:elytra,项目名称:Thermionics,代码行数:15,代码来源:OreItems.java

示例14: matches

@Override
public boolean matches(ItemStack subject) {
	return subject.getItem() == input.getItem() &&
			(subject.getItemDamage() == input.getItemDamage() || input.getItemDamage() == OreDictionary.WILDCARD_VALUE);
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:5,代码来源:RecipeInputItemStack.java

示例15: add

@ZenMethod
public static void add(ILiquidStack output, IItemStack input) {
    ItemStack stack = InputHelper.toStack(input);
    ItemMeltingRecipe recipe = new ItemMeltingRecipe(stack,InputHelper.toFluid(output),stack.getMetadata() != OreDictionary.WILDCARD_VALUE,stack.hasTagCompound());
    CraftTweakerAPI.apply(new Add(recipe));
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:6,代码来源:Melter.java


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