Jump to content

Trusak

Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by Trusak

  1. 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.
  2. 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?
  3. So how can I make it work?
  4. I mean that it doesn't even load my config1 anywhere but in the preInit
  5. 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
  6. 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();
  7. 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()); } }
  8. Maybe I do but just don't understand how to do it with a config . Ye I am a noob ;(
  9. 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 .
  10. Checking if the player !null fixed it, thanks anyway
  11. It doesn't work with my normal account either
  12. How can I fix that?
  13. 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.
  14. 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
  15. Do you know how to do that?
  16. 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 }
  17. 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?
  18. I have already made a config with these values but I dont't know how to override them. (When the boolean changes)
  19. 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 .
  20. So what can I do now?
  21. The game always crashes at int ping = Minecraft.getMinecraft().getNetHandler().getPlayerInfo(Minecraft.getMinecraft().thePlayer.getUniqueID()).getResponseTime(); if that is what you mean
  22. What do you mean?
  23. Nope, still crashing
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.