mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-1889: Fail fast when plugin attempts to use database when not enabled.
By: md_5 <git@md-5.net>
This commit is contained in:
parent
fe152f147f
commit
a7e0658387
1 changed files with 3 additions and 0 deletions
|
@ -39,6 +39,7 @@ import com.avaje.ebean.config.ServerConfig;
|
||||||
import com.avaje.ebeaninternal.api.SpiEbeanServer;
|
import com.avaje.ebeaninternal.api.SpiEbeanServer;
|
||||||
import com.avaje.ebeaninternal.server.ddl.DdlGenerator;
|
import com.avaje.ebeaninternal.server.ddl.DdlGenerator;
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -437,6 +438,8 @@ public abstract class JavaPlugin extends PluginBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EbeanServer getDatabase() {
|
public EbeanServer getDatabase() {
|
||||||
|
Preconditions.checkState(description.isDatabaseEnabled(), "Plugin does not have database: true in plugin.yml");
|
||||||
|
|
||||||
return ebean;
|
return ebean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue