本文整理汇总了Java中thaumcraft.api.research.ResearchCategories类的典型用法代码示例。如果您正苦于以下问题:Java ResearchCategories类的具体用法?Java ResearchCategories怎么用?Java ResearchCategories使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResearchCategories类属于thaumcraft.api.research包,在下文中一共展示了ResearchCategories类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: minus
import thaumcraft.api.research.ResearchCategories; //导入依赖的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: isHidden
import thaumcraft.api.research.ResearchCategories; //导入依赖的package包/类
@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();
}
示例3: postInit
import thaumcraft.api.research.ResearchCategories; //导入依赖的package包/类
public static void postInit()
{
String[] magicBowParents = {"NITOR","ALUMENTUM","INFUSION"};
researchMagicBow.setParents(magicBowParents);
ResearchCategories.registerCategory(TCCATEGORY,iconLocation, backgroundLocation);
researchMagicBow = researchMagicBow.setPages(pageMagicBowOne,pageMagicBowTwo);
ResearchCategories.addResearch(researchMagicBow);
String[] focusParents = {magicBowKey,"FOCUSFIRE","INFUSION"};
researchFocus.setParents(focusParents);
researchFocus = researchFocus.setPages(pageFocusOne,pageFocusTwo);
ResearchCategories.addResearch(researchFocus);
String[] colouredFocusParents = {magicBowKey, "FOCUSFIRE","INFUSION",illuminatingFocusKey};
researchColouredFocus.setParents(colouredFocusParents);
researchColouredFocus = researchColouredFocus.setPages(pageColouredFocusOne, pageColouredFocusTwo);
ResearchCategories.addResearch(researchColouredFocus);
}
示例4: removeResearch
import thaumcraft.api.research.ResearchCategories; //导入依赖的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;
}
}
}
}
示例5: registerResearch
import thaumcraft.api.research.ResearchCategories; //导入依赖的package包/类
@Override
protected void registerResearch()
{
// Create the research tab
ResearchCategories.registerCategory(
ResearchRegistry.TERESEARCH_TAB, FeatureThaumicEnergisticsResearch.TAB_ICON,
FeatureThaumicEnergisticsResearch.RESEARCH_BACKGROUND );
// Create the basic research item
ResearchTypes.BASIC.researchItem = new ResearchItem( this.researchKey,
ResearchRegistry.TERESEARCH_TAB, new AspectList(),
0, 0, 0, FeatureThaumicEnergisticsResearch.TAB_ICON );
ResearchTypes.BASIC.researchItem.setPages( new ResearchPage[] {
new ResearchPage( ResearchTypes.BASIC.getPageName( 1 ) ) } );
ResearchTypes.BASIC.researchItem.setRound().setAutoUnlock();
ResearchTypes.BASIC.researchItem.registerResearchItem();
}
示例6: removeResearch
import thaumcraft.api.research.ResearchCategories; //导入依赖的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;
}
}
}
}
示例7: getCraftingRecipeKey
import thaumcraft.api.research.ResearchCategories; //导入依赖的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;
}
示例8: create
import thaumcraft.api.research.ResearchCategories; //导入依赖的package包/类
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;
}
示例9: shouldVortexResearchNote
import thaumcraft.api.research.ResearchCategories; //导入依赖的package包/类
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;
}
示例10: getCraftingRecipeKey
import thaumcraft.api.research.ResearchCategories; //导入依赖的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;
}
示例11: newPseudo
import thaumcraft.api.research.ResearchCategories; //导入依赖的package包/类
/**
* Creates a new pseudo research item.
*
* @param key
* @param category
* @param realKey
* @param realCategory
* @param column
* @param row
* @return
*/
public static PseudoResearchItem newPseudo( final String key, final String category, final String realKey, final String realCategory,
final int column, final int row )
{
PseudoResearchItem pseudo;
// Get the actual research item
ResearchItem realResearch = ResearchCategories.researchCategories.get( realCategory ).research.get( realKey );
// Create the pseudo research
if( realResearch.icon_item != null )
{
pseudo = new PseudoResearchItem( key, category, column, row, realResearch.icon_item );
}
else
{
pseudo = new PseudoResearchItem( key, category, column, row, realResearch.icon_resource );
}
// Set the real research item
pseudo.realResearch = realResearch;
// Link to the research
pseudo.linkToRealResearch();
return pseudo;
}
示例12: getCraftingRecipeKey
import thaumcraft.api.research.ResearchCategories; //导入依赖的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;
}
示例13: addResearch
import thaumcraft.api.research.ResearchCategories; //导入依赖的package包/类
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();
}
示例14: getCraftingRecipeKey
import thaumcraft.api.research.ResearchCategories; //导入依赖的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;
}
示例15: giveResearch
import thaumcraft.api.research.ResearchCategories; //导入依赖的package包/类
public static void giveResearch(EntityPlayer player, String research) {
if (ResearchCategories.getResearch(research) != null) {
giveRecursiveResearch(player, research);
PacketHandler.INSTANCE.sendToServer(new PacketSyncResearch(player));
}
}