2015-08-29 14:33:25 +02:00
|
|
|
|
/*
|
|
|
|
|
* This file ("BookletIndexEntry.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
|
|
|
|
|
|
|
|
|
import ellpeck.actuallyadditions.util.ModUtil;
|
|
|
|
|
import ellpeck.actuallyadditions.util.StringUtil;
|
2015-10-23 19:05:02 +02:00
|
|
|
|
import net.minecraft.util.EnumChatFormatting;
|
2015-08-28 21:17:09 +02:00
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
|
|
public class BookletIndexEntry{
|
|
|
|
|
|
|
|
|
|
private final String unlocalizedName;
|
2015-10-23 19:05:02 +02:00
|
|
|
|
private EnumChatFormatting color;
|
2015-08-28 21:17:09 +02:00
|
|
|
|
public ArrayList<BookletChapter> chapters = new ArrayList<BookletChapter>();
|
|
|
|
|
|
|
|
|
|
public BookletIndexEntry(String unlocalizedName){
|
|
|
|
|
this.unlocalizedName = unlocalizedName;
|
|
|
|
|
InitBooklet.entries.add(this);
|
2015-10-23 19:05:02 +02:00
|
|
|
|
|
|
|
|
|
this.color = EnumChatFormatting.RESET;
|
2015-08-28 21:17:09 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getUnlocalizedName(){
|
|
|
|
|
return this.unlocalizedName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addChapter(BookletChapter chapter){
|
|
|
|
|
this.chapters.add(chapter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getLocalizedName(){
|
|
|
|
|
return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".indexEntry."+this.unlocalizedName+".name");
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-23 19:05:02 +02:00
|
|
|
|
public String getNameWithColor(){
|
|
|
|
|
return this.color+this.getLocalizedName();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BookletIndexEntry setImportant(){
|
|
|
|
|
this.color = EnumChatFormatting.DARK_GREEN;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BookletIndexEntry setSpecial(){
|
|
|
|
|
this.color = EnumChatFormatting.GOLD;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-28 21:17:09 +02:00
|
|
|
|
}
|