diff options
author | md_5 <git@md-5.net> | 2016-03-12 10:50:42 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-12 10:50:42 +1100 |
commit | 84276e224728ba8385f2f956f0bb9280c9ee3fae (patch) | |
tree | f1f46f971f2fc9f003ea0476eda423cfa015c30e /src/main | |
parent | 032d1ff804d2a123e1a10d1917ba4c955a910e1e (diff) | |
download | bukkit-84276e224728ba8385f2f956f0bb9280c9ee3fae.tar bukkit-84276e224728ba8385f2f956f0bb9280c9ee3fae.tar.gz bukkit-84276e224728ba8385f2f956f0bb9280c9ee3fae.tar.lz bukkit-84276e224728ba8385f2f956f0bb9280c9ee3fae.tar.xz bukkit-84276e224728ba8385f2f956f0bb9280c9ee3fae.zip |
SPIGOT-1889: Fail fast when plugin attempts to use database when not enabled.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/plugin/java/JavaPlugin.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java index 98975d7a..adbcd83c 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java @@ -39,6 +39,7 @@ import com.avaje.ebean.config.ServerConfig; import com.avaje.ebeaninternal.api.SpiEbeanServer; import com.avaje.ebeaninternal.server.ddl.DdlGenerator; import com.google.common.base.Charsets; +import com.google.common.base.Preconditions; import com.google.common.io.ByteStreams; /** @@ -437,6 +438,8 @@ public abstract class JavaPlugin extends PluginBase { @Override public EbeanServer getDatabase() { + Preconditions.checkState(description.isDatabaseEnabled(), "Plugin does not have database: true in plugin.yml"); + return ebean; } |