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

59 lines
1.6 KiB
Java
Raw Normal View History

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;
import net.minecraft.util.EnumChatFormatting;
2015-08-28 21:17:09 +02:00
import java.util.ArrayList;
public class BookletIndexEntry{
private final String unlocalizedName;
public ArrayList<BookletChapter> chapters = new ArrayList<BookletChapter>();
2015-10-28 14:46:04 +01:00
private EnumChatFormatting color;
2015-08-28 21:17:09 +02:00
public BookletIndexEntry(String unlocalizedName){
this.unlocalizedName = unlocalizedName;
InitBooklet.entries.add(this);
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 getNameWithColor(){
return this.color+this.getLocalizedName();
}
2015-10-28 14:46:04 +01:00
public String getLocalizedName(){
return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".indexEntry."+this.unlocalizedName+".name");
}
public BookletIndexEntry setImportant(){
this.color = EnumChatFormatting.DARK_GREEN;
return this;
}
public BookletIndexEntry setSpecial(){
this.color = EnumChatFormatting.DARK_PURPLE;
return this;
}
2015-08-28 21:17:09 +02:00
}