thaumcraft.api.research.ResearchCategories Java Examples

The following examples show how to use thaumcraft.api.research.ResearchCategories. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IfAnyParentResearchItem.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public boolean isHidden() {
    if(anyParents != null) {
        boolean hasFoundAny = false;
        boolean doesAnyExist = false;
        for(String res : anyParents) {
            ResearchItem ri = ResearchCategories.getResearch(res);
            if(ri != null) {
                doesAnyExist = true;
                if(GuiResearchBrowser.completedResearch.get(Minecraft.getMinecraft().thePlayer.getCommandSenderName()).contains(ri.key)) {
                    hasFoundAny = true;
                }
            }
        }
        if(doesAnyExist) {
            return !hasFoundAny;
        }
    }
    return super.isHidden();
}
 
Example #2
Source File: ExThaumiquo.java    From Ex-Aliquo with MIT License 6 votes vote down vote up
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;
			}
		}
	}
}
 
Example #3
Source File: PseudoResearchItem.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static ResearchItem create(String original, int col, int row, boolean doubleInThisPage) {
    ResearchItem item = ResearchCategories.getResearch(original);

    if(item != null) {
        ResearchItem pseudo;

        if(item.icon_resource == null) {
            pseudo = new PseudoResearchItem(item, item.key, col, row, item.icon_item, doubleInThisPage);
        } else {
            pseudo = new PseudoResearchItem(item, item.key, col, row, item.icon_resource, doubleInThisPage);
        }

        String[] siblings = item.siblings;
        if(siblings == null) {
            siblings = new String[]{ pseudo.key };
        } else {
            siblings = Arrays.copyOf(siblings, siblings.length + 1);
            siblings[siblings.length - 1] = pseudo.key;
        }

        item.setSiblings(siblings);

        if(item.isSecondary()) {
            pseudo.setSecondary();
        }

        return pseudo.setParentsHidden(original);
    }
    return null;
}
 
Example #4
Source File: TileKnowledgeBook.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private boolean shouldVortexResearchNote(ItemStack stack) {
    ResearchNoteData nd = ResearchManager.getData(stack);
    if(nd == null) return false;
    if(nd.isComplete()) return false;
    ResearchItem ri = ResearchCategories.getResearch(nd.key);
    return ri != null;
}
 
Example #5
Source File: ThaumcraftApi.java    From AdvancedMod with GNU General Public License v3.0 5 votes vote down vote up
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;
}
 
Example #6
Source File: ThaumcraftApi.java    From Chisel-2 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #7
Source File: ThaumcraftApi.java    From GardenCollection with MIT License 5 votes vote down vote up
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;
}
 
Example #8
Source File: ForbiddenResearch.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
public static void addResearch() {
    ResearchCategories.registerCategory("FORBIDDEN", new ResourceLocation("forbidden", "textures/misc/forbidden.png"), new ResourceLocation("forbidden", "textures/misc/runecircle.png"));

    addInfernalism();
    addTaint();

    if(thaumcraft.common.config.Config.researchDifficulty != -1)
        (new DarkResearchItem("CRYSTALWELL", "FORBIDDEN", (new AspectList()).add(Aspect.MIND, 3).add(Aspect.CRYSTAL, 2).add(Aspect.MAGIC, 1), -2, -8, 1, new ItemStack(ForbiddenItems.crystalwell, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.CRYSTALWELL.1"), new ResearchPage((IArcaneRecipe) recipes.get("Crystalwell")) }).setParents(new String[] { "RESEARCH" }).registerResearchItem();
    else
        (new DarkResearchItem("CRYSTALWELL", "FORBIDDEN", (new AspectList()).add(Aspect.MIND, 3).add(Aspect.CRYSTAL, 2).add(Aspect.MAGIC, 1), -2, -8, 1, new ItemStack(ForbiddenItems.crystalwell, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.CRYSTALWELL.1b"), new ResearchPage((IArcaneRecipe) recipes.get("Crystalwell")) }).setParents(new String[] { "RESEARCH" }).registerResearchItem();

    (new DarkResearchItem("PRIMEWELL", "FORBIDDEN", (new AspectList()).add(Aspect.MIND, 3).add(Aspect.ELDRITCH, 6).add(Aspect.CRAFT, 1), 2, -8, 1, new ItemStack(ForbiddenItems.primewell, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.PRIMEWELL.1"), new ResearchPage((IArcaneRecipe) recipes.get("Primewell")) }).setParents(new String[] { "PRIMPEARL" }).setConcealed().registerResearchItem();
    if (Config.emeraldTrans)
        (new DarkResearchItem("TRANSEMERALD", "FORBIDDEN", (new AspectList()).add(Aspect.CRYSTAL, 2).add(Aspect.EXCHANGE, 5).add(Aspect.GREED, 4), 0, -6, 3, new ItemStack(ForbiddenItems.resource, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.TRANSEMERALD.1"), new ResearchPage((CrucibleRecipe) recipes.get("TransEmerald")) }).setSecondary().setConcealed().setParents(new String[] { "TRANSGOLD" }).registerResearchItem();
    (new DarkResearchItem("BLACKFLOWER", "FORBIDDEN", (new AspectList()).add(Aspect.PLANT, 3).add(Aspect.SENSES, 2).add(Aspect.DARKNESS, 4), -2, -6, 1, new ItemStack(ForbiddenBlocks.blackFlower, 1, 0))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.BLACKFLOWER.1"), new ResearchPage((CrucibleRecipe) recipes.get("BlackFlower")), new ResearchPage((IRecipe) recipes.get("BlackInk")) }).setAspectTriggers(new Aspect[] { Aspect.SENSES }).registerResearchItem();
    (new DarkResearchItem("RIDINGCROP", "FORBIDDEN", new AspectList(), 0, -8, 0, new ItemStack(ForbiddenItems.ridingCrop))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.RIDINGCROP.1"), new ResearchPage((IRecipe) recipes.get("RidingCrop")) }).setStub().setRound().setAutoUnlock().registerResearchItem();


    if(Config.enchanting) {
        (new DarkResearchItem("CONSUMING", "FORBIDDEN", (new AspectList()).add(Aspect.VOID, 4).add(Aspect.ENTROPY, 3).add(Aspect.MAGIC, 2), -4, -8, 1, new ResourceLocation("forbidden", "textures/misc/consuming.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.CONSUMING.1"), new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Consuming"))}).setParents(new String[]{"INFUSIONENCHANTMENT"}).setSecondary().setConcealed().registerResearchItem();
        (new DarkResearchItem("EDUCATIONAL", "FORBIDDEN", (new AspectList()).add(Aspect.MIND, 5).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 3), -4, -7, 2, new ResourceLocation("forbidden", "textures/misc/educational.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.EDUCATIONAL.1"), new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Educational"))}).setParents(new String[]{"INFUSIONENCHANTMENT"}).setSecondary().setConcealed().registerResearchItem();
    }

    if(Compat.botan || Compat.bm || Compat.am2)
        (new DarkResearchItem("SCHOOLS", "FORBIDDEN", new AspectList(), -1, 1, 0, new ItemStack(Blocks.enchanting_table))).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.SCHOOLS.1") }).setRound().setStub().setAutoUnlock().registerResearchItem();

}
 
Example #9
Source File: ThaumcraftApi.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
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;
}
 
Example #10
Source File: ThaumcraftApi.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
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;
}
 
Example #11
Source File: ExThaumiquo.java    From Ex-Aliquo with MIT License 4 votes vote down vote up
static void addPages()
{
	ResearchCategories.registerCategory("SKYCHEMY", new ResourceLocation("exaliquo:textures/misc/thaumicpage.png"), new ResourceLocation("thaumcraft", "textures/gui/gui_researchback.png"));
}
 
Example #12
Source File: IC2Research.java    From Electro-Magic-Tools with GNU General Public License v3.0 4 votes vote down vote up
public static void addResearchTab() {
    ResourceLocation background = new ResourceLocation("thaumcraft", "textures/gui/gui_researchback.png");
    ResearchCategories.registerCategory("EMT", new ResourceLocation("electromagictools:textures/misc/emt.png"), background);
}