mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-02 14:38:57 +00:00
- New ChatConfig option: chat_colour.nomad
- Default: &f
- You can now set the {townycolour} for players without a town.
This commit is contained in:
1 parent
67ce04996a
commit
b82f349d54
4 files changed
+26
-5
No files matched your search
@@ -241,4 +241,7 @@ v0.57:
|
||||
- TownyChat now utilizes the Maven build system.
|
||||
- EssentialsX Replaces Essentials for API, Dynmap-API is updated for Dynmap v3.
|
||||
- Removed CraftIRC and HeroicDeath as dependencies.
|
||||
- Remove ignorecancelled=true from AsyncPlayerChatEvent in order to make TC respect other plugins' cancelling of chat in some places.
|
||||
- Remove ignorecancelled=true from AsyncPlayerChatEvent in order to make TC respect other plugins' cancelling of chat in some places.
|
||||
- New ChatConfig option: chat_colour.nomad
|
||||
- Default: &f
|
||||
- You can now set the {townycolour} for players without a town.
|
||||
@@ -131,7 +131,10 @@ public class TownyChatFormatter {
|
||||
replacer.registerFormatReplacement(Pattern.quote("{townycolor}"), new TownyChatReplacerCallable() {
|
||||
@Override
|
||||
public String call(String match, LocalTownyChatEvent event) throws Exception {
|
||||
return event.getResident().isMayor() ? (event.getResident().isKing() ? ChatSettings.getKingColour() : ChatSettings.getMayorColour()) : ChatSettings.getResidentColour();
|
||||
if (!event.getResident().hasTown())
|
||||
return ChatSettings.getNomadColour();
|
||||
else
|
||||
return event.getResident().isMayor() ? (event.getResident().isKing() ? ChatSettings.getKingColour() : ChatSettings.getMayorColour()) : ChatSettings.getResidentColour();
|
||||
}
|
||||
});
|
||||
replacer.registerFormatReplacement(Pattern.quote("{group}"), new TownyChatReplacerCallable() {
|
||||
|
||||
@@ -128,6 +128,9 @@ public enum ChatConfigNodes {
|
||||
COLOUR_RESIDENT(
|
||||
"colour.resident",
|
||||
"&f"),
|
||||
COLOUR_NOMAD(
|
||||
"colour.nomad",
|
||||
"&f"),
|
||||
MODIFY_CHAT(
|
||||
"modify_chat",
|
||||
"",
|
||||
|
||||
@@ -356,7 +356,7 @@ class tag_formats extends chat_colours{
|
||||
|
||||
class chat_colours {
|
||||
|
||||
private static String KING, MAYOR, RESIDENT;
|
||||
private static String KING, MAYOR, RESIDENT, NOMAD;
|
||||
|
||||
/**
|
||||
* @return KING the KING colour
|
||||
@@ -399,6 +399,18 @@ class chat_colours {
|
||||
public static void setResidentColour(String colour) {
|
||||
chat_colours.RESIDENT = colour;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NOMAD the NOMAD colour
|
||||
*/
|
||||
public static String getNomadColour() {
|
||||
return NOMAD;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param colour the NOMAD colour tag to set
|
||||
*/
|
||||
public static void setNomadColour(String colour) {
|
||||
chat_colours.NOMAD = colour;
|
||||
}}
|
||||
|
||||
Reference in new issue
Block a user