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


Java ThaumcraftApiHelper.isResearchComplete方法代码示例

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


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

示例1: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player) {
	if ( (research.length() > 0) && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
	for (int x = 0; x <= (MAX_CRAFT_GRID_WIDTH - width); x++ ) {
		for (int y = 0; y <= (MAX_CRAFT_GRID_HEIGHT - height); ++y) {
			if (checkMatch(inv, x, y, false)) {
				return true;
			}
			if (mirrored && checkMatch(inv, x, y, true)) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:18,代码来源:ShapedArcaneRecipe.java

示例2: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
    for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
    {
        for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
        {
            if (checkMatch(inv, x, y, false))
            {
                return true;
            }

            if (mirrored && checkMatch(inv, x, y, true))
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:Brandomine,项目名称:Augury,代码行数:25,代码来源:ShapedArcaneRecipe.java

示例3: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
    if(research.length() > 0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research))
    {
        return false;
    }
    for(int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
    {
        for(int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
        {
            if(checkMatch(inv, x, y, false))
            {
                return true;
            }

            if(mirrored && checkMatch(inv, x, y, true))
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:J3FF97,项目名称:Steel-Industries,代码行数:26,代码来源:ShapedArcaneRecipe.java

示例4: loadCraftingRecipes

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public void loadCraftingRecipes(ItemStack result) {
	List recipes = ThaumcraftApi.getCraftingRecipes();
	for (int i = 0; i < recipes.size(); i++){//Sorry, no enhanced for loop here :P
		if (recipes.get(i) instanceof ShapedArcaneRecipe) {
			ShapedArcaneRecipe recipe = (ShapedArcaneRecipe) recipes.get(i);
			if (ThaumcraftApiHelper.isResearchComplete(Reference.PLAYER_NAME, recipe.getResearch()) || Config.cheatMode){
				if (recipe.getRecipeOutput().isItemEqual(result)) {
					if (checkDupe(recipe)) {
						this.arecipes.add(new CachedShapedArcaneWorkbenchRecipe(recipe));
					}
				}
			}
		}
	}
}
 
开发者ID:austinv11,项目名称:Thaumic-NEI,代码行数:17,代码来源:ShapedArcaneWorkbenchHandler.java

示例5: loadUsageRecipes

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public void loadUsageRecipes(ItemStack ingredient) {
	List recipes = ThaumcraftApi.getCraftingRecipes();
	for (int i = 0; i < recipes.size(); i++) {//Sorry, no enhanced for loop here again :P
		if (recipes.get(i) instanceof ShapedArcaneRecipe) {
			ShapedArcaneRecipe recipe = (ShapedArcaneRecipe) recipes.get(i);
			if (ThaumcraftApiHelper.isResearchComplete(Reference.PLAYER_NAME, recipe.getResearch()) || Config.cheatMode){
				for (Object o : recipe.getInput()) {
					if (o instanceof ItemStack) {
						ItemStack item = (ItemStack) o;
						if (item.isItemEqual(ingredient)) {
							if (checkDupe(recipe)) {
								this.arecipes.add(new CachedShapedArcaneWorkbenchRecipe(recipe));
							}
						}
					}
				}
			}
		}
	}
}
 
开发者ID:austinv11,项目名称:Thaumic-NEI,代码行数:22,代码来源:ShapedArcaneWorkbenchHandler.java

示例6: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player) {
	if (research.length() > 0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
	for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++) {
		for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y) {
			if (checkMatch(inv, x, y, false)) {
				return true;
			}

			if (mirrored && checkMatch(inv, x, y, true)) {
				return true;
			}
		}
	}

	return false;
}
 
开发者ID:jaredlll08,项目名称:MysticalTrinkets,代码行数:20,代码来源:ShapedArcaneRecipe.java

示例7: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(IInventory par1InventoryCrafting, EntityPlayer player)
{
	if (key.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.username, key)) {
		return false;
	}
    for (int var2 = 0; var2 <= 3 - this.recipeWidth; ++var2)
    {
        for (int var3 = 0; var3 <= 3 - this.recipeHeight; ++var3)
        {
            if (this.checkMatch(par1InventoryCrafting, var2, var3, true))
            {
                return true;
            }

            if (this.checkMatch(par1InventoryCrafting, var2, var3, false))
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:27,代码来源:ShapedArcaneCraftingRecipes.java

示例8: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public boolean matches(IInventory var1, World world, EntityPlayer player) {
	if ( (research.length() > 0) && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
	ArrayList required = new ArrayList(input);
	for (int x = 0; x < 9; x++ ) {
		ItemStack slot = var1.getStackInSlot(x);
		if (slot != null) {
			boolean inRecipe = false;
			Iterator req = required.iterator();
			while (req.hasNext()) {
				boolean match = false;
				Object next = req.next();
				if (next instanceof ItemStack) {
					match = checkItemEquals((ItemStack) next, slot);
				}
				else if (next instanceof ArrayList) {
					for (ItemStack item : (ArrayList<ItemStack>) next) {
						match = match || checkItemEquals(item, slot);
					}
				}
				if (match) {
					inRecipe = true;
					required.remove(next);
					break;
				}
			}
			if (!inRecipe) {
				return false;
			}
		}
	}
	return required.isEmpty();
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:36,代码来源:ShapelessArcaneRecipe.java

示例9: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * Used to check if a recipe matches current crafting inventory
 * 
 * @param player
 */
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
	if (getRecipeInput() == null) {
		return false;
	}
	if ( (research.length() > 0) && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
	ItemStack i2 = central.copy();
	if (getRecipeInput().getItemDamage() == OreDictionary.WILDCARD_VALUE) {
		i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
	}
	if (!areItemStacksEqual(i2, getRecipeInput(), true)) {
		return false;
	}
	ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
	for (ItemStack is : input) {
		ii.add(is.copy());
	}
	for (ItemStack comp : getComponents()) {
		boolean b = false;
		for (int a = 0; a < ii.size(); a++ ) {
			i2 = ii.get(a).copy();
			if (comp.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
				i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
			}
			if (areItemStacksEqual(i2, comp, true)) {
				ii.remove(a);
				b = true;
				break;
			}
		}
		if (!b) {
			return false;
		}
	}
	return ii.size() == 0 ? true : false;
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:43,代码来源:InfusionRecipe.java

示例10: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
    * Used to check if a recipe matches current crafting inventory
    * @param player 
    */
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
	if (getRecipeInput()==null) return false;
		
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
   		return false;
   	}
	
	ItemStack i2 = central.copy();
	if (getRecipeInput().getItemDamage()==OreDictionary.WILDCARD_VALUE) {
		i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
	}
	
	if (!areItemStacksEqual(i2, getRecipeInput(), true)) return false;
	
	ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
	for (ItemStack is:input) {
		ii.add(is.copy());
	}
	
	for (ItemStack comp:getComponents()) {
		boolean b=false;
		for (int a=0;a<ii.size();a++) {
			 i2 = ii.get(a).copy();
			if (comp.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
				i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
			}
			if (areItemStacksEqual(i2, comp,true)) {
				ii.remove(a);
				b=true;
				break;
			}
		}
		if (!b) return false;
	}
	return ii.size()==0?true:false;
   }
 
开发者ID:Brandomine,项目名称:Augury,代码行数:41,代码来源:InfusionRecipe.java

示例11: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
    if(central == null || !(central.getItem() instanceof ItemFamiliar_Old)) return false; //We call it "FamiliarAugment" Recipe for a reason..
    if(getRecipeInput() == null || !(getRecipeInput().getItem() instanceof ItemFamiliar_Old)) return false; //A bit late but still working..

    if ((this.research.length() > 0) && (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), this.research))) {
        return false;
    }

    ItemStack centralCopy = central.copy();
    if(!((ItemFamiliar_Old) centralCopy.getItem()).hasUpgrade(centralCopy, getUpgradeToAdd().getNeededPreviousUpgrade())) return false;

    ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
    for (ItemStack is : input) {
        ii.add(is.copy());
    }
    for (ItemStack comp : getComponents()) {
        boolean b = false;
        for (int a = 0; a < ii.size(); a++) {
            centralCopy = ii.get(a).copy();
            if (comp.getItemDamage() == 32767) {
                centralCopy.setItemDamage(32767);
            }
            if (areItemStacksEqual(centralCopy, comp, true)) {
                ii.remove(a);
                b = true;
                break;
            }
        }
        if (!b) {
            return false;
        }
    }
    return ii.size() == 0;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:36,代码来源:Familiar_Old_AugmentInfusion.java

示例12: isHidden

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public boolean isHidden() {
    EntityPlayer p = Minecraft.getMinecraft().thePlayer;
    if(p != null) {
        if(!ThaumcraftApiHelper.isResearchComplete(p.getCommandSenderName(), this.key)) {
            return false;
        }
    }
    return super.isHidden();
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:12,代码来源:PseudoResearchItem.java

示例13: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
@Override
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
    if (getRecipeInput()==null) return false;
    if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
        return false;
    }
    ItemStack i2 = central.copy();
    if (getRecipeInput().getItemDamage()== OreDictionary.WILDCARD_VALUE) {
        i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
    }
    if (!areItemStacksEqualLocal(i2, getRecipeInput(), true)) return false;
    ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
    for (ItemStack is:input) {
        ii.add(is.copy());
    }
    for (ItemStack comp:getComponents()) {
        boolean b=false;
        for (int a=0;a<ii.size();a++) {
            i2 = ii.get(a).copy();
            if (comp.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
                i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
            }
            if (areItemStacksEqualLocal(i2, comp, true)) {
                ii.remove(a);
                b=true;
                break;
            }
        }
        if (!b) return false;
    }
    return ii.size()==0?true:false;
}
 
开发者ID:flammpfeil,项目名称:ExtraScepterStaff,代码行数:33,代码来源:InfusionExtraScepterStaffRecipe.java

示例14: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * Used to check if a recipe matches current crafting inventory
 * 
 * @param player
 */
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
	if (getRecipeInput() == null)
		return false;

	if (research.length() > 0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}

	ItemStack i2 = central.copy();
	if (getRecipeInput().getItemDamage() == OreDictionary.WILDCARD_VALUE) {
		i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
	}

	if (!areItemStacksEqual(i2, getRecipeInput(), true))
		return false;

	ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
	for (ItemStack is : input) {
		ii.add(is.copy());
	}

	for (ItemStack comp : getComponents()) {
		boolean b = false;
		for (int a = 0; a < ii.size(); a++) {
			i2 = ii.get(a).copy();
			if (comp.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
				i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
			}
			if (areItemStacksEqual(i2, comp, true)) {
				ii.remove(a);
				b = true;
				break;
			}
		}
		if (!b)
			return false;
	}
	return ii.size() == 0 ? true : false;
}
 
开发者ID:jaredlll08,项目名称:MysticalTrinkets,代码行数:45,代码来源:InfusionRecipe.java

示例15: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * Used to check if a recipe matches current crafting inventory
 * 
 * @param player
 */
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
	if ( (research.length() > 0) && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
	if (!enchantment.canApply(central) || !central.getItem().isItemTool(central)) {
		return false;
	}
	Map map1 = EnchantmentHelper.getEnchantments(central);
	Iterator iterator = map1.keySet().iterator();
	while (iterator.hasNext()) {
		int j1 = ((Integer) iterator.next()).intValue();
		Enchantment ench = Enchantment.enchantmentsList[j1];
		if ( (j1 == enchantment.effectId) && (EnchantmentHelper.getEnchantmentLevel(j1, central) >= ench.getMaxLevel())) {
			return false;
		}
		if ( (enchantment.effectId != ench.effectId) && (!enchantment.canApplyTogether(ench) || !ench.canApplyTogether(enchantment))) {
			return false;
		}
	}
	ItemStack i2 = null;
	ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
	for (ItemStack is : input) {
		ii.add(is.copy());
	}
	for (ItemStack comp : components) {
		boolean b = false;
		for (int a = 0; a < ii.size(); a++ ) {
			i2 = ii.get(a).copy();
			if (comp.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
				i2.setItemDamage(OreDictionary.WILDCARD_VALUE);
			}
			if (areItemStacksEqual(i2, comp, true)) {
				ii.remove(a);
				b = true;
				break;
			}
		}
		if (!b) {
			return false;
		}
	}
	// System.out.println(ii.size());
	return ii.size() == 0 ? true : false;
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:50,代码来源:InfusionEnchantmentRecipe.java


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