// Path: src/main/java/info/ata4/minecraft/dragon/DragonMounts.java
// @Mod(
//     modid = DragonMounts.ID,
//     name = DragonMounts.NAME,
//     version = DragonMounts.VERSION,
//     useMetadata = true,
//     guiFactory = "info.ata4.minecraft.dragon.DragonMountsConfigGuiFactory"
// )
// public class DragonMounts {
//     
//     public static final String NAME = "Dragon Mounts";
//     public static final String ID = "DragonMounts";
//     public static final String AID = ID.toLowerCase();
//     public static final String VERSION = "@VERSION@";
//     
//     @SidedProxy(
//         serverSide = "info.ata4.minecraft.dragon.server.CommonProxy",
//         clientSide = "info.ata4.minecraft.dragon.client.ClientProxy"
//     )
//     public static CommonProxy proxy;
//     
//     @Instance(ID)
//     public static DragonMounts instance;
//     
//     private ModMetadata metadata;
//     private DragonMountsConfig config;
//     
//     public DragonMountsConfig getConfig() {
//         return config;
//     }
//     
//     public ModMetadata getMetadata() {
//         return metadata;
//     }
//     
//     @EventHandler
//     public void onPreInit(FMLPreInitializationEvent evt) {
//         config = new DragonMountsConfig(new Configuration(evt.getSuggestedConfigurationFile()));
//         metadata = evt.getModMetadata();
//         proxy.onPreInit(evt);
//     }
// 
//     @EventHandler
//     public void onInit(FMLInitializationEvent evt) {
//         proxy.onInit(evt);
//     }
// 
//     @EventHandler
//     public void onPostInit(FMLPostInitializationEvent event) {
//         proxy.onPostInit(event);
//     }
//     
//     @EventHandler
//     public void onServerStarting(FMLServerStartingEvent evt) {
//         proxy.onServerStarting(evt);
//     }
//     
//     @EventHandler
//     public void onServerStopped(FMLServerStoppedEvent evt) {
//         proxy.onServerStopped(evt);
//     }
// }
// 
// Path: src/main/java/info/ata4/minecraft/dragon/util/reflection/PrivateAccessor.java
// public interface PrivateAccessor {
//     
//     static final String[] GUIMAINMENU_SPLASHTEXT = new String[] {"splashText", "field_73975_c"};
//     
//     default boolean entityIsJumping(EntityLivingBase entity) {
//         return ReflectionHelper.getPrivateValue(EntityLivingBase.class, entity,
//                 new String[] {"isJumping", "field_70703_bu"});
//     }
//     
//     default String mainMenuGetSplashText(GuiMainMenu menu) {
//         return ReflectionHelper.getPrivateValue(GuiMainMenu.class, menu,
//                 GUIMAINMENU_SPLASHTEXT);
//     }
//     
//     default void mainMenuSetSplashText(GuiMainMenu menu, String splash) {
//         ReflectionHelper.setPrivateValue(GuiMainMenu.class, menu, splash,
//                 GUIMAINMENU_SPLASHTEXT);
//     }
// }


import info.ata4.minecraft.dragon.DragonMounts;
import info.ata4.minecraft.dragon.util.reflection.PrivateAccessor;
import java.io.InputStream;
import java.util.List;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/*
 ** 2014 January 29
 **
 ** The author disclaims copyright to this source code.  In place of
 ** a legal notice, here is a blessing:
 **    May you do good and not evil.
 **    May you find forgiveness for yourself and forgive others.
 **    May you share freely, never taking more than you give.
 */
package info.ata4.minecraft.dragon.client.handler;


/**
 * Replaces the splash text with a random custom one sometimes.
 * 
 * @author Nico Bergemann <barracuda415 at yahoo.de>
 */
public class DragonSplash implements PrivateAccessor {
    
    private static final Logger L = LogManager.getLogger();
// Path: src/main/java/info/ata4/minecraft/dragon/DragonMounts.java
// @Mod(
//     modid = DragonMounts.ID,
//     name = DragonMounts.NAME,
//     version = DragonMounts.VERSION,
//     useMetadata = true,
//     guiFactory = "info.ata4.minecraft.dragon.DragonMountsConfigGuiFactory"
// )
// public class DragonMounts {
//     
//     public static final String NAME = "Dragon Mounts";
//     public static final String ID = "DragonMounts";
//     public static final String AID = ID.toLowerCase();
//     public static final String VERSION = "@VERSION@";
//     
//     @SidedProxy(
//         serverSide = "info.ata4.minecraft.dragon.server.CommonProxy",
//         clientSide = "info.ata4.minecraft.dragon.client.ClientProxy"
//     )
//     public static CommonProxy proxy;
//     
//     @Instance(ID)
//     public static DragonMounts instance;
//     
//     private ModMetadata metadata;
//     private DragonMountsConfig config;
//     
//     public DragonMountsConfig getConfig() {
//         return config;
//     }
//     
//     public ModMetadata getMetadata() {
//         return metadata;
//     }
//     
//     @EventHandler
//     public void onPreInit(FMLPreInitializationEvent evt) {
//         config = new DragonMountsConfig(new Configuration(evt.getSuggestedConfigurationFile()));
//         metadata = evt.getModMetadata();
//         proxy.onPreInit(evt);
//     }
// 
//     @EventHandler
//     public void onInit(FMLInitializationEvent evt) {
//         proxy.onInit(evt);
//     }
// 
//     @EventHandler
//     public void onPostInit(FMLPostInitializationEvent event) {
//         proxy.onPostInit(event);
//     }
//     
//     @EventHandler
//     public void onServerStarting(FMLServerStartingEvent evt) {
//         proxy.onServerStarting(evt);
//     }
//     
//     @EventHandler
//     public void onServerStopped(FMLServerStoppedEvent evt) {
//         proxy.onServerStopped(evt);
//     }
// }
// 
// Path: src/main/java/info/ata4/minecraft/dragon/util/reflection/PrivateAccessor.java
// public interface PrivateAccessor {
//     
//     static final String[] GUIMAINMENU_SPLASHTEXT = new String[] {"splashText", "field_73975_c"};
//     
//     default boolean entityIsJumping(EntityLivingBase entity) {
//         return ReflectionHelper.getPrivateValue(EntityLivingBase.class, entity,
//                 new String[] {"isJumping", "field_70703_bu"});
//     }
//     
//     default String mainMenuGetSplashText(GuiMainMenu menu) {
//         return ReflectionHelper.getPrivateValue(GuiMainMenu.class, menu,
//                 GUIMAINMENU_SPLASHTEXT);
//     }
//     
//     default void mainMenuSetSplashText(GuiMainMenu menu, String splash) {
//         ReflectionHelper.setPrivateValue(GuiMainMenu.class, menu, splash,
//                 GUIMAINMENU_SPLASHTEXT);
//     }
// }


// Path: src/main/java/info/ata4/minecraft/dragon/client/handler/DragonSplash.java
import info.ata4.minecraft.dragon.DragonMounts;
import info.ata4.minecraft.dragon.util.reflection.PrivateAccessor;
import java.io.InputStream;
import java.util.List;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/*
 ** 2014 January 29
 **
 ** The author disclaims copyright to this source code.  In place of
 ** a legal notice, here is a blessing:
 **    May you do good and not evil.
 **    May you find forgiveness for yourself and forgive others.
 **    May you share freely, never taking more than you give.
 */
package info.ata4.minecraft.dragon.client.handler;


/**
 * Replaces the splash text with a random custom one sometimes.
 * 
 * @author Nico Bergemann <barracuda415 at yahoo.de>
 */
public class DragonSplash implements PrivateAccessor {
    
    private static final Logger L = LogManager.getLogger();
    private static final ResourceLocation RESOURCE_SPLASHES = new ResourceLocation(DragonMounts.AID, "splashes.txt");