mirror of
https://github.com/darverdevs/EaglerPluginUpdater.git
synced 2024-12-21 23:04:12 -08:00
fix bugz
This commit is contained in:
parent
62c0ef543f
commit
6fff926ba2
Binary file not shown.
|
@ -7,13 +7,8 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||
import java.io.IOException;
|
||||
|
||||
public class Main extends JavaPlugin {
|
||||
private static Plugin instance = null;
|
||||
public static Plugin getInstance() {
|
||||
return instance;
|
||||
}
|
||||
@Override
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
try {
|
||||
Updater.UpdateInstaller();
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.nio.file.Files;
|
|||
import java.nio.file.StandardCopyOption;
|
||||
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
import tech.nully.PluginInstaller.Main;
|
||||
|
||||
public class Updater {
|
||||
public static void UpdateInstaller() throws IOException {
|
||||
|
@ -15,7 +16,7 @@ public class Updater {
|
|||
.toURL().openStream();
|
||||
File f = new File(Main.getInstance().getDataFolder().getParent() + "/EaglerPluginInstaller.jar");
|
||||
Files.copy(in, f.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
getServer().getPluginManager().disablePlugin(tech.nully.PluginInstaller.Main.getInstance());
|
||||
getServer().getPluginManager().enablePlugin(tech.nully.PluginInstaller.Main.getInstance());
|
||||
getServer().getPluginManager().disablePlugin(Main.getInstance());
|
||||
getServer().getPluginManager().enablePlugin(Main.getInstance());
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user