本文整理汇总了Java中thaumcraft.api.research.ResearchPage.PageType类的典型用法代码示例。如果您正苦于以下问题:Java PageType类的具体用法?Java PageType怎么用?Java PageType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PageType类属于thaumcraft.api.research.ResearchPage包,在下文中一共展示了PageType类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPages
import thaumcraft.api.research.ResearchPage.PageType; //导入依赖的package包/类
@Override
public ResearchItem setPages(ResearchPage... par) {
for (ResearchPage page : par) {
if (page.type == PageType.TEXT)
page.text = "emt.text." + key;
if (page.type == PageType.INFUSION_CRAFTING) {
if (parentsHidden == null || parentsHidden.length == 0)
parentsHidden = new String[]{"INFUSION"};
else {
String[] newParents = new String[parentsHidden.length + 1];
newParents[0] = "INFUSION";
for (int i = 0; i < parentsHidden.length; i++)
newParents[i + 1] = parentsHidden[i];
parentsHidden = newParents;
}
}
}
return super.setPages(par);
}
示例2: setPages
import thaumcraft.api.research.ResearchPage.PageType; //导入依赖的package包/类
@Override
public ResearchItem setPages(ResearchPage... pages) {
for (ResearchPage page : pages) {
if (page.type == PageType.TEXT) {
page.text = "xarresearch.page." + key + "." + page.text;
}
//if our page type is 'INFUSION_CRAFTING' ensure that this page only displays when we have unlocked
//infusion crafting. We use 'parentsHidden' here because we are adding this research to our own tab(s)
//so there is no need to try to draw the line that attaches most other research
if (page.type == PageType.INFUSION_CRAFTING) {
//add the infusion research to its list of 'parentsHidden' if it has none already
if (parentsHidden == null || parentsHidden.length == 0) {
parentsHidden = new String[]{"INFUSION"};
}
//otherwise add it to its 'parentsHidden'
else {
String[] newParents = new String[parentsHidden.length + 1];
newParents[0] = "INFUSION";
for (int i = 0; i < parentsHidden.length; i++) {
newParents[i + 1] = parentsHidden[i];
}
parentsHidden = newParents;
}
}
}
return super.setPages(pages);
}
示例3: setPages
import thaumcraft.api.research.ResearchPage.PageType; //导入依赖的package包/类
@Override
public ResearchItem setPages(ResearchPage... pages) {
for(ResearchPage Page : pages) {
if(Page.type == PageType.TEXT)
Page.text = "twresearch.page." + key + "." + Page.text;
}
return super.setPages(pages);
}