I am not sure how to do it currectly so I am gonna ask you(watch line 29 and 345) and line 51 is if(i.getConfig().getBoolean("Enchantments") == true){ it might be this i(instance) i am not sure if i can use it with getconfig() Error Class: http://pastebin.com/iP3n53Td
Could you please post your full code? I don't see anything wrong with .getInstance() Perhaps, you can elaborate more what 'i' is. Perhaps you could also elaborate more on what the .openInventory(Player p) function does.
Main: http://pastebin.com/9NfxtQJU MainMenuEvent: http://pastebin.com/3DCU3rzU ArmourGUI: http://pastebin.com/iP3n53Td
Code: at me.bronzzze.wardrobe.ArmourGUI.openInventory(ArmourGUI.java:51) ~[?:?] at me.bronzzze.wardrobe.MainEvent.onClick(MainEvent.java:53) ~[?:?] Code: // ArmourGUI Line 50 & 51: ItemStack item3 = new ItemStack(Material.LEATHER_HELMET, 1); item3.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1); // MainEvent Line 53: i.openInventory(p); There's nothing wrong with that. Are you sure you didn't any edits since the code you posted above?
yes i know its in 51 row and ists null pointer but idk how to fix it @CraftCreeper6 yes i know main in this class is from 1-29. and then else statment if boolean in config is false this is line 345(first time doing with true/false config. @stormneo7 ArmourGUI line 51 is if(i.getConfig().getBoolean("Enchantments") == true){ idk pastebin is dirrent MainEvent is i.openInventory(p) (as you said)
You need to understand that there's nothing wrong with those two lines. It's like saying that 1+1 != 2 So what does that even mean... did you edit your or something?
it was working all fine but when add this if(i.getConfig().getBoolean("Enchantments") == true){ and }else{ in armourgui it's not working You have any ideas how should i toggle enchantments True/false in config cuz this way is not working I cant do like this right? Code: if(i.getConfig().getBoolean("Enchantments") == true){ item1.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1); } EDIT by Timtower: merged posts, use the edit button instead of double posting.
so you mean like this? Sorry i am dumb Code: private ArmourGUI() { } private static ArmourGUI instance = new ArmourGUI(); public static ArmourGUI getInstance() { return null; } Main i = Main.getInstance();