Made booklet words and characters not be more than they should be because everything was being done twice

This commit is contained in:
Ellpeck 2016-05-26 23:05:08 +02:00
parent 9e50818fca
commit f2ee1b9414

View file

@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderCompost; import de.ellpeck.actuallyadditions.mod.blocks.render.RenderCompost;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderReconstructorLens; import de.ellpeck.actuallyadditions.mod.blocks.render.RenderReconstructorLens;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderSmileyCloud; import de.ellpeck.actuallyadditions.mod.blocks.render.RenderSmileyCloud;
import de.ellpeck.actuallyadditions.mod.booklet.InitBooklet;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.event.InitEvents; import de.ellpeck.actuallyadditions.mod.event.InitEvents;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
@ -68,26 +69,28 @@ public class ClientProxy implements IProxy{
String bookletText = ""; String bookletText = "";
for(IBookletEntry entry : ActuallyAdditionsAPI.BOOKLET_ENTRIES){ for(IBookletEntry entry : ActuallyAdditionsAPI.BOOKLET_ENTRIES){
bookletWordCount += entry.getLocalizedName().split(" ").length; if(entry != ActuallyAdditionsAPI.allAndSearch){
bookletCharCount += entry.getLocalizedName().length(); bookletWordCount += entry.getLocalizedName().split(" ").length;
bookletText+=entry.getLocalizedName()+"\n\n"; bookletCharCount += entry.getLocalizedName().length();
bookletText += entry.getLocalizedName()+"\n\n";
for(IBookletChapter chapter : entry.getChapters()){ for(IBookletChapter chapter : entry.getChapters()){
bookletWordCount += chapter.getLocalizedName().split(" ").length; bookletWordCount += chapter.getLocalizedName().split(" ").length;
bookletCharCount += chapter.getLocalizedName().length(); bookletCharCount += chapter.getLocalizedName().length();
bookletText+=chapter.getLocalizedName()+"\n"; bookletText += chapter.getLocalizedName()+"\n";
for(BookletPage page : chapter.getPages()){ for(BookletPage page : chapter.getPages()){
if(page.getText() != null){ if(page.getText() != null){
bookletWordCount += page.getText().split(" ").length; bookletWordCount += page.getText().split(" ").length;
bookletCharCount += page.getText().length(); bookletCharCount += page.getText().length();
bookletText +=page.getText()+"\n"; bookletText += page.getText()+"\n";
}
} }
} bookletText += "\n";
bookletText+="\n";
}
bookletText += "\n";
} }
bookletText+="\n";
} }
if(ConfigBoolValues.BOOKLET_TEXT_TO_FILE.isEnabled()){ if(ConfigBoolValues.BOOKLET_TEXT_TO_FILE.isEnabled()){