Trusak Posted January 1, 2017 Author Share Posted January 1, 2017 You somehow managed to create a Configuration object which's file is null. Since your code is all over the place and you only ever post tiny snippets of it (and I am not going back through 4 pages, no thanks) I do not know where you initialize Clean.Coins.CC.config1 . public static Configuration config1= new Configuration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config1= new Configuration(event.getSuggestedConfigurationFile()); config1.load(); FastExamples.NotResetVariables.PMs = config1.get("Booleans", "PMs", false).getBoolean(); FastExamples.NotResetVariables.instantRejoin = config1.get("Booleans", "InstantRejoin", false).getBoolean(); FastExamples.NotResetVariables.showPartyChat = config1.get("Booleans", "PartyChat", false).getBoolean(); FastExamples.NotResetVariables.showGuildChat = config1.get("Booleans", "GuildChat", false).getBoolean(); config1.save(); proxy.registerClientStuff(); } Quote Link to comment Share on other sites More sharing options...
Trusak Posted January 1, 2017 Author Share Posted January 1, 2017 You initialize the config1 field to a new, empty Configuration object and then don't touch it again. What did you expect? And no, you are not touching the field in preInit . Look closely. How to fix that? If I understood that right, I should create the booleans in the config first. Like that: Property PMs = config1.get("Booleans", "PMs", false); ? Quote Link to comment Share on other sites More sharing options...
loordgek Posted January 1, 2017 Share Posted January 1, 2017 public static Configuration config; @EventHandler public void preInit(FMLPreInitializationEvent event) { config = new Configuration(event.getSuggestedConfigurationFile()); } Quote Link to comment Share on other sites More sharing options...
Trusak Posted January 1, 2017 Author Share Posted January 1, 2017 public static Configuration config; @EventHandler public void preInit(FMLPreInitializationEvent event) { config = new Configuration(event.getSuggestedConfigurationFile()); } ? Quote Link to comment Share on other sites More sharing options...
loordgek Posted January 1, 2017 Share Posted January 1, 2017 You initialize the config1 field to a new, empty Configuration object and then don't touch it again. What did you expect? And no, you are not touching the field in preInit . Look closely. and you asked how to fix it Quote Link to comment Share on other sites More sharing options...
Trusak Posted January 1, 2017 Author Share Posted January 1, 2017 You initialize the config1 field to a new, empty Configuration object and then don't touch it again. What did you expect? And no, you are not touching the field in preInit . Look closely. and you asked how to fix it What is different between your and my code? Quote Link to comment Share on other sites More sharing options...
loordgek Posted January 1, 2017 Share Posted January 1, 2017 yours public static Configuration config1= new Configuration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config1= new Configuration(event.getSuggestedConfigurationFile()); } mine public static Configuration config; @EventHandler public void preInit(FMLPreInitializationEvent event) { config = new Configuration(event.getSuggestedConfigurationFile()); } spot the difference Quote Link to comment Share on other sites More sharing options...
Trusak Posted January 1, 2017 Author Share Posted January 1, 2017 yours public static Configuration config1= new Configuration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config1= new Configuration(event.getSuggestedConfigurationFile()); } mine public static Configuration config; @EventHandler public void preInit(FMLPreInitializationEvent event) { config = new Configuration(event.getSuggestedConfigurationFile()); } spot the difference Oh well, didn't expect that to be the problem, thanks! Quote Link to comment Share on other sites More sharing options...
Draco18s Posted January 1, 2017 Share Posted January 1, 2017 Oh well, didn't expect that to be the problem, thanks! Because it's only in Local Scope. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
Trusak Posted January 2, 2017 Author Share Posted January 2, 2017 Please learn Java... Please. That is what I am trying to do! ^^ One more quick question, is it possible to replace a word in a String with a ChatCode? I tried to do prop = prop.replace("&a", EnumChatFormatting.GREEN); and prop = prop.replace("&a", "§a"); , but the first one isn't working and the second one seems to only work with the Client from Eclipse, not the regular one (Why though?). I am so sorry for being annoying! Quote Link to comment Share on other sites More sharing options...
Draco18s Posted January 2, 2017 Share Posted January 2, 2017 That is what I am trying to do! ^^ Modder Support This is the support section for those modding with Forge. Help with modding goes in here, however, please keep in mind that this is not a Java school. You are expected to have basic knowledge of Java before posting here. Emphasis on "You are expected to have basic knowledge of Java before posting here." Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
Trusak Posted January 2, 2017 Author Share Posted January 2, 2017 That is what I am trying to do! ^^ Modder Support This is the support section for those modding with Forge. Help with modding goes in here, however, please keep in mind that this is not a Java school. You are expected to have basic knowledge of Java before posting here. Emphasis on "You are expected to have basic knowledge of Java before posting here." Ye sorry, I will stop asking questions on this forum but can you help me with the last question? Quote Link to comment Share on other sites More sharing options...
Trusak Posted January 3, 2017 Author Share Posted January 3, 2017 Why do you want that? Just put §a in the text... It works with the Eclipse Client but when I use the normal Minecraft 1.8.9 client, it deforms. EDIT: The §a deforms into ï¿1/2a Quote Link to comment Share on other sites More sharing options...
Draco18s Posted January 3, 2017 Share Posted January 3, 2017 Your file isn't saved in UTF-8 format. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
Trusak Posted January 3, 2017 Author Share Posted January 3, 2017 Your file isn't saved in UTF-8 format. Now there is a smiley in front of it . ☺ Quote Link to comment Share on other sites More sharing options...
Trusak Posted January 3, 2017 Author Share Posted January 3, 2017 You must use UTF-8 everywhere. Make sure your IDE saves files in UTF-8 (here's how in eclipse) and make sure the compiler will use UTF-8 (here's how with gradle). Thanks, that fixed it! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.