mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Enable plugins by default the right way
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
161d48858d
commit
8d08cd71c9
@ -8,6 +8,7 @@ import net.minecraft.server.EntityPlayerMP;
|
|||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.ServerConfigurationManager;
|
import net.minecraft.server.ServerConfigurationManager;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.SimplePluginManager;
|
import org.bukkit.plugin.SimplePluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
import org.bukkit.plugin.java.JavaPluginLoader;
|
||||||
@ -29,11 +30,16 @@ public final class CraftServer implements Server {
|
|||||||
pluginManager.RegisterInterface(JavaPluginLoader.class);
|
pluginManager.RegisterInterface(JavaPluginLoader.class);
|
||||||
|
|
||||||
File pluginFolder = new File("plugins");
|
File pluginFolder = new File("plugins");
|
||||||
|
|
||||||
if (pluginFolder.exists()) {
|
if (pluginFolder.exists()) {
|
||||||
try {
|
try {
|
||||||
pluginManager.loadPlugins(pluginFolder);
|
Plugin[] plugins = plugins = pluginManager.loadPlugins(pluginFolder);
|
||||||
|
|
||||||
|
for (Plugin plugin : plugins) {
|
||||||
|
plugin.getPluginLoader().enablePlugin(plugin);
|
||||||
|
}
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "(Did you extract the lib folder?)", ex);
|
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "(Is it up to date?)", ex);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pluginFolder.mkdir();
|
pluginFolder.mkdir();
|
||||||
|
Loading…
Reference in New Issue
Block a user