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
|
|
|
|
*
|
2015-11-02 20:55:19 +01:00
|
|
|
* © 2015 Ellpeck
|
2015-08-29 14:33:25 +02:00
|
|
|
*/
|
|
|
|
|
2015-11-11 18:51:20 +01:00
|
|
|
package ellpeck.actuallyadditions.booklet.entry;
|
2015-08-28 21:17:09 +02:00
|
|
|
|
2015-11-11 18:51:20 +01:00
|
|
|
import ellpeck.actuallyadditions.booklet.InitBooklet;
|
|
|
|
import ellpeck.actuallyadditions.booklet.chapter.BookletChapter;
|
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;
|
|
|
|
|
2015-11-11 18:51:20 +01:00
|
|
|
public class BookletEntry{
|
2015-08-28 21:17:09 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2015-11-11 18:51:20 +01:00
|
|
|
public BookletEntry(String unlocalizedName){
|
2015-08-28 21:17:09 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2015-10-23 19:05:02 +02:00
|
|
|
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");
|
|
|
|
}
|
|
|
|
|
2015-11-11 18:51:20 +01:00
|
|
|
public BookletEntry setImportant(){
|
2015-10-23 19:05:02 +02:00
|
|
|
this.color = EnumChatFormatting.DARK_GREEN;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2015-11-11 18:51:20 +01:00
|
|
|
public BookletEntry setSpecial(){
|
2015-12-17 22:18:37 +01:00
|
|
|
this.color = EnumChatFormatting.DARK_PURPLE;
|
2015-10-23 19:05:02 +02:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2015-08-28 21:17:09 +02:00
|
|
|
}
|