mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 06:28:57 +00:00
- New Config Option: display_modes_set_on_join
- Default: true
- If true players will see [Towny] Modes set: general when they log
in.
This commit is contained in:
1 parent
db38c0c4a2
commit
6df2fac32a
6 files changed
+34
-7
No files matched your search
@@ -7,7 +7,7 @@
|
|||||||
<groupId>com.palmergames.bukkit</groupId>
|
<groupId>com.palmergames.bukkit</groupId>
|
||||||
<artifactId>TownyChat</artifactId>
|
<artifactId>TownyChat</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>0.60</version>
|
<version>0.61</version>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
|
|||||||
@@ -252,4 +252,8 @@ v0.58:
|
|||||||
v0.59:
|
v0.59:
|
||||||
- Fix {townycolor} not rendering properly for nomads.
|
- Fix {townycolor} not rendering properly for nomads.
|
||||||
v0.60:
|
v0.60:
|
||||||
- A more-thorough fix for TC still not respecting the cancelling of chat.
|
- A more-thorough fix for TC still not respecting the cancelling of chat.
|
||||||
|
v0.61:
|
||||||
|
- New Config Option: display_modes_set_on_join
|
||||||
|
- Default: true
|
||||||
|
- If true players will see [Towny] Modes set: general when they log in.
|
||||||
@@ -156,6 +156,11 @@ public enum ChatConfigNodes {
|
|||||||
"modify_chat.alone_message_string",
|
"modify_chat.alone_message_string",
|
||||||
"No one in range can hear you or you are alone in this channel.",
|
"No one in range can hear you or you are alone in this channel.",
|
||||||
"# This allows you to set your alone message."),
|
"# This allows you to set your alone message."),
|
||||||
|
DISPLAY_MODES_SET_ON_JOIN(
|
||||||
|
"display_modes_set_on_join",
|
||||||
|
"true",
|
||||||
|
"",
|
||||||
|
"# If true players will see [Towny] Modes set: general when they log in."),
|
||||||
WORLDS("worlds","","");
|
WORLDS("worlds","","");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public class ChatSettings extends tag_formats {
|
|||||||
private static boolean modify_chat;
|
private static boolean modify_chat;
|
||||||
private static boolean per_world;
|
private static boolean per_world;
|
||||||
private static boolean alone_message;
|
private static boolean alone_message;
|
||||||
|
private static boolean display_modes_set_on_join;
|
||||||
private static String alone_message_string;
|
private static String alone_message_string;
|
||||||
|
|
||||||
private static Map<String, channelFormats> formatGroups = new HashMap<String, channelFormats>();
|
private static Map<String, channelFormats> formatGroups = new HashMap<String, channelFormats>();
|
||||||
@@ -231,14 +232,14 @@ public class ChatSettings extends tag_formats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param alone_message
|
* @param alone_message
|
||||||
*/
|
*/
|
||||||
public static boolean setUsingAloneMessage(boolean alone_message) {
|
public static boolean setUsingAloneMessage(boolean alone_message) {
|
||||||
return ChatSettings.alone_message = alone_message;
|
return ChatSettings.alone_message = alone_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param alone_message_string
|
* @param alone_message_string
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String setUsingAloneMessageString(String alone_message_string) {
|
public static String setUsingAloneMessageString(String alone_message_string) {
|
||||||
@@ -246,11 +247,25 @@ public class ChatSettings extends tag_formats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return the alone_message_string
|
||||||
*/
|
*/
|
||||||
public static String getUsingAloneMessageString() {
|
public static String getUsingAloneMessageString() {
|
||||||
return ChatSettings.alone_message_string;
|
return ChatSettings.alone_message_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param display_modes_set_on_join
|
||||||
|
*/
|
||||||
|
public static boolean setDisplayModesSetOnJoin(boolean display_modes_set_on_join) {
|
||||||
|
return ChatSettings.display_modes_set_on_join = display_modes_set_on_join;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the display_modes_set_on_join setting
|
||||||
|
*/
|
||||||
|
public static boolean getDisplayeModesSetOnJoin() {
|
||||||
|
return display_modes_set_on_join;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the per_world
|
* @return the per_world
|
||||||
|
|||||||
@@ -200,8 +200,10 @@ public class ConfigurationHandler {
|
|||||||
if (element.equalsIgnoreCase("alone_message_string"))
|
if (element.equalsIgnoreCase("alone_message_string"))
|
||||||
ChatSettings.setUsingAloneMessageString(String.valueOf(subNodes.get(element).toString()));
|
ChatSettings.setUsingAloneMessageString(String.valueOf(subNodes.get(element).toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Key.equalsIgnoreCase("display_modes_set_on_join"))
|
||||||
|
ChatSettings.setDisplayModesSetOnJoin(Boolean.valueOf(file.get(Key).toString()));
|
||||||
|
|
||||||
if (Key.equalsIgnoreCase("colour")) {
|
if (Key.equalsIgnoreCase("colour")) {
|
||||||
Map<String, Object> subNodes = (Map<String, Object>) file.get(Key);
|
Map<String, Object> subNodes = (Map<String, Object>) file.get(Key);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.palmergames.bukkit.TownyChat.Chat;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.palmergames.bukkit.TownyChat.channels.Channel;
|
import com.palmergames.bukkit.TownyChat.channels.Channel;
|
||||||
|
import com.palmergames.bukkit.TownyChat.config.ChatSettings;
|
||||||
import com.palmergames.bukkit.towny.Towny;
|
import com.palmergames.bukkit.towny.Towny;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -32,7 +33,7 @@ public class onPlayerJoinTask implements Runnable {
|
|||||||
if (this.towny.isEnabled()) {
|
if (this.towny.isEnabled()) {
|
||||||
if (!this.towny.isError()) {
|
if (!this.towny.isError()) {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
towny.setPlayerMode(player, new String[] { mode }, true);
|
towny.setPlayerMode(player, new String[] { mode }, ChatSettings.getDisplayeModesSetOnJoin());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user