Fixed plugin config error

This commit is contained in:
Norbi Peti 2018-12-24 00:08:32 +01:00
parent dbce36cd4e
commit df5befe1d9
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
2 changed files with 3 additions and 2 deletions

View file

@ -4,6 +4,7 @@
<modules>
<module fileurl="file://$PROJECT_DIR$/BuildConfigUpdater/BuildConfigUpdater.iml" filepath="$PROJECT_DIR$/BuildConfigUpdater/BuildConfigUpdater.iml" />
<module fileurl="file://$PROJECT_DIR$/ButtonCore/ButtonCore (1) (com.github.TBMCPlugins.ButtonCore).iml" filepath="$PROJECT_DIR$/ButtonCore/ButtonCore (1) (com.github.TBMCPlugins.ButtonCore).iml" />
<module fileurl="file://$PROJECT_DIR$/ButtonCore/ButtonCore (1) (com.github.TBMCPlugins.ButtonCore).iml" filepath="$PROJECT_DIR$/ButtonCore/ButtonCore (1) (com.github.TBMCPlugins.ButtonCore).iml" />
<module fileurl="file://$PROJECT_DIR$/ButtonProcessor/ButtonProcessor.iml" filepath="$PROJECT_DIR$/ButtonProcessor/ButtonProcessor.iml" />
</modules>
</component>

View file

@ -9,7 +9,7 @@ import java.util.Map;
import java.util.function.Function;
public abstract class ButtonPlugin extends JavaPlugin {
private HashMap<String, ConfigData<?>> datamap = new HashMap<>();
private final HashMap<String, ConfigData<?>> datamap = new HashMap<>();
private ConfigurationSection section;
protected abstract void pluginEnable();
@ -19,7 +19,7 @@ public abstract class ButtonPlugin extends JavaPlugin {
@Override
public void onEnable() {
section = getConfig().getConfigurationSection("global");
if (section == null) getConfig().createSection("global");
if (section == null) section = getConfig().createSection("global");
try {
pluginEnable();
} catch (Exception e) {