Give a name to the startup task (for timings).

This commit is contained in:
filoghost 2014-12-30 10:40:14 +01:00
parent e9d81bd513
commit 896609d046
2 changed files with 18 additions and 10 deletions

View File

@ -4,7 +4,6 @@ import java.util.Set;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.filoghost.holographicdisplays.SimpleUpdater.ResponseHandler; import com.gmail.filoghost.holographicdisplays.SimpleUpdater.ResponseHandler;
import com.gmail.filoghost.holographicdisplays.bridge.bungeecord.BungeeServerTracker; import com.gmail.filoghost.holographicdisplays.bridge.bungeecord.BungeeServerTracker;
@ -24,6 +23,7 @@ import com.gmail.filoghost.holographicdisplays.object.NamedHologramManager;
import com.gmail.filoghost.holographicdisplays.placeholder.AnimationsRegister; import com.gmail.filoghost.holographicdisplays.placeholder.AnimationsRegister;
import com.gmail.filoghost.holographicdisplays.placeholder.PlaceholdersManager; import com.gmail.filoghost.holographicdisplays.placeholder.PlaceholdersManager;
import com.gmail.filoghost.holographicdisplays.task.BungeeCleanupTask; import com.gmail.filoghost.holographicdisplays.task.BungeeCleanupTask;
import com.gmail.filoghost.holographicdisplays.task.StartupLoadHologramsTask;
import com.gmail.filoghost.holographicdisplays.task.WorldPlayerCounterTask; import com.gmail.filoghost.holographicdisplays.task.WorldPlayerCounterTask;
import com.gmail.filoghost.holographicdisplays.util.VersionUtils; import com.gmail.filoghost.holographicdisplays.util.VersionUtils;
@ -203,14 +203,7 @@ public class HolographicDisplays extends JavaPlugin {
} catch (Exception ignore) { } } catch (Exception ignore) { }
// The entities are loaded when the server is ready. // The entities are loaded when the server is ready.
new BukkitRunnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(this, new StartupLoadHologramsTask(), 10L);
@Override
public void run() {
for (NamedHologram hologram : NamedHologramManager.getHolograms()) {
hologram.refreshAll();
}
}
}.runTaskLater(this, 10L);
} }

View File

@ -0,0 +1,15 @@
package com.gmail.filoghost.holographicdisplays.task;
import com.gmail.filoghost.holographicdisplays.object.NamedHologram;
import com.gmail.filoghost.holographicdisplays.object.NamedHologramManager;
public class StartupLoadHologramsTask implements Runnable {
@Override
public void run() {
for (NamedHologram hologram : NamedHologramManager.getHolograms()) {
hologram.refreshAll();
}
}
}