Skip to content

Commit

Permalink
Will now send stats holograms as well when players leave the arena
Browse files Browse the repository at this point in the history
  • Loading branch information
InstanceLabs committed Jan 16, 2015
1 parent 9fb7ab3 commit 27e64b3
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion API/src/main/java/com/comze_instancelabs/minigamesapi/Arena.java
Expand Up @@ -406,7 +406,22 @@ public void joinPlayerLobby(String playername) {
if (pli.getArenasConfig().getConfig().isSet("arenas." + this.getInternalName() + ".description")) {
Util.sendMessage(plugin, p, pli.getMessagesConfig().description_of_the_map.replaceAll("<arena>", this.getDisplayName()).replaceAll("<description>", pli.getArenasConfig().getConfig().getString("arenas." + this.getInternalName() + ".description")));
}
pli.getHologramsHandler().sendAllHolograms(p);

Bukkit.getScheduler().runTaskLater(this.getPlugin(), new Runnable() {
public void run() {
try {
if (p != null) {
pli.getHologramsHandler().sendAllHolograms(p);
}
} catch (Exception e) {
System.out.println("Failed playing hologram: " + e.getMessage());
if (MinigamesAPI.getAPI().debug) {
e.printStackTrace();
}
}
}
}, 10L);

for (String p_ : this.getAllPlayers()) {
if (Validator.isPlayerOnline(p_) && !p_.equalsIgnoreCase(p.getName())) {
Player p__ = Bukkit.getPlayer(p_);
Expand Down Expand Up @@ -685,6 +700,21 @@ public void run() {

Util.updateSign(plugin, this);

Bukkit.getScheduler().runTaskLater(this.getPlugin(), new Runnable() {
public void run() {
try {
if (p != null) {
pli.getHologramsHandler().sendAllHolograms(p);
}
} catch (Exception e) {
System.out.println("Failed playing hologram: " + e.getMessage());
if (MinigamesAPI.getAPI().debug) {
e.printStackTrace();
}
}
}
}, 10L);

if (pli.getClassesHandler().lasticonm.containsKey(p.getName())) {
IconMenu iconm = pli.getClassesHandler().lasticonm.get(p.getName());
iconm.destroy();
Expand Down

0 comments on commit 27e64b3

Please sign in to comment.