
AussieTerra
Members-
Posts
15 -
Joined
-
Last visited
Everything posted by AussieTerra
-
Hi! what i'm trying to do is replace the generic GuiChat with my own "VisualizationGuiChat" which extends GuiScreen. my class is an exact copy of GuiChat but with my own modifications. now for making the game use my Gui i've put this into my main mod file (Note i'm on minecraft version 1.6.4) @ForgeSubscribe public void onOpenGuiScreen(GuiOpenEvent event) { if(!(event.gui instanceof VisualizationGuiChat) && event.gui instanceof GuiChat) { String s = ""; try { s = readPrivateClassString("defaultInputFieldText", event.gui); } catch (Exception e) { System.out.println("Failed to get defaultInputFieldText"); } //mc.displayGuiScreen(null);//clear the current screen mc.thePlayer.closeScreen(); mc.displayGuiScreen(new VisualizationGuiChat(s)); } } my GUI initializes and stuff (tested through breakpointing) however my keyTyped event never fires, it is instead fired in GuiChat, which then tells me that GuiChat was never closed as per my instruction here: mc.thePlayer.closeScreen(); before opening my one. this is probably a messy way to go about it, though i'm unsure if forge's key events override the ones in Minecraft.java.. if so i could just slave the chat key to my own GUI and just be done with it but yeah.. what's stopping GuiChat from closing?
-
nevermind, jar got corrupted. all sorted now!
-
Hey again, my problem this time is trying to install my mid into the mods folder. i've recompiled/reobfuscated and zipped my mod and placed it into the mods folder but in the startup log i'm always getting these errors [23:09:56 INFO]: Client> 2014-03-09 23:09:56 [WARNING] [ForgeModLoader] Zip file BlockHighlighter.zip failed to read properly, it will be ignored [23:09:56 INFO]: Client> java.util.zip.ZipException: error in opening zip file [23:09:56 INFO]: Client> at java.util.zip.ZipFile.open(Native Method) [23:09:56 INFO]: Client> at java.util.zip.ZipFile.<init>(Unknown Source) [23:09:56 INFO]: Client> at java.util.zip.ZipFile.<init>(Unknown Source) [23:09:56 INFO]: Client> at java.util.jar.JarFile.<init>(Unknown Source) [23:09:56 INFO]: Client> at java.util.jar.JarFile.<init>(Unknown Source) [23:09:56 INFO]: Client> at cpw.mods.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:41) [23:09:56 INFO]: Client> at cpw.mods.fml.common.discovery.ContainerType.findMods(ContainerType.java:42) [23:09:56 INFO]: Client> at cpw.mods.fml.common.discovery.ModCandidate.explore(ModCandidate.java:71) [23:09:56 INFO]: Client> at cpw.mods.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:137) [23:09:56 INFO]: Client> at cpw.mods.fml.common.Loader.identifyMods(Loader.java:353) [23:09:56 INFO]: Client> at cpw.mods.fml.common.Loader.loadMods(Loader.java:484) [23:09:56 INFO]: Client> at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183) [23:09:56 INFO]: Client> at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:473) [23:09:56 INFO]: Client> at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:808) [23:09:56 INFO]: Client> at net.minecraft.client.main.Main.main(SourceFile:101) [23:09:56 INFO]: Client> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [23:09:56 INFO]: Client> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [23:09:56 INFO]: Client> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [23:09:56 INFO]: Client> at java.lang.reflect.Method.invoke(Unknown Source) [23:09:56 INFO]: Client> at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) [23:09:56 INFO]: Client> at net.minecraft.launchwrapper.Launch.main(Launch.java:27) what must the zip file have in order to be read properly?
-
All good! i figured it out! thank you very much for all the help!
-
Uh-oh.. i can't register my TickHandler properly How do i set it up properly? i've included my code below in the main mod file: ... public VisualizationsClientProxy proxy; @EventHandler public void load(FMLInitializationEvent event) { proxy.registerClientTickHandler(); ... } in my proxy file: public void registerClientTickHandler() { TickRegistry.registerTickHandler(new VisualizationsRenderTickHandler(), Side.CLIENT); } The tick handle: import java.util.EnumSet; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class VisualizationsRenderTickHandler implements ITickHandler { @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { // TODO Auto-generated method stub } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { // TODO Auto-generated method stub System.out.println("TickEnd"); } @Override public EnumSet<TickType> ticks() { // TODO Auto-generated method stub return null; } @Override public String getLabel() { // TODO Auto-generated method stub return null; } }
-
Thank you very much! you've been an amazing help and very patient with what i now see as my completely random and all-over-the-place questions.. i really appreciate it!
-
Sweet, thank you very much! i know 1.7.2 bring along RenderTickEvent.. what was it before 1.7.2 was released?
-
rendering AABBs and calculating where to render them relative to the player from a list of co-ordinates i've just been reading tutorial after tutorial and they're saying stuff about TickHandlers and whatnot does forge have a magical way of doing that?
-
brilliant, thank you very much for being patient with me From my reading i assume i must make a TickHandler class and register it similar to the eventHandler class i've had to make?
-
so i make a void that accepts a KeyEvent and Annotate it with @ForgeSubscribe in order to check the key and process any actions i want from there?
-
Thanks mate but non of them tell me the proper event for a key being hit.. and i've been trawling tutorials and all of them tell me to do something different each time which is excruciating to understand
-
thank you very much for the quick replies, i'm looking at those methods/classes but not sure how to use them within my mod class, any extra pointers?
-
just rendering AABBs in the world when desired with a HUD element reflecting it's state EDIT: oh and also the good old key toggle
-
That's what i'm after I'm extreeemely familiar with extending classes and whatnot to avoid editing base classes however i'm not entirely sure whether Forge and even minecraft structure allows for it. does Forge have a solution to overriding certain parts of a class without editing their base?
-
Hi there, please forgive me, this is my first time using forge for developing a little personal visualization for SP (i make these a god-awful lot ) What i would like help in is figuring out what i need to do differently in order to make my mod work with forge. I have a mod that at the moment just edits base Minecraft classes. (Minecraft.java, GuiIngame.java, RenderGlobal.java) though i assume that working through forge would no longer allow me to do this and get away with it, so how do i go about editing these classes so that they work when it comes to obfuscating, zipping and placing in the mods folder? thank you in advance, AussieTerra