This commit is contained in:
LlmDl committed 2023-07-20 12:40:18 -05:00
commit c4c442d43c
6 files changed
+14 -18

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@
<java.version>17</java.version> <java.version>17</java.version>
<project.bukkitAPIVersion>1.16</project.bukkitAPIVersion> <project.bukkitAPIVersion>1.16</project.bukkitAPIVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<towny.version>0.99.1.0</towny.version> <towny.version>0.99.5.0</towny.version>
</properties> </properties>
<!-- For use with GitHub Package Registry --> <!-- For use with GitHub Package Registry -->
@@ -59,7 +59,7 @@ public class Chat extends JavaPlugin {
private DynmapAPI dynMap = null; private DynmapAPI dynMap = null;
private Essentials essentials = null; private Essentials essentials = null;
private static String requiredTownyVersion = "0.99.1.0"; private static String requiredTownyVersion = "0.99.5.0";
public static boolean usingPlaceholderAPI = false; public static boolean usingPlaceholderAPI = false;
public static boolean usingEssentialsDiscord = false; public static boolean usingEssentialsDiscord = false;
boolean chatConfigError = false; boolean chatConfigError = false;
@@ -80,7 +80,7 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
} else { } else {
// Console // Console
for (String line : channel_help) { for (String line : channel_help) {
sender.sendMessage(Colors.strip(line)); TownyMessaging.sendMessage(sender, Colors.strip(line));
return true; return true;
} }
} }
@@ -91,7 +91,7 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
// So they just type /channel , We should probably send them to the help menu.. // So they just type /channel , We should probably send them to the help menu..
if (split.length == 0 || split[0].equalsIgnoreCase("help") || split[0].equalsIgnoreCase("?")) { if (split.length == 0 || split[0].equalsIgnoreCase("help") || split[0].equalsIgnoreCase("?")) {
for (String line : channel_help) for (String line : channel_help)
player.sendMessage(line); TownyMessaging.sendMessage(player, line);
} else if (split[0].equalsIgnoreCase("join")) { // /channel join [chn] (/label args[0] args[1] length = 2.) } else if (split[0].equalsIgnoreCase("join")) { // /channel join [chn] (/label args[0] args[1] length = 2.)
parseChannelJoin(player, StringMgmt.remFirstArg(split)); parseChannelJoin(player, StringMgmt.remFirstArg(split));
} else if (split[0].equalsIgnoreCase("leave")) { } else if (split[0].equalsIgnoreCase("leave")) {
@@ -130,7 +130,7 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
public static void parseChannelMuteList(Player player, String[] split) { public static void parseChannelMuteList(Player player, String[] split) {
if (split.length == 0) { if (split.length == 0) {
for (String line : channel_help) { for (String line : channel_help) {
player.sendMessage(line); TownyMessaging.sendMessage(player, line);
} }
return; return;
} }
@@ -194,7 +194,7 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
public static void parseChannelMute(Player player, String[] split, boolean mute) { public static void parseChannelMute(Player player, String[] split, boolean mute) {
if (split.length < 2) { if (split.length < 2) {
for (String line : channel_help) { for (String line : channel_help) {
player.sendMessage(line); TownyMessaging.sendMessage(player, line);
} }
return; return;
} }
@@ -277,7 +277,7 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
public static void parseChannelLeave(Player player, String[] split) { public static void parseChannelLeave(Player player, String[] split) {
if (split.length == 0) { if (split.length == 0) {
for (String line : channel_help) { for (String line : channel_help) {
player.sendMessage(line); TownyMessaging.sendMessage(player, line);
} }
return; return;
} }
@@ -341,7 +341,7 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
public static void parseChannelJoin(Player player, String[] split) { public static void parseChannelJoin(Player player, String[] split) {
if (split.length == 0) { if (split.length == 0) {
for (String line : channel_help) { for (String line : channel_help) {
player.sendMessage(line); TownyMessaging.sendMessage(player, line);
} }
return; return;
} }
@@ -390,7 +390,7 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
public static void parseChannelSoundToggle(Player player, String[] split) { public static void parseChannelSoundToggle(Player player, String[] split) {
if (split.length == 0) { if (split.length == 0) {
for (String line : channel_help) { for (String line : channel_help) {
player.sendMessage(line); TownyMessaging.sendMessage(player, line);
} }
return; return;
} }
@@ -43,13 +43,9 @@ public class TownyChatCommand extends BaseCommand implements CommandExecutor {
} }
private void parseTownyChatCommand(CommandSender sender, String[] split) { private void parseTownyChatCommand(CommandSender sender, String[] split) {
if (split.length == 0) { // So they just type /channel , We should probably send them to the help menu.. if (split.length == 0 || split[0].equalsIgnoreCase("help") || split[0].equalsIgnoreCase("?")) {
for (String line : townychat_help) { for (String line : townychat_help) {
sender.sendMessage(line); TownyMessaging.sendMessage(sender, line);
}
} else if (split[0].equalsIgnoreCase("help") || split[0].equalsIgnoreCase("?")) {
for (String line : townychat_help) {
sender.sendMessage(line);
} }
} else if (split[0].equalsIgnoreCase("reload")) { } else if (split[0].equalsIgnoreCase("reload")) {
plugin.reload(); plugin.reload();
@@ -88,7 +88,7 @@ public class ChannelJoinAliasCommand extends BukkitCommand {
} }
return true; return true;
} else { } else {
commandSender.sendMessage("You may not use this command as the console!"); TownyMessaging.sendMsg("You may not use this command as the console!");
return false; return false;
} }
} }
@@ -192,7 +192,7 @@ public class StandardChannel extends Channel {
private void trySendingAloneMessage(Player sender, Set<Player> recipients) { private void trySendingAloneMessage(Player sender, Set<Player> recipients) {
if (ChatSettings.isUsingAloneMessage() && if (ChatSettings.isUsingAloneMessage() &&
recipients.stream().filter(p -> sender.canSee(p)).count() < 2) // sender will usually be a recipient of their own message. recipients.stream().filter(p -> sender.canSee(p)).count() < 2) // sender will usually be a recipient of their own message.
sender.sendMessage(Colors.translateColorCodes(ChatSettings.getUsingAloneMessageString())); TownyMessaging.sendMessage(sender, ChatSettings.getUsingAloneMessageString());
} }
private void applyFormats(AsyncPlayerChatEvent event, String originalFormat, String workingFormat, Resident resident) { private void applyFormats(AsyncPlayerChatEvent event, String originalFormat, String workingFormat, Resident resident) {
@@ -286,7 +286,7 @@ public class StandardChannel extends Channel {
// Remove spies who've already seen the message naturally. // Remove spies who've already seen the message naturally.
spies.stream() spies.stream()
.filter(spy -> !recipients.contains(spy)) .filter(spy -> !recipients.contains(spy))
.forEach(spy -> spy.sendMessage(format + message)); .forEach(spy -> TownyMessaging.sendMessage(spy, format + message));
} }
/** /**