0

Made module auto-gen empty files if they don't exist yet

This commit is contained in:
Pepich 2017-02-01 17:41:38 +01:00
parent 97b11b06e1
commit 1917a08d14

View File

@ -24,7 +24,7 @@ import com.redstoner.modules.Module;
* *
* @author Pepich */ * @author Pepich */
@AutoRegisterListener @AutoRegisterListener
@Version(major = 1, minor = 1, revision = 0, compatible = 1) @Version(major = 1, minor = 1, revision = 1, compatible = 1)
public class Chatgroups implements Module, Listener public class Chatgroups implements Module, Listener
{ {
private static final char defaultKey = ':'; private static final char defaultKey = ':';
@ -39,12 +39,15 @@ public class Chatgroups implements Module, Listener
{ {
groups = JsonManager.getObject(groupsLocation); groups = JsonManager.getObject(groupsLocation);
if (groups == null) if (groups == null)
return; {
groups = new JSONObject();
saveGroups();
}
keys = JsonManager.getObject(keysLocation); keys = JsonManager.getObject(keysLocation);
if (keys == null) if (keys == null)
{ {
groups = null; keys = new JSONObject();
return; saveKeys();
} }
cgtoggled = new ArrayList<CommandSender>(); cgtoggled = new ArrayList<CommandSender>();
enabled = true; enabled = true;