ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/booklet/BookletChapter.java

44 lines
1.3 KiB
Java
Raw Normal View History

2015-08-29 14:33:25 +02:00
/*
* This file ("BookletChapter.java") is part of the Actually Additions Mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* <EFBFBD> 2015 Ellpeck
*/
2015-08-29 23:01:13 +02:00
package ellpeck.actuallyadditions.booklet;
2015-08-28 21:17:09 +02:00
2015-08-29 23:01:13 +02:00
import ellpeck.actuallyadditions.booklet.page.IBookletPage;
2015-08-28 21:17:09 +02:00
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.StringUtil;
public class BookletChapter{
public final IBookletPage[] pages;
private final String unlocalizedName;
public final BookletIndexEntry entry;
public BookletChapter(String unlocalizedName, BookletIndexEntry entry, IBookletPage... pages){
this.pages = pages.clone();
2015-08-28 21:17:09 +02:00
this.unlocalizedName = unlocalizedName;
entry.addChapter(this);
2015-08-29 14:31:02 +02:00
InitBooklet.allAndSearch.addChapter(this);
2015-08-28 21:17:09 +02:00
this.entry = entry;
for(IBookletPage page : this.pages){
page.setChapter(this);
}
}
public String getUnlocalizedName(){
return this.unlocalizedName;
}
public String getLocalizedName(){
return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".chapter."+this.unlocalizedName+".name");
}
}