mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-02 14:38:57 +00:00
v0.44:
- add a /ch list command to list what channels a player is currently
listening to. Courtesy of Yaiyan.
v0.45:
- Add chatconfig.yml option for modifying the 'no one can hear you'
message.
This commit is contained in:
1 parent
9187f15f6a
commit
29dbbcca3b
6 files changed
+31
-5
No files matched your search
@@ -88,4 +88,6 @@
|
||||
# either by being along in the channel or out-of-range of another player in his chat channel,
|
||||
# that player will see a message saying they cannot be heard.
|
||||
alone_message: '[modify_alone_message]'
|
||||
# This allows you to set your alone messaeg.
|
||||
alone_message_string: '[modify_alone_message_string]'
|
||||
worlds:
|
||||
+3
-1
@@ -187,4 +187,6 @@ v0.43:
|
||||
- add a new chatconfig.yml option:
|
||||
- modify_chat.alone_message: (default: false) - If true any player who speaks in a channel in which he cannot be heard, either by being along in the channel or out-of-range of another player in his chat channel, that player will see a message saying they cannot be heard.
|
||||
v0.44:
|
||||
- add a /ch list command to list what channels a player is currently listening to. Courtesy of Yaiyan.
|
||||
- add a /ch list command to list what channels a player is currently listening to. Courtesy of Yaiyan.
|
||||
v0.45:
|
||||
- Add chatconfig.yml option for modifying the 'no one can hear you' message.
|
||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
@@ -255,9 +256,9 @@ public class StandardChannel extends Channel {
|
||||
}
|
||||
}
|
||||
|
||||
if ((recipients.size() <= 1) && (ChatSettings.isUsingAloneMessage()))
|
||||
sender.sendMessage("No one in range can hear you or you are alone in this channel.");
|
||||
|
||||
if ((recipients.size() <= 1) && (ChatSettings.isUsingAloneMessage()))
|
||||
sender.sendMessage(ChatSettings.getUsingAloneMessageString());
|
||||
|
||||
return recipients;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ public class ChatSettings extends tag_formats {
|
||||
private static boolean modify_chat;
|
||||
private static boolean per_world;
|
||||
private static boolean alone_message;
|
||||
private static String alone_message_string;
|
||||
private static boolean heroicDeathToIRC = true;
|
||||
private static String heroicDeathTags ="admin";
|
||||
|
||||
@@ -115,6 +116,22 @@ public class ChatSettings extends tag_formats {
|
||||
return ChatSettings.alone_message = alone_message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param alone_message_string
|
||||
* @return
|
||||
*/
|
||||
public static String setUsingAloneMessageString(String alone_message_string) {
|
||||
return ChatSettings.alone_message_string = alone_message_string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param alone_message_string
|
||||
* @return
|
||||
*/
|
||||
public static String getUsingAloneMessageString() {
|
||||
return ChatSettings.alone_message_string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the per_world
|
||||
*/
|
||||
|
||||
@@ -200,6 +200,9 @@ public class ConfigurationHandler {
|
||||
|
||||
if (element.equalsIgnoreCase("alone_message"))
|
||||
ChatSettings.setUsingAloneMessage(Boolean.valueOf(subNodes.get(element).toString()));
|
||||
|
||||
if (element.equalsIgnoreCase("alone_message_string"))
|
||||
ChatSettings.setUsingAloneMessageString(String.valueOf(subNodes.get(element).toString()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -373,6 +376,7 @@ public class ConfigurationHandler {
|
||||
newConfig = newConfig.replace("[modify_enable]", (defaults)? "true" : Boolean.toString(ChatSettings.isModify_chat()));
|
||||
newConfig = newConfig.replace("[modify_per_world]", (defaults)? "false" : Boolean.toString(ChatSettings.isPer_world()));
|
||||
newConfig = newConfig.replace("[modify_alone_message]", (defaults)? "false" : Boolean.toString(ChatSettings.isUsingAloneMessage()));
|
||||
newConfig = newConfig.replace("[modify_alone_message_string]", (defaults)? "No one in range can hear you or you are alone in this channel." : (ChatSettings.getUsingAloneMessageString()));
|
||||
|
||||
for (String key : ChatSettings.getFormatGroups().keySet()) {
|
||||
if (!key.equalsIgnoreCase("channel_formats")) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
name: TownyChat
|
||||
main: com.palmergames.bukkit.TownyChat.Chat
|
||||
version: 0.44
|
||||
version: 0.45
|
||||
author: ElgarL, Shade, phrstbrn
|
||||
website: http://code.google.com/a/eclipselabs.org/p/towny/
|
||||
description: >
|
||||
|
||||
Reference in new issue
Block a user