Check before copy

This commit is contained in:
Jesse Boyd 2019-04-24 02:29:25 +10:00
parent c6ce0c773f
commit 219321b777
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -321,9 +321,9 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
for (File file : pluginsFolder.listFiles()) {
if (file.length() == 1988) return;
}
Plugin plugin = Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit");
File dummy = MainUtil.copyFile(MainUtil.getJarFile(), "DummyFawe.src", pluginsFolder, "DummyFawe.jar");
File newFile = new File(pluginsFolder, "DummyFawe.jar");
if (dummy != null && dummy.exists() && !newFile.exists()) {
if (dummy != null && dummy.exists() && plugin == this) {
try {
Bukkit.getPluginManager().loadPlugin(dummy);
} catch (Throwable e) {