mirror of
https://github.com/taoneill/war.git
synced 2024-11-13 05:54:31 +01:00
Cleared team color in Spout player name display when leaving warzone.
This commit is contained in:
parent
589d197bf1
commit
6eeb5be673
@ -22,7 +22,6 @@ import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||
|
||||
import com.nijiko.permissions.PermissionHandler;
|
||||
import com.nijikokun.bukkit.Permissions.Permissions;
|
||||
@ -61,7 +60,7 @@ public class War extends JavaPlugin {
|
||||
private WarPlayerListener playerListener = new WarPlayerListener();
|
||||
private WarEntityListener entityListener = new WarEntityListener();
|
||||
private WarBlockListener blockListener = new WarBlockListener();
|
||||
private WarServerListener pluginListener = new WarServerListener();
|
||||
private WarServerListener serverListener = new WarServerListener();
|
||||
|
||||
private WarCommandHandler commandHandler = new WarCommandHandler();
|
||||
private Logger logger;
|
||||
@ -160,7 +159,7 @@ public class War extends JavaPlugin {
|
||||
pm.registerEvent(Event.Type.BLOCK_PISTON_EXTEND, this.blockListener, Priority.Normal, this);
|
||||
pm.registerEvent(Event.Type.BLOCK_PISTON_RETRACT, this.blockListener, Priority.Normal, this);
|
||||
|
||||
pm.registerEvent(Event.Type.PLUGIN_DISABLE, this.pluginListener, Priority.Normal, this);
|
||||
pm.registerEvent(Event.Type.PLUGIN_DISABLE, this.serverListener, Priority.Normal, this);
|
||||
|
||||
if (this.isSpoutServer()) {
|
||||
pm.registerEvent(Event.Type.CUSTOM_EVENT, new WarSpoutListener(this), Priority.Low, this);
|
||||
|
@ -3,24 +3,19 @@ package bukkit.tommytony.war;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.server.PluginDisableEvent;
|
||||
import org.bukkit.event.server.ServerListener;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||
|
||||
public class WarServerListener extends ServerListener {
|
||||
|
||||
public void onPluginDisable(PluginDisableEvent event) {
|
||||
if (event.getPlugin() instanceof JavaPlugin) {
|
||||
JavaPlugin plugin = (JavaPlugin)event.getPlugin();
|
||||
|
||||
if (plugin.getDataFolder().getName().equals("Spout")) {
|
||||
if (War.war.isSpoutServer()) {
|
||||
for (Player player : War.war.getServer().getOnlinePlayers()) {
|
||||
SpoutPlayer sp = (SpoutPlayer) player;
|
||||
if (sp.isSpoutCraftEnabled()) {
|
||||
sp.getMainScreen().removeWidgets(War.war);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event.getPlugin().getDataFolder().getName().equals("Spout")) {
|
||||
if (War.war.isSpoutServer()) {
|
||||
for (Player player : War.war.getServer().getOnlinePlayers()) {
|
||||
SpoutPlayer sp = (SpoutPlayer) player;
|
||||
if (sp.isSpoutCraftEnabled()) {
|
||||
sp.getMainScreen().removeWidgets(War.war);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ public class WarSpoutListener extends SpoutListener {
|
||||
private static void drawStats(SpoutPlayer sp, List<GenericLabel> lines) {
|
||||
// remove old stats first
|
||||
removeStats(sp);
|
||||
for (GenericLabel l : lines) sp.getMainScreen().attachWidget(plugin,l.copy());
|
||||
for (GenericLabel l : lines) sp.getMainScreen().attachWidget(plugin, l.copy());
|
||||
}
|
||||
|
||||
public static void removeStats(SpoutPlayer sp) {
|
||||
|
@ -833,6 +833,7 @@ public class Warzone {
|
||||
SpoutPlayer sp = (SpoutPlayer) player;
|
||||
if (sp.isSpoutCraftEnabled()) {
|
||||
WarSpoutListener.removeStats(sp);
|
||||
sp.setTitle(ChatColor.WHITE + player.getName());
|
||||
}
|
||||
sp.resetTitle();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user