2015-08-29 14:33:25 +02:00
|
|
|
/*
|
2015-12-30 22:02:15 +01:00
|
|
|
* This file ("BookletEntry.java") is part of the Actually Additions Mod for Minecraft.
|
2015-08-29 14:33:25 +02:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-01-03 16:05:51 +01:00
|
|
|
* http://ellpeck.de/actaddlicense/
|
2015-08-29 14:33:25 +02:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2016-01-03 16:05:51 +01:00
|
|
|
* © 2016 Ellpeck
|
2015-08-29 14:33:25 +02:00
|
|
|
*/
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.booklet.entry;
|
2015-08-28 21:17:09 +02:00
|
|
|
|
2016-01-05 14:57:50 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
|
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
2016-01-05 04:47:35 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.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;
|
2016-01-05 14:57:50 +01:00
|
|
|
import java.util.List;
|
2015-08-28 21:17:09 +02:00
|
|
|
|
2016-01-05 14:57:50 +01:00
|
|
|
public class BookletEntry implements IBookletEntry{
|
2015-08-28 21:17:09 +02:00
|
|
|
|
|
|
|
private final String unlocalizedName;
|
2016-01-05 14:57:50 +01:00
|
|
|
public List<IBookletChapter> chapters = new ArrayList<IBookletChapter>();
|
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;
|
2016-01-05 14:57:50 +01:00
|
|
|
ActuallyAdditionsAPI.addBookletEntry(this);
|
2015-10-23 19:05:02 +02:00
|
|
|
|
|
|
|
this.color = EnumChatFormatting.RESET;
|
2015-08-28 21:17:09 +02:00
|
|
|
}
|
|
|
|
|
2016-01-05 14:57:50 +01:00
|
|
|
@Override
|
|
|
|
public List<IBookletChapter> getChapters(){
|
|
|
|
return this.chapters;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setChapters(List<IBookletChapter> chapters){
|
|
|
|
this.chapters = chapters;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-02-01 17:49:55 +01:00
|
|
|
public String getUnlocalizedName(){
|
|
|
|
return this.unlocalizedName;
|
2016-01-05 14:57:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-10-28 14:46:04 +01:00
|
|
|
public String getLocalizedName(){
|
|
|
|
return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".indexEntry."+this.unlocalizedName+".name");
|
|
|
|
}
|
|
|
|
|
2016-02-01 17:49:55 +01:00
|
|
|
@Override
|
|
|
|
public String getLocalizedNameWithFormatting(){
|
|
|
|
return this.color+this.getLocalizedName();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void addChapter(IBookletChapter chapter){
|
|
|
|
this.chapters.add(chapter);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|