本文整理汇总了Java中thaumcraft.api.research.ResearchCategoryList类的典型用法代码示例。如果您正苦于以下问题:Java ResearchCategoryList类的具体用法?Java ResearchCategoryList怎么用?Java ResearchCategoryList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResearchCategoryList类属于thaumcraft.api.research包,在下文中一共展示了ResearchCategoryList类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: minus
import thaumcraft.api.research.ResearchCategoryList; //导入依赖的package包/类
@EventHandler
public void minus(FMLLoadCompleteEvent event) {
for(ResearchCategoryList tab : ResearchCategories.researchCategories.values()){
if(tab != null) {
for (ResearchItem item : tab.research.values()) {
if(item != null){
item.setAutoUnlock();
}
}
}
}
try {
Field warpMap = ThaumcraftApi.class.getDeclaredField("warpMap");
warpMap.setAccessible(true);
HashMap<Object, Integer> warpList = (HashMap<Object, Integer>)warpMap.get(null);
warpList.clear();
}
catch (Exception e){
e.printStackTrace();
}
}
示例2: removeResearch
import thaumcraft.api.research.ResearchCategoryList; //导入依赖的package包/类
private static void removeResearch(String research)
{
Collection researchcategory = ResearchCategories.researchCategories.values();
for (Object obj : researchcategory)
{
Collection researchlist = ((ResearchCategoryList)obj).research.values();
for (Object researchitem : researchlist)
{
if (((ResearchItem)researchitem).key.equals(research))
{
researchlist.remove(researchitem);
break;
}
}
}
}
示例3: removeResearch
import thaumcraft.api.research.ResearchCategoryList; //导入依赖的package包/类
private static void removeResearch(String research)
{
Collection researchcategory = ResearchCategories.researchCategories.values();
for (Object obj : researchcategory)
{
Collection researchlist = ((ResearchCategoryList)obj).research.values();
for (Object researchitem : researchlist)
{
if (((ResearchItem)researchitem).key.equals(research))
{
System.out.println("Removing Research " + ((ResearchItem)researchitem).key);
researchlist.remove(researchitem);
break;
}
}
}
}
示例4: getCraftingRecipeKey
import thaumcraft.api.research.ResearchCategoryList; //导入依赖的package包/类
public static Object[] getCraftingRecipeKey(EntityPlayer player, ItemStack stack) {
int[] key = new int[] {Item.getIdFromItem(stack.getItem()),stack.getItemDamage()};
if (keyCache.containsKey(key)) {
if (keyCache.get(key)==null) return null;
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), (String)(keyCache.get(key))[0]))
return keyCache.get(key);
else
return null;
}
for (ResearchCategoryList rcl:ResearchCategories.researchCategories.values()) {
for (ResearchItem ri:rcl.research.values()) {
if (ri.getPages()==null) continue;
for (int a=0;a<ri.getPages().length;a++) {
ResearchPage page = ri.getPages()[a];
if (page.recipe!=null && page.recipe instanceof CrucibleRecipe[]) {
CrucibleRecipe[] crs = (CrucibleRecipe[]) page.recipe;
for (CrucibleRecipe cr:crs) {
if (cr.getRecipeOutput().isItemEqual(stack)) {
keyCache.put(key,new Object[] {ri.key,a});
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key))
return new Object[] {ri.key,a};
}
}
} else
if (page.recipeOutput!=null && stack !=null && page.recipeOutput.isItemEqual(stack)) {
keyCache.put(key,new Object[] {ri.key,a});
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key))
return new Object[] {ri.key,a};
else
return null;
}
}
}
}
keyCache.put(key,null);
return null;
}
示例5: getCraftingRecipeKey
import thaumcraft.api.research.ResearchCategoryList; //导入依赖的package包/类
public static Object[] getCraftingRecipeKey(EntityPlayer player, ItemStack stack) {
int[] key = new int[] {Item.getIdFromItem(stack.getItem()),stack.getItemDamage()};
if (keyCache.containsKey(key)) {
if (keyCache.get(key)==null) return null;
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), (String)(keyCache.get(key))[0]))
return keyCache.get(key);
else
return null;
}
for (ResearchCategoryList rcl:ResearchCategories.researchCategories.values()) {
for (ResearchItem ri:rcl.research.values()) {
if (ri.getPages()==null) continue;
for (int a=0;a<ri.getPages().length;a++) {
ResearchPage page = ri.getPages()[a];
if (page.recipeOutput!=null && stack !=null && page.recipeOutput.isItemEqual(stack)) {
keyCache.put(key,new Object[] {ri.key,a});
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key))
return new Object[] {ri.key,a};
else
return null;
}
}
}
}
keyCache.put(key,null);
return null;
}
示例6: getCraftingRecipeKey
import thaumcraft.api.research.ResearchCategoryList; //导入依赖的package包/类
public static Object[] getCraftingRecipeKey(EntityPlayer player, ItemStack stack) {
int[] key = new int[] { Item.getIdFromItem(stack.getItem()), stack.getItemDamage() };
if (keyCache.containsKey(key)) {
if (keyCache.get(key) == null)
return null;
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), (String) (keyCache.get(key))[0]))
return keyCache.get(key);
else
return null;
}
for (ResearchCategoryList rcl : ResearchCategories.researchCategories.values()) {
for (ResearchItem ri : rcl.research.values()) {
if (ri.getPages() == null)
continue;
for (int a = 0; a < ri.getPages().length; a++) {
ResearchPage page = ri.getPages()[a];
if (page.recipeOutput != null && stack != null && page.recipeOutput.isItemEqual(stack)) {
keyCache.put(key, new Object[] { ri.key, a });
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key))
return new Object[] { ri.key, a };
else
return null;
}
}
}
}
keyCache.put(key, null);
return null;
}
示例7: getCraftingRecipeKey
import thaumcraft.api.research.ResearchCategoryList; //导入依赖的package包/类
public static Object[] getCraftingRecipeKey(EntityPlayer player, ItemStack stack) {
int[] key = new int[] {stack.itemID,stack.getItemDamage()};
if (keyCache.containsKey(key)) {
if (keyCache.get(key)==null) return null;
if (ThaumcraftApiHelper.isResearchComplete(player.username, (String)(keyCache.get(key))[0]))
return keyCache.get(key);
else
return null;
}
for (ResearchCategoryList rcl:ResearchCategories.researchCategories.values()) {
for (ResearchItem ri:rcl.research.values()) {
if (ri.getPages()==null) continue;
for (int a=0;a<ri.getPages().length;a++) {
ResearchPage page = ri.getPages()[a];
if (page.recipeOutput!=null && stack !=null && page.recipeOutput.isItemEqual(stack)) {
keyCache.put(key,new Object[] {ri.key,a});
if (ThaumcraftApiHelper.isResearchComplete(player.username, ri.key))
return new Object[] {ri.key,a};
else
return null;
}
}
}
}
keyCache.put(key,null);
return null;
}
示例8: getCraftingRecipeKey
import thaumcraft.api.research.ResearchCategoryList; //导入依赖的package包/类
public static Object[] getCraftingRecipeKey(EntityPlayer player, ItemStack stack) {
int[] key = new int[] {
Item.getIdFromItem(stack.getItem()),
stack.getItemDamage()
};
if (keyCache.containsKey(key)) {
if (keyCache.get(key) == null) {
return null;
}
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), (String) (keyCache.get(key))[0])) {
return keyCache.get(key);
}
else {
return null;
}
}
for (ResearchCategoryList rcl : ResearchCategories.researchCategories.values()) {
for (ResearchItem ri : rcl.research.values()) {
if (ri.getPages() == null) {
continue;
}
for (int a = 0; a < ri.getPages().length; a++ ) {
ResearchPage page = ri.getPages()[a];
if ( (page.recipe != null) && (page.recipe instanceof CrucibleRecipe[])) {
CrucibleRecipe[] crs = (CrucibleRecipe[]) page.recipe;
for (CrucibleRecipe cr : crs) {
if (cr.getRecipeOutput().isItemEqual(stack)) {
keyCache.put(key, new Object[] {
ri.key,
a
});
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key)) {
return new Object[] {
ri.key,
a
};
}
}
}
}
else if ( (page.recipeOutput != null) && (stack != null) && page.recipeOutput.isItemEqual(stack)) {
keyCache.put(key, new Object[] {
ri.key,
a
});
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key)) {
return new Object[] {
ri.key,
a
};
}
else {
return null;
}
}
}
}
}
keyCache.put(key, null);
return null;
}
示例9: getCraftingRecipeKey
import thaumcraft.api.research.ResearchCategoryList; //导入依赖的package包/类
public static Object[] getCraftingRecipeKey(EntityPlayer player, ItemStack stack) {
int[] key = new int[]{Item.getIdFromItem(stack.getItem()), stack.getItemDamage()};
if (keyCache.containsKey(key)) {
if (keyCache.get(key) == null) {
return null;
}
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), (String) (keyCache.get(key))[0])) {
return keyCache.get(key);
} else {
return null;
}
}
for (ResearchCategoryList rcl : ResearchCategories.researchCategories.values()) {
for (ResearchItem ri : rcl.research.values()) {
if (ri.getPages() == null) {
continue;
}
for (int a = 0; a < ri.getPages().length; a++) {
ResearchPage page = ri.getPages()[a];
if (page.recipe != null && page.recipe instanceof CrucibleRecipe[]) {
CrucibleRecipe[] crs = (CrucibleRecipe[]) page.recipe;
for (CrucibleRecipe cr : crs) {
if (cr.getRecipeOutput().isItemEqual(stack)) {
keyCache.put(key, new Object[]{ri.key, a});
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key)) {
return new Object[]{ri.key, a};
}
}
}
} else if (page.recipeOutput != null && stack != null && page.recipeOutput.isItemEqual(stack)) {
keyCache.put(key, new Object[]{ri.key, a});
if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key)) {
return new Object[]{ri.key, a};
} else {
return null;
}
}
}
}
}
keyCache.put(key, null);
return null;
}