Everything posted by Trusak
-
[1.8]Make booleans stay after quitting Minecraft
He is not checking equality. Ah, you are correct. But yes, still nonsense. I am not sure what I am doing wrong. It works fine in-game.
-
[1.8]Make booleans stay after quitting Minecraft
So how can I make it work? Make your config variable exist outside local scope. Ok so that is what I have right now: protected void actionPerformed(GuiButton button) throws IOException { if(button == GUI.GUI.button2) { Minecraft.getMinecraft().displayGuiScreen(new GUI2()); Property prop = config1.get("Booleans", "PMs", false); boolean PMs = prop.getBoolean(); prop.set(!PMs);; config1.save(); } } What to do now? Also how can I make that public static boolean PMs; public static boolean PMsEnabled(){ return (PMs = !PMs); } get it's state from the config?
-
[1.8]Make booleans stay after quitting Minecraft
So how can I make it work?
-
[1.8]Make booleans stay after quitting Minecraft
I mean that it doesn't even load my config1 anywhere but in the preInit
-
[1.8]Make booleans stay after quitting Minecraft
Congradulations, you did nothing with your boolean. You got the current value from the save file, then wrote it back. Good jorb. I know that I have to change it but the code doesn't work already so I want to get it working before I go on
-
[1.8]Make booleans stay after quitting Minecraft
Which code? What I have: @Override protected void actionPerformed(GuiButton button) throws IOException { if(button == button2) { Minecraft.getMinecraft().displayGuiScreen(new GUI2()); Property prop = config1.get; boolean b = prop.getBoolean(); prop.set(b); config1.save(); } and @EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config1= new Configuration(event.getSuggestedConfigurationFile()); config1.load(); Property PMs = config1.get("Booleans", "PMs", false); config1.save(); proxy.registerClientStuff();
-
[1.8]Make booleans stay after quitting Minecraft
I still don't get how I put that inside of my code. My preInit: @EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config1= new Configuration(event.getSuggestedConfigurationFile()); config1.load(); FastExamples.NotResetVariables.PMs = config1.getBoolean("PMs", "Booleans", false, "Disable to disable by default"); FastExamples.NotResetVariables.instantRejoin = config1.getBoolean("InstantRejoin", "Booleans", false, "Disable to disable by default"); FastExamples.NotResetVariables.showPartyChat = config1.getBoolean("ShowPartyChat", "Booleans", false, "Disable to disable by default"); FastExamples.NotResetVariables.showGuildChat = config1.getBoolean("ShowGuildChat", "Booleans", false, "Disable to disable by default"); config1.save(); proxy.registerClientStuff(); } My button: protected void actionPerformed(GuiButton button) throws IOException { if(button == button2) { Minecraft.getMinecraft().displayGuiScreen(new GUI2()); } }
-
[1.8]Make booleans stay after quitting Minecraft
Maybe I do but just don't understand how to do it with a config . Ye I am a noob ;(
-
[1.8]Make booleans stay after quitting Minecraft
To be honest, I still don't know how to insert that inside of a button and where I can put my config file name into .
-
[1.8] Error when trying to get Player's Ping
Checking if the player !null fixed it, thanks anyway
-
[1.8] Error when trying to get Player's Ping
It doesn't work with my normal account either
-
[1.8] Error when trying to get Player's Ping
How can I fix that?
-
[1.8]Make booleans stay after quitting Minecraft
I am very new to coding and do not know how to use stuff like that yet. I am seriously trying to learn but I won't find what I need when I don't know what I am looking for. My only knowledge at the momemnt comes from tutorials etc. and I am willing to learn more but I won't when I don't know WHY I am doing something. I like it when people give examples because when I look at them, I try to figure out how that works and can do it myself next ime.
-
[1.8]Make booleans stay after quitting Minecraft
No. The config can save values as well, the problem here is that Trusak does not have a basic understanding of object oriented programming. Trusak, if you want the config value to change, you need to set the property and then save the config. It is true, I don't, but I learn when I see examples and can not do a lot when I see something I don't understand and can't find on the Internet
-
[1.8]Make booleans stay after quitting Minecraft
Do you know how to do that?
-
[1.8]Make booleans stay after quitting Minecraft
But I can only do that in the preInit, dont I? I want to do that in an actionPerformed event @Override protected void actionPerformed(GuiButton button) throws IOException { if(button == button2) { Minecraft.getMinecraft().displayGuiScreen(new GUI2()); //Here should be the config change }
-
[1.8]Make booleans stay after quitting Minecraft
To override them in gui constructor you do something like Gui MyGui { Boolean boolean1 Boolean boolean2 public MyGui() { boolean1 = Config.getmyBoolean1 boolean2 = Config.getmyBoolean2 } all other gui code here } of course how to set up boolean or what type of boolean you use changes how you assign it. but essentially that's how you do it. So when you boot up the game again your gui is set to your variables saved from last time. Everytime the Gui is constructred it will first populate all your variables. Ideally you wanna do Config load/write before everything then do construction. ALL in preInit() I do know that already, but how do I change the variable in the config by clicking a button?
-
[1.8]Make booleans stay after quitting Minecraft
I have already made a config with these values but I dont't know how to override them. (When the boolean changes)
-
[1.8] Error when trying to get Player's Ping
Ok I tried it using if (Minecraft.getMinecraft() != null){ System.out.println("Minecraft"); } if (Minecraft.getMinecraft().getNetHandler() != null){ System.out.println("NetHandler"); } if (Minecraft.getMinecraft().getNetHandler().getPlayerInfo(Minecraft.getMinecraft().thePlayer.getUniqueID()) != null){ System.out.println("PlayerInfo"); } and everything but "PlayerInfo" printed out. I guess that is the error but I still don't know how to fix it .
-
[1.8] Error when trying to get Player's Ping
So what can I do now?
-
[1.8] Error when trying to get Player's Ping
The game always crashes at int ping = Minecraft.getMinecraft().getNetHandler().getPlayerInfo(Minecraft.getMinecraft().thePlayer.getUniqueID()).getResponseTime(); if that is what you mean
-
[1.8] Error when trying to get Player's Ping
What do you mean?
-
[1.8] Error when trying to get Player's Ping
Nope, still crashing
- [1.8] Error when trying to get Player's Ping
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.