mirror of
https://github.com/darverdevs/EaglerPluginUpdater.git
synced 2024-11-21 19:06:05 -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;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class Main extends JavaPlugin {
|
public class Main extends JavaPlugin {
|
||||||
private static Plugin instance = null;
|
|
||||||
public static Plugin getInstance() {
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
instance = this;
|
|
||||||
try {
|
try {
|
||||||
Updater.UpdateInstaller();
|
Updater.UpdateInstaller();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.nio.file.Files;
|
||||||
import java.nio.file.StandardCopyOption;
|
import java.nio.file.StandardCopyOption;
|
||||||
|
|
||||||
import static org.bukkit.Bukkit.getServer;
|
import static org.bukkit.Bukkit.getServer;
|
||||||
|
import tech.nully.PluginInstaller.Main;
|
||||||
|
|
||||||
public class Updater {
|
public class Updater {
|
||||||
public static void UpdateInstaller() throws IOException {
|
public static void UpdateInstaller() throws IOException {
|
||||||
|
@ -15,7 +16,7 @@ public class Updater {
|
||||||
.toURL().openStream();
|
.toURL().openStream();
|
||||||
File f = new File(Main.getInstance().getDataFolder().getParent() + "/EaglerPluginInstaller.jar");
|
File f = new File(Main.getInstance().getDataFolder().getParent() + "/EaglerPluginInstaller.jar");
|
||||||
Files.copy(in, f.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
Files.copy(in, f.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||||
getServer().getPluginManager().disablePlugin(tech.nully.PluginInstaller.Main.getInstance());
|
getServer().getPluginManager().disablePlugin(Main.getInstance());
|
||||||
getServer().getPluginManager().enablePlugin(tech.nully.PluginInstaller.Main.getInstance());
|
getServer().getPluginManager().enablePlugin(Main.getInstance());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user