Changed to setCustomName

This commit is contained in:
alisolarflare 2016-10-17 15:23:15 -04:00
parent f08413f642
commit 39ef99d4ee

View file

@ -95,7 +95,7 @@ public class PortalListener implements Listener{
} }
public void recolourPlayer(Player player, DyeColor dyecolour){ public void recolourPlayer(Player player, DyeColor dyecolour){
player.sendMessage("Recolouring Player as..." + dyecolour.toString()); player.sendMessage("Recolouring Player as..." + dyecolour.toString());
String name = player.getDisplayName(); String name = player.getCustomName();
player.sendMessage("name:" + name); player.sendMessage("name:" + name);
for(int i = 0; i < name.length(); i++){ for(int i = 0; i < name.length(); i++){
if (name.charAt(i) == '&'){ if (name.charAt(i) == '&'){
@ -108,37 +108,37 @@ public class PortalListener implements Listener{
if(dyecolour == DyeColor.GRAY){ if(dyecolour == DyeColor.GRAY){
player.sendMessage("Adding GRAY"); player.sendMessage("Adding GRAY");
player.setDisplayName("&7" + name); player.setCustomName("&7" + name);
}else if(dyecolour == DyeColor.RED){ }else if(dyecolour == DyeColor.RED){
player.sendMessage("Adding RED"); player.sendMessage("Adding RED");
player.setDisplayName("&4" + name); player.setCustomName("&4" + name);
}else if(dyecolour == DyeColor.ORANGE){ }else if(dyecolour == DyeColor.ORANGE){
player.sendMessage("Adding ORANGE"); player.sendMessage("Adding ORANGE");
player.setDisplayName("&6" + name); player.setCustomName("&6" + name);
}else if(dyecolour == DyeColor.YELLOW){ }else if(dyecolour == DyeColor.YELLOW){
player.sendMessage("Adding YELLOW"); player.sendMessage("Adding YELLOW");
player.setDisplayName("&e" + name); player.setCustomName("&e" + name);
}else if(dyecolour == DyeColor.GREEN){ }else if(dyecolour == DyeColor.GREEN){
player.sendMessage("Adding GREEN"); player.sendMessage("Adding GREEN");
player.setDisplayName("&a" + name); player.setCustomName("&a" + name);
}else if(dyecolour == DyeColor.BLUE){ }else if(dyecolour == DyeColor.BLUE){
player.sendMessage("Adding BLUE"); player.sendMessage("Adding BLUE");
player.setDisplayName("&9" + name); player.setCustomName("&9" + name);
}else if(dyecolour == DyeColor.PURPLE){ }else if(dyecolour == DyeColor.PURPLE){
player.sendMessage("Adding PURPLE"); player.sendMessage("Adding PURPLE");
player.setDisplayName("&5" + name); player.setCustomName("&5" + name);
}else{ }else{
player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK");
return; return;
} }
player.sendMessage("Your name is now: " + player.getDisplayName() +"! Removing you from playersToBeFlaired..."); player.sendMessage("Your name is now: " + player.getCustomName() +"! Removing you from playersToBeFlaired...");
playersToBeFlaired.remove(player.getName()); playersToBeFlaired.remove(player.getName());
} }
} }