mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-02 22:23:18 +00:00
Fixed {townformatted} and {nationformatted} to display correctly.
This commit is contained in:
1 parent
f368d6d25b
commit
69022478d2
5 files changed
+23
-10
No files matched your search
+4
-1
@@ -37,4 +37,7 @@ v0.7:
|
||||
- source: 'admin' # These are endpoint tags
|
||||
target: 'minecraft' #
|
||||
formatting:
|
||||
chat: '%foreground%[%red%%ircPrefix%%sender%%foreground%] %message%'
|
||||
chat: '%foreground%[%red%%ircPrefix%%sender%%foreground%] %message%'
|
||||
v0.8:
|
||||
- Fixed {townformatted} and {nationformatted} to display correctly.
|
||||
|
||||
@@ -73,11 +73,15 @@ public class Chat extends JavaPlugin {
|
||||
|
||||
test = pm.getPlugin("CraftIRC");
|
||||
if (test != null) {
|
||||
if (Double.valueOf(test.getDescription().getVersion()) >= 3.1) {
|
||||
craftIRC = (CraftIRC) test;
|
||||
irc = new CraftIRCHandler(towny, craftIRC, "towny");
|
||||
} else
|
||||
logger.warning("TownyChat requires CraftIRC version 3.1 or higher to relay chat.");
|
||||
try {
|
||||
if (Double.valueOf(test.getDescription().getVersion()) >= 3.1) {
|
||||
craftIRC = (CraftIRC) test;
|
||||
irc = new CraftIRCHandler(towny, craftIRC, "towny");
|
||||
} else
|
||||
logger.warning("TownyChat requires CraftIRC version 3.1 or higher to relay chat.");
|
||||
} catch (NumberFormatException e) {
|
||||
logger.warning("Non number format found for craftIRC version string!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class TownyChatFormatter {
|
||||
replacer.registerFormatReplacement(Pattern.quote("{townformatted}"), new TownyChatReplacerCallable() {
|
||||
@Override
|
||||
public String call(String match, TownyChatEvent event) throws Exception {
|
||||
return formatTownyTag(event.getResident(), false, true);
|
||||
return formatTownTag(event.getResident(), false, true);
|
||||
}
|
||||
});
|
||||
replacer.registerFormatReplacement(Pattern.quote("{towntag}"), new TownyChatReplacerCallable() {
|
||||
@@ -246,7 +246,9 @@ public class TownyChatFormatter {
|
||||
public static String formatTownTag(Resident resident, Boolean override, Boolean full) {
|
||||
try {
|
||||
if (resident.hasTown())
|
||||
if (resident.getTown().hasTag())
|
||||
if (full)
|
||||
return String.format(TownySettings.getChatTownTagFormat(), resident.getTown().getName());
|
||||
else if (resident.getTown().hasTag())
|
||||
return String.format(TownySettings.getChatTownTagFormat(), resident.getTown().getTag());
|
||||
else if (override)
|
||||
return String.format(TownySettings.getChatTownTagFormat(), resident.getTown().getName());
|
||||
@@ -259,7 +261,9 @@ public class TownyChatFormatter {
|
||||
public static String formatNationTag(Resident resident, Boolean override, Boolean full) {
|
||||
try {
|
||||
if (resident.hasNation())
|
||||
if (resident.getTown().getNation().hasTag())
|
||||
if (full)
|
||||
return String.format(TownySettings.getChatNationTagFormat(), resident.getTown().getNation().getName());
|
||||
else if (resident.getTown().getNation().hasTag())
|
||||
return String.format(TownySettings.getChatNationTagFormat(), resident.getTown().getNation().getTag());
|
||||
else if (override)
|
||||
return String.format(TownySettings.getChatNationTagFormat(), resident.getTown().getNation().getName());
|
||||
|
||||
@@ -58,6 +58,7 @@ public class TownyPlayerHighestListener extends PlayerListener {
|
||||
try {
|
||||
if (plugin.getEssentials().getUser(player).isMuted()) {
|
||||
TownyMessaging.sendErrorMsg(player, "Unable to talk...You are currently muted!");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
} catch (TownyException e) {
|
||||
@@ -125,6 +126,7 @@ public class TownyPlayerHighestListener extends PlayerListener {
|
||||
try {
|
||||
if (plugin.getEssentials().getUser(player).isMuted()) {
|
||||
TownyMessaging.sendErrorMsg(player, "Unable to talk...You are currently muted!");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
} catch (TownyException e) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
name: TownyChat
|
||||
main: com.palmergames.bukkit.TownyChat.Chat
|
||||
version: 0.7
|
||||
version: 0.8
|
||||
author: ElgarL
|
||||
website: http://code.google.com/a/eclipselabs.org/p/towny/
|
||||
description: >
|
||||
|
||||
Reference in new issue
Block a user