mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-03 22:21:20 +00:00
v0.62:
- New Channel: AllianceChat
- Requires Towny 0.95.0.5 or newer.
- Will send messages to every online ally of your nation.
- Has its own channel_format in the chatconfig.yml.
- Your channels.yml will need to have an Alliance channel added.
- Default channels.yml is:
alliance:
commands: [ac]
type: ALLIANCE
channeltag: '&f[&2AC&f]'
messagecolour: '&a'
permission: 'towny.chat.alliance'
range: '-1'
This commit is contained in:
1 parent
6df2fac32a
commit
4e9999019b
9 files changed
+69
-2
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.61</version>
|
<version>0.62</version>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
|
|||||||
@@ -57,6 +57,14 @@ Channels:
|
|||||||
permission: 'towny.chat.nation'
|
permission: 'towny.chat.nation'
|
||||||
range: '-1'
|
range: '-1'
|
||||||
|
|
||||||
|
alliance:
|
||||||
|
commands: [ac]
|
||||||
|
type: ALLIANCE
|
||||||
|
channeltag: '&f[&2AC&f]'
|
||||||
|
messagecolour: '&a'
|
||||||
|
permission: 'towny.chat.alliance'
|
||||||
|
range: '-1'
|
||||||
|
|
||||||
admin:
|
admin:
|
||||||
commands: [a,admin]
|
commands: [a,admin]
|
||||||
type: DEFAULT
|
type: DEFAULT
|
||||||
|
|||||||
@@ -257,3 +257,20 @@ v0.61:
|
|||||||
- New Config Option: display_modes_set_on_join
|
- New Config Option: display_modes_set_on_join
|
||||||
- Default: true
|
- Default: true
|
||||||
- If true players will see [Towny] Modes set: general when they log in.
|
- If true players will see [Towny] Modes set: general when they log in.
|
||||||
|
v0.62:
|
||||||
|
- New Channel: AllianceChat
|
||||||
|
- Requires Towny 0.95.0.5 or newer.
|
||||||
|
- Will send messages to every online ally of your nation.
|
||||||
|
- Has its own channel_format in the chatconfig.yml.
|
||||||
|
- Your channels.yml will need to have an Alliance channel added.
|
||||||
|
- Default channels.yml is:
|
||||||
|
alliance:
|
||||||
|
commands: [ac]
|
||||||
|
type: ALLIANCE
|
||||||
|
channeltag: '&f[&2AC&f]'
|
||||||
|
messagecolour: '&a'
|
||||||
|
permission: 'towny.chat.alliance'
|
||||||
|
range: '-1'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -91,6 +91,16 @@ public class StandardChannel extends Channel {
|
|||||||
recipients = checkSpying(recipients);
|
recipients = checkSpying(recipients);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ALLIANCE:
|
||||||
|
if (nation == null) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Format = ChatSettings.getRelevantFormatGroup(player).getALLIANCE();
|
||||||
|
recipients = new HashSet<>(findRecipients(player, TownyAPI.getInstance().getOnlinePlayersAlliance(nation)));
|
||||||
|
recipients = checkSpying(recipients);
|
||||||
|
break;
|
||||||
|
|
||||||
case DEFAULT:
|
case DEFAULT:
|
||||||
Format = ChatSettings.getRelevantFormatGroup(player).getDEFAULT();
|
Format = ChatSettings.getRelevantFormatGroup(player).getDEFAULT();
|
||||||
recipients = new HashSet<>(findRecipients(player, new ArrayList<>(event.getRecipients())));
|
recipients = new HashSet<>(findRecipients(player, new ArrayList<>(event.getRecipients())));
|
||||||
@@ -156,6 +166,9 @@ public class StandardChannel extends Channel {
|
|||||||
case NATION:
|
case NATION:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ALLIANCE:
|
||||||
|
break;
|
||||||
|
|
||||||
case DEFAULT:
|
case DEFAULT:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class channelFormats {
|
|||||||
this.name = name.toLowerCase();
|
this.name = name.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String name, GLOBAL, TOWN, NATION, DEFAULT;
|
private String name, GLOBAL, TOWN, NATION, ALLIANCE, DEFAULT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a clone of this channelFormats
|
* @return a clone of this channelFormats
|
||||||
@@ -26,6 +26,7 @@ public class channelFormats {
|
|||||||
clone.setGLOBAL(this.getGLOBAL());
|
clone.setGLOBAL(this.getGLOBAL());
|
||||||
clone.setTOWN(this.getTOWN());
|
clone.setTOWN(this.getTOWN());
|
||||||
clone.setNATION(this.getNATION());
|
clone.setNATION(this.getNATION());
|
||||||
|
clone.setALLIANCE(this.getALLIANCE());
|
||||||
clone.setDEFAULT(this.getDEFAULT());
|
clone.setDEFAULT(this.getDEFAULT());
|
||||||
|
|
||||||
return clone;
|
return clone;
|
||||||
@@ -91,6 +92,21 @@ public class channelFormats {
|
|||||||
this.NATION = NATION;
|
this.NATION = NATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ALLIANCE
|
||||||
|
*/
|
||||||
|
public String getALLIANCE() {
|
||||||
|
return this.ALLIANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ALLIANCE
|
||||||
|
* the ALLIANCE to set
|
||||||
|
*/
|
||||||
|
public void setALLIANCE(String ALLIANCE) {
|
||||||
|
this.ALLIANCE = ALLIANCE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the DEFAULT
|
* @return the DEFAULT
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package com.palmergames.bukkit.TownyChat.channels;
|
|||||||
public enum channelTypes {
|
public enum channelTypes {
|
||||||
TOWN,
|
TOWN,
|
||||||
NATION,
|
NATION,
|
||||||
|
ALLIANCE,
|
||||||
DEFAULT,
|
DEFAULT,
|
||||||
GLOBAL,
|
GLOBAL,
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|||||||
@@ -93,6 +93,10 @@ public enum ChatConfigNodes {
|
|||||||
"channel_formats.nation",
|
"channel_formats.nation",
|
||||||
"{channelTag} {towntagoverride}{townycolor}{permprefix}{townyprefix}{playername}{townypostfix}{permsuffix}&f:{msgcolour} {msg}",
|
"{channelTag} {towntagoverride}{townycolor}{permprefix}{townyprefix}{playername}{townypostfix}{permsuffix}&f:{msgcolour} {msg}",
|
||||||
"# NATION channel types."),
|
"# NATION channel types."),
|
||||||
|
CHANNEL_FORMATS_ALLIANCE(
|
||||||
|
"channel_formats.alliance",
|
||||||
|
"{channelTag} {towntagoverride}{townycolor}{permprefix}{townyprefix}{playername}{townypostfix}{permsuffix}&f:{msgcolour} {msg}",
|
||||||
|
"# ALLIANCE channel types."),
|
||||||
CHANNEL_FORMATS_DEFAULT(
|
CHANNEL_FORMATS_DEFAULT(
|
||||||
"channel_formats.default",
|
"channel_formats.default",
|
||||||
"{channelTag} {permprefix}{playername}{permsuffix}&f:{msgcolour} {msg}",
|
"{channelTag} {permprefix}{playername}{permsuffix}&f:{msgcolour} {msg}",
|
||||||
|
|||||||
@@ -91,12 +91,14 @@ public class ChatSettings extends tag_formats {
|
|||||||
|| !chatConfig.contains("worlds." + world + ".global")
|
|| !chatConfig.contains("worlds." + world + ".global")
|
||||||
|| !chatConfig.contains("worlds." + world + ".town")
|
|| !chatConfig.contains("worlds." + world + ".town")
|
||||||
|| !chatConfig.contains("worlds." + world + ".nation")
|
|| !chatConfig.contains("worlds." + world + ".nation")
|
||||||
|
|| !chatConfig.contains("worlds." + world + ".alliance")
|
||||||
|| !chatConfig.contains("worlds." + world + ".default")) {
|
|| !chatConfig.contains("worlds." + world + ".default")) {
|
||||||
newChatConfig.createSection("worlds." + world);
|
newChatConfig.createSection("worlds." + world);
|
||||||
ConfigurationSection worldsection = newChatConfig.getConfigurationSection("worlds." + world);
|
ConfigurationSection worldsection = newChatConfig.getConfigurationSection("worlds." + world);
|
||||||
worldsection.set("global", (chatConfig.get("worlds." + world + ".global")!= null) ? chatConfig.get("worlds." + world + ".global") : ChatConfigNodes.CHANNEL_FORMATS_GLOBAL.getDefault());
|
worldsection.set("global", (chatConfig.get("worlds." + world + ".global")!= null) ? chatConfig.get("worlds." + world + ".global") : ChatConfigNodes.CHANNEL_FORMATS_GLOBAL.getDefault());
|
||||||
worldsection.set("town", (chatConfig.get("worlds." + world + ".town")!= null) ? chatConfig.get("worlds." + world + ".town") : ChatConfigNodes.CHANNEL_FORMATS_TOWN.getDefault());
|
worldsection.set("town", (chatConfig.get("worlds." + world + ".town")!= null) ? chatConfig.get("worlds." + world + ".town") : ChatConfigNodes.CHANNEL_FORMATS_TOWN.getDefault());
|
||||||
worldsection.set("nation", (chatConfig.get("worlds." + world + ".nation")!= null) ? chatConfig.get("worlds." + world + ".nation") : ChatConfigNodes.CHANNEL_FORMATS_NATION.getDefault());
|
worldsection.set("nation", (chatConfig.get("worlds." + world + ".nation")!= null) ? chatConfig.get("worlds." + world + ".nation") : ChatConfigNodes.CHANNEL_FORMATS_NATION.getDefault());
|
||||||
|
worldsection.set("alliance", (chatConfig.get("worlds." + world + ".alliance")!= null) ? chatConfig.get("worlds." + world + ".alliance") : ChatConfigNodes.CHANNEL_FORMATS_ALLIANCE.getDefault());
|
||||||
worldsection.set("default", (chatConfig.get("worlds." + world + ".default")!= null) ? chatConfig.get("worlds." + world + ".default") : ChatConfigNodes.CHANNEL_FORMATS_DEFAULT.getDefault());
|
worldsection.set("default", (chatConfig.get("worlds." + world + ".default")!= null) ? chatConfig.get("worlds." + world + ".default") : ChatConfigNodes.CHANNEL_FORMATS_DEFAULT.getDefault());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,6 +258,9 @@ public class ConfigurationHandler {
|
|||||||
if (element.equalsIgnoreCase("nation"))
|
if (element.equalsIgnoreCase("nation"))
|
||||||
group.setNATION(subNodes.get(element).toString());
|
group.setNATION(subNodes.get(element).toString());
|
||||||
|
|
||||||
|
if (element.equalsIgnoreCase("alliance"))
|
||||||
|
group.setALLIANCE(subNodes.get(element).toString());
|
||||||
|
|
||||||
if (element.equalsIgnoreCase("default"))
|
if (element.equalsIgnoreCase("default"))
|
||||||
group.setDEFAULT(subNodes.get(element).toString());
|
group.setDEFAULT(subNodes.get(element).toString());
|
||||||
}
|
}
|
||||||
@@ -284,6 +287,9 @@ public class ConfigurationHandler {
|
|||||||
if (element.equalsIgnoreCase("nation"))
|
if (element.equalsIgnoreCase("nation"))
|
||||||
group.setNATION(world.get(element).toString());
|
group.setNATION(world.get(element).toString());
|
||||||
|
|
||||||
|
if (element.equalsIgnoreCase("alliance"))
|
||||||
|
group.setALLIANCE(world.get(element).toString());
|
||||||
|
|
||||||
if (element.equalsIgnoreCase("default"))
|
if (element.equalsIgnoreCase("default"))
|
||||||
group.setDEFAULT(world.get(element).toString());
|
group.setDEFAULT(world.get(element).toString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user