本文整理了Java中net.minecraft.item.ItemStack.areItemsEqualIgnoreDurability()
方法的一些代码示例,展示了ItemStack.areItemsEqualIgnoreDurability()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ItemStack.areItemsEqualIgnoreDurability()
方法的具体详情如下:
包路径:net.minecraft.item.ItemStack
类名称:ItemStack
方法名:areItemsEqualIgnoreDurability
暂无
代码示例来源:origin: TeamWizardry/Wizardry
@Deprecated
static HashSet<IRecipe> getRecipesForItem(ItemStack stack) {
HashSet<IRecipe> recipes = new HashSet<>();
for (IRecipe recipe : ForgeRegistries.RECIPES.getValues()) {
if (recipe == null) continue;
if (ItemStack.areItemsEqualIgnoreDurability(recipe.getRecipeOutput(), stack)) {
recipes.add(recipe);
}
}
return recipes;
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
public static boolean doItemStacksMatchRelaxed(ItemStack stack1, ItemStack stack2) {
if (stack1 == stack2) {
return true;
}
return OreDictionary.itemMatches(stack1, stack2, !stack1.isEmpty() && (stack1.isItemStackDamageable() || stack1.getItemDamage() != OreDictionary.WILDCARD_VALUE))
&& ItemStack.areItemsEqualIgnoreDurability(stack1, stack2)
&& ItemStack.areItemStackTagsEqual(stack1, stack2)
&& stack1.areCapsCompatible(stack2);
}
内容来源于网络,如有侵权,请联系作者删除!