mirror of
https://github.com/NEZNAMY/TAB.git
synced 2026-11-26 10:29:49 -05:00
no longer running /papi reload when no expansions were downloaded
This commit is contained in:
1 parent
8f88dcd307
commit
cc26cc667d
4 files changed
+15
-10
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
name: TAB
|
||||
main: me.neznamy.tab.platforms.bungee.Main
|
||||
version: 2.7.0-pre13
|
||||
version: 2.7.0-pre14
|
||||
author: NEZNAMY
|
||||
@@ -1,5 +1,6 @@
|
||||
package me.neznamy.tab.platforms.bukkit;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
@@ -157,6 +158,8 @@ public class Main extends JavaPlugin implements Listener, MainClass{
|
||||
usedExpansions.removeAll(PlaceholderAPI.getRegisteredIdentifiers());
|
||||
usedExpansions.remove("some"); //default config
|
||||
if (!usedExpansions.isEmpty()) {
|
||||
File expansionsFolder = new File("plugins" + File.separatorChar + "PlaceholderAPI" + File.separatorChar + "expansions");
|
||||
int oldExpansionDownloadedCount = expansionsFolder.listFiles().length;
|
||||
for (String expansion : usedExpansions) {
|
||||
sendConsoleMessage("&d[TAB] Expansion &e" + expansion + "&d is used but not installed. Installing!");
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, new Runnable() {
|
||||
@@ -168,14 +171,16 @@ public class Main extends JavaPlugin implements Listener, MainClass{
|
||||
});
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
sendConsoleMessage("&d[TAB] Reloading PlaceholderAPI for the changes to take effect");
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, new Runnable() {
|
||||
if (expansionsFolder.listFiles().length > oldExpansionDownloadedCount) {
|
||||
sendConsoleMessage("&d[TAB] Reloading PlaceholderAPI for the changes to take effect");
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "papi reload");
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "papi reload");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
} catch (Throwable e) {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
name: TAB
|
||||
version: 2.7.0-pre13
|
||||
version: 2.7.0-pre14
|
||||
author: NEZNAMY
|
||||
main: me.neznamy.tab.platforms.bukkit.Main
|
||||
api-version: 1.13
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"id":"tab",
|
||||
"version":"2.7.0-pre13",
|
||||
"version":"2.7.0-pre14",
|
||||
"description":"Change a player's tablist prefix/suffix, name tag prefix/suffix, header/footer, bossbar and more",
|
||||
"authors":[
|
||||
"NEZNAMY"
|
||||
|
||||
Reference in new issue
Block a user