mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 14:38:58 +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
+24
-3
No files matched your search
@@ -242,3 +242,6 @@ v0.57:
|
|||||||
- EssentialsX Replaces Essentials for API, Dynmap-API is updated for Dynmap v3.
|
- EssentialsX Replaces Essentials for API, Dynmap-API is updated for Dynmap v3.
|
||||||
- Removed CraftIRC and HeroicDeath as dependencies.
|
- 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() {
|
replacer.registerFormatReplacement(Pattern.quote("{townycolor}"), new TownyChatReplacerCallable() {
|
||||||
@Override
|
@Override
|
||||||
public String call(String match, LocalTownyChatEvent event) throws Exception {
|
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() {
|
replacer.registerFormatReplacement(Pattern.quote("{group}"), new TownyChatReplacerCallable() {
|
||||||
|
|||||||
@@ -128,6 +128,9 @@ public enum ChatConfigNodes {
|
|||||||
COLOUR_RESIDENT(
|
COLOUR_RESIDENT(
|
||||||
"colour.resident",
|
"colour.resident",
|
||||||
"&f"),
|
"&f"),
|
||||||
|
COLOUR_NOMAD(
|
||||||
|
"colour.nomad",
|
||||||
|
"&f"),
|
||||||
MODIFY_CHAT(
|
MODIFY_CHAT(
|
||||||
"modify_chat",
|
"modify_chat",
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ class tag_formats extends chat_colours{
|
|||||||
|
|
||||||
class chat_colours {
|
class chat_colours {
|
||||||
|
|
||||||
private static String KING, MAYOR, RESIDENT;
|
private static String KING, MAYOR, RESIDENT, NOMAD;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return KING the KING colour
|
* @return KING the KING colour
|
||||||
@@ -400,5 +400,17 @@ class chat_colours {
|
|||||||
chat_colours.RESIDENT = 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