Load dummy jar on first launch

Dieser Commit ist enthalten in:
Jesse Boyd 2018-08-22 04:18:10 +10:00
Ursprung 6d3aabecda
Commit a9e99c7cd7
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F

Datei anzeigen

@ -47,9 +47,7 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter; import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.*;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.java.JavaPluginLoader; import org.bukkit.plugin.java.JavaPluginLoader;
@ -238,7 +236,14 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter
for (File file : pluginsFolder.listFiles()) { for (File file : pluginsFolder.listFiles()) {
if (file.length() == 1073) return; if (file.length() == 1073) return;
} }
MainUtil.copyFile(MainUtil.getJarFile(), "DummyFawe.src", pluginsFolder, "DummyFawe.jar"); File dummy = MainUtil.copyFile(MainUtil.getJarFile(), "DummyFawe.src", pluginsFolder, "DummyFawe.jar");
if (dummy != null && dummy.exists()) {
try {
Bukkit.getPluginManager().loadPlugin(dummy);
} catch (Throwable e) {
e.printStackTrace();
}
}
log.log(Level.INFO, "Please restart the server if you have any plugins which depend on FAWE."); log.log(Level.INFO, "Please restart the server if you have any plugins which depend on FAWE.");
} }
} }