mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Removed booklet word counting
This commit is contained in:
parent
2760c794d6
commit
12abe6f6f6
2 changed files with 0 additions and 65 deletions
|
@ -45,8 +45,6 @@ public enum ConfigBoolValues{
|
||||||
DUNGEON_LOOT("Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot generate in dungeons??"),
|
DUNGEON_LOOT("Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot generate in dungeons??"),
|
||||||
GEN_LUSH_CAVES("Generate Lush Caves", ConfigCategories.WORLD_GEN, true, "Should caves with trees and grass randomly generate underground?"),
|
GEN_LUSH_CAVES("Generate Lush Caves", ConfigCategories.WORLD_GEN, true, "Should caves with trees and grass randomly generate underground?"),
|
||||||
|
|
||||||
BOOKLET_TEXT_TO_FILE("Booklet Text to File", ConfigCategories.OTHER, false, "The entire text of the booklet will be put into a new file in the Minecraft Folder on resource load/Reload. (Use this for Debugging)"),
|
|
||||||
|
|
||||||
WATER_BOWL("Water Bowl", ConfigCategories.OTHER, true, "Should right-clicking a bowl on water blocks create a water bowl?"),
|
WATER_BOWL("Water Bowl", ConfigCategories.OTHER, true, "Should right-clicking a bowl on water blocks create a water bowl?"),
|
||||||
|
|
||||||
LASER_RELAY_LOSS("Laser Relay Energy Loss", ConfigCategories.MACHINE_VALUES, true, "If Energy Laser Relays should have energy loss"),
|
LASER_RELAY_LOSS("Laser Relay Energy Loss", ConfigCategories.MACHINE_VALUES, true, "If Energy Laser Relays should have energy loss"),
|
||||||
|
|
|
@ -43,10 +43,6 @@ import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -57,55 +53,6 @@ public class ClientProxy implements IProxy{
|
||||||
private static final List<Item> COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING = new ArrayList<Item>();
|
private static final List<Item> COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING = new ArrayList<Item>();
|
||||||
private static final Map<ItemStack, ModelResourceLocation> MODEL_LOCATIONS_FOR_REGISTERING = new HashMap<ItemStack, ModelResourceLocation>();
|
private static final Map<ItemStack, ModelResourceLocation> MODEL_LOCATIONS_FOR_REGISTERING = new HashMap<ItemStack, ModelResourceLocation>();
|
||||||
|
|
||||||
public static int bookletWordCount;
|
|
||||||
public static int bookletCharCount;
|
|
||||||
|
|
||||||
private static void countBookletWords(){
|
|
||||||
bookletWordCount = 0;
|
|
||||||
bookletCharCount = 0;
|
|
||||||
String bookletText = "";
|
|
||||||
|
|
||||||
for(IBookletEntry entry : ActuallyAdditionsAPI.BOOKLET_ENTRIES){
|
|
||||||
if(!(entry instanceof BookletEntryAllItems)){
|
|
||||||
bookletWordCount += entry.getLocalizedName().split(" ").length;
|
|
||||||
bookletCharCount += entry.getLocalizedName().length();
|
|
||||||
bookletText += entry.getLocalizedName()+"\n\n";
|
|
||||||
|
|
||||||
for(IBookletChapter chapter : entry.getAllChapters()){
|
|
||||||
bookletWordCount += chapter.getLocalizedName().split(" ").length;
|
|
||||||
bookletCharCount += chapter.getLocalizedName().length();
|
|
||||||
bookletText += chapter.getLocalizedName()+"\n";
|
|
||||||
|
|
||||||
for(IBookletPage page : chapter.getAllPages()){
|
|
||||||
String text = page.getInfoText();
|
|
||||||
if(text != null){
|
|
||||||
bookletWordCount += text.split(" ").length;
|
|
||||||
bookletCharCount += text.length();
|
|
||||||
bookletText += text+"\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bookletText += "\n";
|
|
||||||
|
|
||||||
}
|
|
||||||
bookletText += "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ConfigBoolValues.BOOKLET_TEXT_TO_FILE.isEnabled()){
|
|
||||||
File file = new File(Minecraft.getMinecraft().mcDataDir, ModUtil.MOD_ID+"booklettext.txt");
|
|
||||||
try{
|
|
||||||
file.createNewFile();
|
|
||||||
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
|
||||||
writer.write(TextFormatting.getTextWithoutFormattingCodes(bookletText));
|
|
||||||
writer.close();
|
|
||||||
ModUtil.LOGGER.info("Wrote booklet text to file!");
|
|
||||||
}
|
|
||||||
catch(Exception e){
|
|
||||||
ModUtil.LOGGER.error("Couldn't write booklet text to file!", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void preInit(FMLPreInitializationEvent event){
|
public void preInit(FMLPreInitializationEvent event){
|
||||||
ModUtil.LOGGER.info("PreInitializing ClientProxy...");
|
ModUtil.LOGGER.info("PreInitializing ClientProxy...");
|
||||||
|
@ -119,16 +66,6 @@ public class ClientProxy implements IProxy{
|
||||||
this.registerCustomFluidBlockRenderer(InitFluids.fluidCrystalOil);
|
this.registerCustomFluidBlockRenderer(InitFluids.fluidCrystalOil);
|
||||||
this.registerCustomFluidBlockRenderer(InitFluids.fluidEmpoweredOil);
|
this.registerCustomFluidBlockRenderer(InitFluids.fluidEmpoweredOil);
|
||||||
|
|
||||||
IResourceManager manager = Minecraft.getMinecraft().getResourceManager();
|
|
||||||
if(manager instanceof IReloadableResourceManager){
|
|
||||||
((IReloadableResourceManager)manager).registerReloadListener(new IResourceManagerReloadListener(){
|
|
||||||
@Override
|
|
||||||
public void onResourceManagerReload(IResourceManager resourceManager){
|
|
||||||
countBookletWords();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
InitEntities.initClient();
|
InitEntities.initClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue