From 12abe6f6f6668f7a10d4b2612216820a956b19e1 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 11 Nov 2016 15:24:24 +0100 Subject: [PATCH] Removed booklet word counting --- .../mod/config/values/ConfigBoolValues.java | 2 - .../mod/proxy/ClientProxy.java | 63 ------------------- 2 files changed, 65 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java index 6ead3f8b4..b4c8243d6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java @@ -45,8 +45,6 @@ public enum ConfigBoolValues{ 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?"), - 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?"), LASER_RELAY_LOSS("Laser Relay Energy Loss", ConfigCategories.MACHINE_VALUES, true, "If Energy Laser Relays should have energy loss"), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java index 316fccbcf..d019f5e56 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -43,10 +43,6 @@ import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; 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.HashMap; import java.util.List; @@ -57,55 +53,6 @@ public class ClientProxy implements IProxy{ private static final List COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING = new ArrayList(); private static final Map MODEL_LOCATIONS_FOR_REGISTERING = new HashMap(); - 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 public void preInit(FMLPreInitializationEvent event){ ModUtil.LOGGER.info("PreInitializing ClientProxy..."); @@ -119,16 +66,6 @@ public class ClientProxy implements IProxy{ this.registerCustomFluidBlockRenderer(InitFluids.fluidCrystalOil); 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(); }