本文整理汇总了Java中amerifrance.guideapi.page.PageText类的典型用法代码示例。如果您正苦于以下问题:Java PageText类的具体用法?Java PageText怎么用?Java PageText使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PageText类属于amerifrance.guideapi.page包,在下文中一共展示了PageText类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildEntries
import amerifrance.guideapi.page.PageText; //导入依赖的package包/类
public static Map<ResourceLocation, EntryAbstract> buildEntries(){
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<>();
EntryAbstract blank = new EntryItemStack(WizardryRegistry.inscription.getUnlocalizedName()+".name", new ItemStack(WizardryRegistry.inscription));
blank.addPage(new PageItemStack(ENTRY_KEY+"blank.description", WizardryRegistry.inscription));
for(IRecipe r:Utils.getRecipesForOutput(new ItemStack(WizardryRegistry.inscription))){
blank.addPage(new PageIRecipe(r));
}
entries.put(new ResourceLocation(ENTRY_KEY+"blank"),blank);
for(String id:DustRegistry.getInscIDs()){
Inscription insc = DustRegistry.getInscriptionByID(id);
EntryAbstract insEntry = new EntryItemStack(insc.getName(),DustRegistry.getStackForInscription(id));
insEntry.addPage(new PageText(insc.getShortDesc()));
StringBuilder text = new StringBuilder();
//sacrifice
text.append(RunesOfWizardry.proxy.translate(References.Lang.SACRIFICE)+"\n");
ItemStack[] items = insc.getChargeItems();
if(items!=null){
for(ItemStack s:items){
text.append("-"+(s.getCount()>=0? (s.getCount()<10?" ":"")+s.getCount()+"x " : RunesOfWizardry.proxy.translate(References.Lang.ANY_AMOUNT)+" ")+s.getDisplayName()+"\n");
}
}
//extra sacrifice info
String extraInfo = insc.getExtraChargeInfo();
if(extraInfo!=null){
text.append(" "+RunesOfWizardry.proxy.translate(extraInfo)+"\n");
}else if(items==null){
text.append(" "+RunesOfWizardry.proxy.translate(References.Lang.NOTHING)+"\n");
}
insEntry.addPageList(PageHelper.pagesForLongText(text.toString(),100));
//TODO pattern + requirements
insEntry.addPage(new PageText(RunesOfWizardry.proxy.translate(ENTRY_KEY+"see_rune", RunesOfWizardry.proxy.translate(insc.getName()))));
entries.put(new ResourceLocation(insc.getName()), insEntry);
}
return entries;
}