SHsuperCM
Members-
Posts
264 -
Joined
-
Last visited
-
Days Won
1
Everything posted by SHsuperCM
-
Is there a way to edit Gui while game is open?
SHsuperCM replied to SHsuperCM's topic in Modder Support
not textures if that what you meant... i mean - real code for "extends GuiScreen" classes.. -
so on my mod again.. im working with guis and im messing with textures and boxes.. and what i've been doing so far is on changes i want to test, i'd restart the game to update the gui.... it might be the only way.. but at the same time i might just be stupid and there is a magic button to save and reload in the same session quickly.... just to be clear, this is a clientside mod and the gui is not linked to any blocks or entities or serverside stuff..
-
i didnt think that the player could be nothing...
-
this didnt happen..
-
so i need it to not be final and set it when the event happend?
-
ok lets say this is my class: public class RingsChatHandler { public static Delay Timeout = new Delay(60); public static void Message(String originalMessage){ if (RingsHUD.Enabled) { if ((originalMessage.contains("8|")) && (originalMessage.contains("9Elytra Racing "))) { if (originalMessage.contains("cFailed to reach next ring!")) { // failed RingsHUD.CheckpointTextColor = "COLOR_RED"; Timeout.Reset(); RingsHUD.ActualCheckPointString = S.F+"lFailed"; } if (originalMessage.contains("eYou have passed ring #")) { //ring passed RingsHUD.CheckpointTextColor = "COLOR_ORANGE"; ///-Get Ring Cur/Max int startat = 0; int endat = 0; RingsHUD.ActualCheckPointString = S.F+"l"; for (int i = 1; i < originalMessage.length(); i++) { if(originalMessage.charAt(i) == '(') startat = i + 1; if(originalMessage.charAt(i) == ')') endat = i - 1; } for(int j = startat; j <= endat; j++){ RingsHUD.ActualCheckPointString = RingsHUD.ActualCheckPointString + originalMessage.charAt(j); } } if (originalMessage.contains("aYou have completed the map (")) { /// finished the map RingsHUD.CheckpointTextColor = "COLOR_LGREEN"; RingsHUD.ActualCheckPointString = S.F+"lFinished!"; Timeout.Reset(); } } } } } and i have it checking for chat messages and the gametick class: public class Timeout{ @SubscribeEvent public void onClientTick(TickEvent.ClientTickEvent event) { if(RingsChatHandler.Timeout.Passed()){ S.cP("this is just a test"); RingsChatHandler.Timeout.StopForever // this is just temporery i will fix it after i get chat working } } } annd this is my S.class i made it for short commands.. public class S{ //this class contains short codes to mass use public static Character F = ' '; // this is the section sign, it is set after the you join the server public static void lg(String text){System.out.println(text);} // log to console public static void cP(String text){Reference.PLAYER.addChatMessage(new TextComponentString(text));} // chat to player } and i have this in my Reference class: public static final EntityPlayer PLAYER = Minecraft.getMinecraft().thePlayer; now when i try to use S.cP("just some text") it does not crash but its not working and its producing: java.lang.NullPointerException: Unexpected error at com.SHsuperCM.ElytraMCMod.Common.S.cP(S.java: at com.SHsuperCM.ElytraMCMod.Common.Objects.Timeout.onClientTick(Timeout.java:13) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_10_Timeout_onClientTick_ClientTickEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) at net.minecraftforge.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:331) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1744) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1117) at net.minecraft.client.Minecraft.run(Minecraft.java:404) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) and please ignore my horrible code...
-
i get a spesific chat message and make it reset the delayobject and then in the client tick i make it check if the delay has passed and if it did then chat to Minecraft.getMinecraft().thePlayer and stop the delay
-
once after my Delay passed and the delay is processed by client tick and system millis
-
the problem here is that im doing it while ingame and i want it to display only for the player using Minecraft.getMinecraft().thePlayer and when i try addChatMessage(new TextComponentString("Welcome, " + player.getDisplayNameString())); it dumps a bunch of errors
-
anyone?
-
[SOLVED] [1.7.10] Replacement of a single unit to another
SHsuperCM replied to evgeny3121's topic in Modder Support
what is the question? are you trying to have a delay between 2 things happening? i dont understand.. -
[1.9.4] NoSuchFieldError when loading mod in MC client
SHsuperCM replied to OhiraKyou's topic in Modder Support
jus browsing through the mod seeing what you did, why in the lang file you have item.turtletech:turret_extender.name=Turret Extender twice? its not that importent but i was wondering.. -
im so so so sorry to bother this section so much but it seems that i cant find anything online.... in 1.9.4 whatever i try with sending chat to the player seems to just not send the chat and just dump NullPointerException errors i looked all over the internet and a bit in the code but i didnt find anything....
-
how to get the title and sub title that is currently on screen
SHsuperCM replied to SHsuperCM's topic in Modder Support
Show what you tried. Because looking up the field is slower than dial-up. just putting what you said throws a bunch of errors identifier required... i dont need to work on this part currently because its not slowing down anything for me... if it becomes a giant issue than ill go again to it but now im working on other parts of my mod... its working now and that's what matters..... -
so yet again i come to the forums in need of help.. google doest not seem to help me.... again........ im trying to check if, for example ".minecraft/ElytraMC/Maps/Rainbow Spiral/Times/time1.time" exists.. also im trying to check if a folder exists, for example ".minecraft/ElytraMC/Maps/Apocalypse".. what's importent to me is that i can check for strings as paths so i can include other Strings within.... *stopps modding, waits*
-
how to get the title and sub title that is currently on screen
SHsuperCM replied to SHsuperCM's topic in Modder Support
its not letting me do that... but what does looking each time hurt it? its working fine for what im doing... -
how to get the title and sub title that is currently on screen
SHsuperCM replied to SHsuperCM's topic in Modder Support
What. Of course you can. That's how you declare fields. You call get() on these things with Minecraft.getMinecraft().ingameGui as the argument. Seriously, this is simple. diesieben again thank you so much for all the help! i finally figured it out! for people from the future that want to know what i did, this for Title: String title = (String) ReflectionHelper.findField(GuiIngame.class, "displayedTitle", "field_175201_x").get(Minecraft.getMinecraft().ingameGUI); and this for subtitle: String title = (String) ReflectionHelper.findField(GuiIngame.class, "displayedSubTitle", "field_175200_y").get(Minecraft.getMinecraft().ingameGUI); -
how to get the title and sub title that is currently on screen
SHsuperCM replied to SHsuperCM's topic in Modder Support
you know of any working code of this that i can break down to some thing i understand? -
how to get the title and sub title that is currently on screen
SHsuperCM replied to SHsuperCM's topic in Modder Support
it seems that whatever i try with just doesnt work... first from my knowledge of java you cant just do public static final titlefield = it says no identifier... and if i fix it from what it returns to get it into an actuall object it just thows errors whatever i do with it.. im currently laughing on how i cant understand anything in lyfe but i really need this to work so i can keep on moddin' -
how to get the title and sub title that is currently on screen
SHsuperCM replied to SHsuperCM's topic in Modder Support
it dumps this in the console: [22:01:07] [Client thread/FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_92] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_92] at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1107) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:404) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) [idea_rt.jar:?] Caused by: java.lang.NullPointerException at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:57) ~[?:1.8.0_92] at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36) ~[?:1.8.0_92] at java.lang.reflect.Field.get(Field.java:393) ~[?:1.8.0_92] at com.SHsuperCM.ElytraMCMod.MapInfo.MapChatHandler.getChatEvent(MapChatHandler.java:80) ~[MapChatHandler.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_8_MapChatHandler_getChatEvent_ClientChatReceivedEvent.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) ~[EventBus.class:?] at net.minecraftforge.event.ForgeEventFactory.onClientChat(ForgeEventFactory.java:269) ~[ForgeEventFactory.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleChat(NetHandlerPlayClient.java:887) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketChat.processPacket(SPacketChat.java:54) ~[sPacketChat.class:?] at net.minecraft.network.play.server.SPacketChat.processPacket(SPacketChat.java:11) ~[sPacketChat.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_92] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_92] at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?] ... 20 more -
how to get the title and sub title that is currently on screen
SHsuperCM replied to SHsuperCM's topic in Modder Support
so i ended up with this: if(msg.contains("what's the title?")){ Field titleField = ReflectionHelper.findField(GuiIngame.class, "displayedTitle", "field_175201_x"); System.out.println(titleField.get(null)); } and it didnt work... -
how to get the title and sub title that is currently on screen
SHsuperCM replied to SHsuperCM's topic in Modder Support
what do i do in the get method? i tried that with Minecraft.getMinecraft() and i cant think of anything else that should be there? -
how to get the title and sub title that is currently on screen
SHsuperCM replied to SHsuperCM's topic in Modder Support
soooo sorry for bothering the modder support so much but how do i use it? i have no idea what is the field object.. -
how to get the title and sub title that is currently on screen
SHsuperCM replied to SHsuperCM's topic in Modder Support
http://stackoverflow.com/questions/735230/java-reflection-access-protected-field