Fix message formatting and CS problems. Closes #700

This commit is contained in:
cmastudios 2013-11-03 18:58:14 -06:00
parent c6d2c6cbcc
commit c7e33dd1ca
3 changed files with 9 additions and 5 deletions

View File

@ -939,7 +939,7 @@ public class Warzone {
War.war.msg(player, "join.inventorystored");
}
this.respawnPlayer(team, player);
this.broadcast("join.broadcast", player.getName(), player.getName());
this.broadcast("join.broadcast", player.getName(), team.getKind().getFormattedName());
return true;
}

View File

@ -185,4 +185,8 @@ public enum TeamKind {
public boolean isTeamBlock(MaterialData data) {
return data instanceof Wool && ((Wool)data).getColor() == this.dyeColor;
}
public String getFormattedName() {
return this.getColor() + this.name().toLowerCase() + ChatColor.WHITE;
}
}

View File

@ -371,7 +371,7 @@ public class WarEntityListener implements Listener {
*
* @see EntityListener.onEntityDamage()
*/
@EventHandler(priority = EventPriority.HIGHEST)
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityDamage(final EntityDamageEvent event) {
if (!War.war.isLoaded()) {
return;
@ -524,7 +524,7 @@ public class WarEntityListener implements Listener {
}
}
@EventHandler(priority = EventPriority.HIGHEST)
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityDeath(final EntityDeathEvent event) {
if (!War.war.isLoaded() || !(event.getEntity() instanceof Player)) {
return;
@ -537,9 +537,9 @@ public class WarEntityListener implements Listener {
if (!zone.getWarzoneConfig().getBoolean(WarzoneConfig.REALDEATHS)) {
// catch the odd death that gets away from us when usually intercepting and preventing deaths
zone.handleDeath(player);
Team team = Team.getTeamByPlayerName(player.getName());
if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.DEATHMESSAGES)) {
zone.broadcast("pvp.death.other", player.getName());
zone.broadcast("pvp.death.other", team.getKind().getColor() + player.getName());
}
}
}