Skip to content

Commit

Permalink
v0.0.7
Browse files Browse the repository at this point in the history
 - Fix NPE for first plugin start
  • Loading branch information
fromgate committed Mar 12, 2016
1 parent 2c357eb commit 17962ae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/java/ru/nukkit/dblib/DbLibPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class DbLibPlugin extends PluginBase {
ConnectionSource connectionSource = null;

private static DbLibPlugin plugin;
static DbLibPlugin getPlugin() {
public static DbLibPlugin getPlugin() {
return plugin;
}

Expand Down
22 changes: 12 additions & 10 deletions src/main/java/ru/nukkit/dblib/util/DbLibCfg.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,36 @@

import cn.nukkit.plugin.Plugin;
import cn.nukkit.utils.SimpleConfig;
import ru.nukkit.dblib.DbLibPlugin;

import java.io.File;

public class DbLibCfg extends SimpleConfig {
public DbLibCfg(Plugin plugin) {
super(plugin);
public DbLibCfg(Plugin plugin) { super(plugin);
}

@Path(value = "DbLib.use-MySQL")
public boolean dbUseMySQL;
public boolean dbUseMySQL=false;

@Path(value = "SQLite.file-name")
public String dbFileName;
public String dbFileName = DbLibPlugin.getPlugin().getDataFolder().getParentFile().getParent() + File.separator + "nukkit.db";

@Path(value = "MySQL.host")
public String dbMySqlUrl;
public String dbMySqlUrl = "localhost";

@SimpleConfig.Path(value ="MySQL.port")
public int dbMySqlPort;
public int dbMySqlPort=3306;

@SimpleConfig.Path(value ="MySQL.database")
public String dbMySqlDatabase;
public String dbMySqlDatabase="db";

@SimpleConfig.Path(value ="MySQL.username")
public String dbMySqlUsername;
public String dbMySqlUsername="nukkit";

@SimpleConfig.Path(value = "MySQL.password")
public String dbMySqlPassword;
public String dbMySqlPassword="tikkun";

@SimpleConfig.Path(value ="DbLib.ORMLite-debug")
public boolean debugLog;
public boolean debugLog=false;

}
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: DbLib
main: ru.nukkit.dblib.DbLibPlugin
version: "0.0.6"
version: "0.0.7"
author: fromgate, nukkit.ru
api: ["1.0.0"]
description: SQLite/MySQL library for Nukkit plugins

0 comments on commit 17962ae

Please sign in to comment.