diff --git a/src/main/java/biomesoplenty/client/gui/GuiMainMenuBOP.java b/src/main/java/biomesoplenty/client/gui/GuiMainMenuBOP.java new file mode 100755 index 000000000..4978ab517 --- /dev/null +++ b/src/main/java/biomesoplenty/client/gui/GuiMainMenuBOP.java @@ -0,0 +1,20 @@ +package biomesoplenty.client.gui; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +import biomesoplenty.common.helpers.BOPReflectionHelper; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.util.ResourceLocation; + +public class GuiMainMenuBOP extends GuiMainMenu +{ + public static ResourceLocation[] bopTitlePanoramaPaths = new ResourceLocation[] {new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_0.png"), new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_1.png"), new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_2.png"), new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_3.png"), new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_4.png"), new ResourceLocation("biomesoplenty:textures/gui/title/background/panorama_5.png")}; + + public GuiMainMenuBOP() + { + super(); + + BOPReflectionHelper.setPrivateFinalValue(GuiMainMenu.class, this, bopTitlePanoramaPaths, "titlePanoramaPaths", "field_73978_o"); + } +} \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/eventhandler/BOPEventHandlers.java b/src/main/java/biomesoplenty/common/eventhandler/BOPEventHandlers.java old mode 100644 new mode 100755 index 45ace8137..1277ab915 --- a/src/main/java/biomesoplenty/common/eventhandler/BOPEventHandlers.java +++ b/src/main/java/biomesoplenty/common/eventhandler/BOPEventHandlers.java @@ -1,53 +1,55 @@ -package biomesoplenty.common.eventhandler; - -import net.minecraftforge.common.MinecraftForge; -import biomesoplenty.common.eventhandler.entity.DyeEventHandler; -import biomesoplenty.common.eventhandler.entity.FlippersEventHandler; -import biomesoplenty.common.eventhandler.entity.TemptEventHandler; -import biomesoplenty.common.eventhandler.gui.StartupWarningEventHandler; -import biomesoplenty.common.eventhandler.misc.CapeEventHandler; -import biomesoplenty.common.eventhandler.potions.PotionParalysisEventHandler; -import biomesoplenty.common.eventhandler.potions.PotionPossessionEventHandler; -import biomesoplenty.common.eventhandler.world.DecorateBiomeEventHandler; -import biomesoplenty.common.eventhandler.world.DecorationModificationEventHandler; - -public class BOPEventHandlers -{ - public static void init() - { - registerWorldEventHandlers(); - registerEntityEventHandlers(); - registerPotionEventHandlers(); - registerGUIEventHandlers(); - registerMiscEventHandlers(); - } - - private static void registerWorldEventHandlers() - { - MinecraftForge.EVENT_BUS.register(new DecorateBiomeEventHandler()); - MinecraftForge.TERRAIN_GEN_BUS.register(new DecorationModificationEventHandler()); - } - - private static void registerEntityEventHandlers() - { - MinecraftForge.EVENT_BUS.register(new DyeEventHandler()); - MinecraftForge.EVENT_BUS.register(new FlippersEventHandler()); - MinecraftForge.EVENT_BUS.register(new TemptEventHandler()); - } - - private static void registerPotionEventHandlers() - { - MinecraftForge.EVENT_BUS.register(new PotionParalysisEventHandler()); - MinecraftForge.EVENT_BUS.register(new PotionPossessionEventHandler()); - } - - private static void registerGUIEventHandlers() - { - MinecraftForge.EVENT_BUS.register(StartupWarningEventHandler.instance); - } - - private static void registerMiscEventHandlers() - { - MinecraftForge.EVENT_BUS.register(new CapeEventHandler()); - } -} +package biomesoplenty.common.eventhandler; + +import net.minecraftforge.common.MinecraftForge; +import biomesoplenty.common.eventhandler.entity.DyeEventHandler; +import biomesoplenty.common.eventhandler.entity.FlippersEventHandler; +import biomesoplenty.common.eventhandler.entity.TemptEventHandler; +import biomesoplenty.common.eventhandler.gui.MainMenuOverrideEventHandler; +import biomesoplenty.common.eventhandler.gui.StartupWarningEventHandler; +import biomesoplenty.common.eventhandler.misc.CapeEventHandler; +import biomesoplenty.common.eventhandler.potions.PotionParalysisEventHandler; +import biomesoplenty.common.eventhandler.potions.PotionPossessionEventHandler; +import biomesoplenty.common.eventhandler.world.DecorateBiomeEventHandler; +import biomesoplenty.common.eventhandler.world.DecorationModificationEventHandler; + +public class BOPEventHandlers +{ + public static void init() + { + registerWorldEventHandlers(); + registerEntityEventHandlers(); + registerPotionEventHandlers(); + registerGUIEventHandlers(); + registerMiscEventHandlers(); + } + + private static void registerWorldEventHandlers() + { + MinecraftForge.EVENT_BUS.register(new DecorateBiomeEventHandler()); + MinecraftForge.TERRAIN_GEN_BUS.register(new DecorationModificationEventHandler()); + } + + private static void registerEntityEventHandlers() + { + MinecraftForge.EVENT_BUS.register(new DyeEventHandler()); + MinecraftForge.EVENT_BUS.register(new FlippersEventHandler()); + MinecraftForge.EVENT_BUS.register(new TemptEventHandler()); + } + + private static void registerPotionEventHandlers() + { + MinecraftForge.EVENT_BUS.register(new PotionParalysisEventHandler()); + MinecraftForge.EVENT_BUS.register(new PotionPossessionEventHandler()); + } + + private static void registerGUIEventHandlers() + { + MinecraftForge.EVENT_BUS.register(StartupWarningEventHandler.instance); + MinecraftForge.EVENT_BUS.register(new MainMenuOverrideEventHandler()); + } + + private static void registerMiscEventHandlers() + { + MinecraftForge.EVENT_BUS.register(new CapeEventHandler()); + } +} diff --git a/src/main/java/biomesoplenty/common/eventhandler/gui/MainMenuOverrideEventHandler.java b/src/main/java/biomesoplenty/common/eventhandler/gui/MainMenuOverrideEventHandler.java new file mode 100755 index 000000000..b15072800 --- /dev/null +++ b/src/main/java/biomesoplenty/common/eventhandler/gui/MainMenuOverrideEventHandler.java @@ -0,0 +1,18 @@ +package biomesoplenty.common.eventhandler.gui; + +import biomesoplenty.client.gui.GuiMainMenuBOP; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraftforge.client.event.GuiOpenEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class MainMenuOverrideEventHandler +{ + @SubscribeEvent + public void openMainMenu(GuiOpenEvent event) + { + if (event.gui instanceof GuiMainMenu) + { + event.gui = new GuiMainMenuBOP(); + } + } +} diff --git a/src/main/java/biomesoplenty/common/helpers/BOPReflectionHelper.java b/src/main/java/biomesoplenty/common/helpers/BOPReflectionHelper.java old mode 100644 new mode 100755 index 7ebec54ed..7cb31a68e --- a/src/main/java/biomesoplenty/common/helpers/BOPReflectionHelper.java +++ b/src/main/java/biomesoplenty/common/helpers/BOPReflectionHelper.java @@ -1,28 +1,53 @@ -package biomesoplenty.common.helpers; - -import java.util.Arrays; -import java.util.Map; -import java.util.Map.Entry; - -import com.google.common.collect.BiMap; - -import cpw.mods.fml.common.ObfuscationReflectionHelper; -import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; -import cpw.mods.fml.relauncher.ReflectionHelper; - -public class BOPReflectionHelper -{ - public static T getPrivateValue(Class classToAccess, E instance, String fieldName, String obfFieldName) - { - try - { - Class.forName("net.minecraft.world.World"); - - return ReflectionHelper.getPrivateValue(classToAccess, instance, fieldName); - } - catch (ClassNotFoundException e) - { - return ObfuscationReflectionHelper.getPrivateValue(classToAccess, instance, obfFieldName); - } - } -} +package biomesoplenty.common.helpers; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +import cpw.mods.fml.common.ObfuscationReflectionHelper; +import cpw.mods.fml.relauncher.ReflectionHelper; + +public class BOPReflectionHelper +{ + public static T getPrivateValue(Class classToAccess, E instance, String fieldName, String obfFieldName) + { + try + { + Class.forName("net.minecraft.world.World"); + + return ReflectionHelper.getPrivateValue(classToAccess, instance, fieldName); + } + catch (ClassNotFoundException e) + { + return ObfuscationReflectionHelper.getPrivateValue(classToAccess, instance, obfFieldName); + } + } + + public static void setPrivateFinalValue(Class classToAccess, T instance, E value, String fieldName, String obfFieldName) + { + try + { + Field field = null; + + try + { + Class.forName("net.minecraft.world.World"); + + field = ReflectionHelper.findField(classToAccess, fieldName); + } + catch (ClassNotFoundException e) + { + field = ReflectionHelper.findField(classToAccess, ObfuscationReflectionHelper.remapFieldNames(classToAccess.getName(), obfFieldName)); + } + + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + + field.set(instance, value); + } + catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_0.png b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_0.png new file mode 100644 index 000000000..8eaeb0d80 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_0.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_1.png b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_1.png new file mode 100644 index 000000000..149166074 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_1.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_2.png b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_2.png new file mode 100644 index 000000000..2c596e4f6 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_2.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_3.png b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_3.png new file mode 100644 index 000000000..ff753c455 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_3.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_4.png b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_4.png new file mode 100644 index 000000000..5b00a94a9 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_4.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_5.png b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_5.png new file mode 100644 index 000000000..60f4f8f69 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/gui/title/background/panorama_5.png differ