Plugin category: [CHAT] Suggested name: ProperCaps. What I want: I'd like this to be an Anti-Caps plugin that puts all the other to shame. We've all seen the plugins that make all messages 100% lowercase, and the ones that use a percentage. This one would be better than that; It would automatically caps any letter that comes after any punctuation (excluding apostrophes, commas, etc) and lowercase everything else. Similiar to RuneScape (if you played that). Ideas for commands: No commands needed for this plugin. Ideas for permissions: ProperCaps.bypass When I'd like it by: As soon as possible, please.
For any dev who might be interested in making this plugin here's my method to fix capitalization: Code: /** * Capitalizes the first character of the string and all characters that follow periods. * * @param string * @return */ public static String fixCapitalization(final String string) { final char[] s = string.toCharArray(); int c = 0; while (c != -1) { while (c < s.length && (s[c] == '.' || s[c] == '!' || s[c] == '?' || Character.isWhitespace(s[c]))) c++; if (c == s.length) return new String(s); if (c == 0 || s[c - 1] != '.') // don't capitalize directly after a dot - fixes URLs s[c] = Character.toUpperCase(s[c]); c = indexOf(s, '.', c + 1); } return new String(s); } It does not lowercase any letters, but this can be done easily by adding a .toLowerCase() in the right spot
I used this, but the line: c = indexOf(s, '.', c + 1); Needed to be: c = string.indexOf('.', c + 1); Here's the outcome: http://www.sendspace.com/file/ryamat http://www.sendspace.com/file/y23zlr First one didn't decapitalize, this one does. My bad. A short clip: http://i.imgur.com/ErGgs.gif
Oh wow, a lot of answers. I'm sure one of them will suit my needs; likes to you all! Will this change caps? Same for this, will it un-capitalize? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
What about names, places, brands etc? They need proper capitalization but it would be impossible for a plugin to detect such things.
ForcedGrammar will do this, it starts every sentence with capital, and ends the sentence to dot (i dont know the fancy name of dot ) If i remember right, you can even change some of the words. Example: player tries to say "Your mum sucks” it will change the "Your” to "My" So instead of "Your mum sucks” it will say "My mum sucks”
Works great, you should put it on BukkitDev. Sure it would be a hit. (and probably get more than a few donations).