本文整理匯總了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);
}