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