I am attempting to color all words sent from my chat packet blue by default but if any word is uppercase (just the first letter of word) in the sentence (other than the first word) I would like to color it lime green. I am a beginner with java but this is what I have come up with so far. The problem is that it is still setting the color of any word blue no matter if it is uppercase or not.
public void sendChatPacket(String s, int id) {
boolean isUpperCase = Character.isUpperCase(s.length());
s = isUpperCase ? "<col=65280>\" + s + \"</col>" : "<col=255>\" + s + \"</col>";
}
public void showInformation(Player player) {
sendChatPacket("I can start this quest by speaking to Hetty", 8147);
sendChatPacket("who is in Rimmington.", 8148);
}
Any help is appreciated, thank you!