mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 06:28:57 +00:00
v0.14:
- The default permission node for the global chat channel has changed to 'towny.chat.general' - TownyChat now registers is't permissions with Bukkit.
This commit is contained in:
1 parent
fde67df61a
commit
5ea30523d2
5 files changed
+35
-1
No files matched your search
@@ -75,3 +75,6 @@ v0.12:
|
|||||||
- Moved ALL chat settings to 'ChatConfig.yml' found in the Towny/Settings folder.
|
- Moved ALL chat settings to 'ChatConfig.yml' found in the Towny/Settings folder.
|
||||||
v0.13:
|
v0.13:
|
||||||
- Fixed channel modes when defaulting to a global channel not to place you in one of your own (Lonely spam).
|
- Fixed channel modes when defaulting to a global channel not to place you in one of your own (Lonely spam).
|
||||||
|
v0.14:
|
||||||
|
- The default permission node for the global chat channel has changed to 'towny.chat.general'
|
||||||
|
- TownyChat now registers is't permissions with Bukkit.
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.palmergames.bukkit.TownyChat;
|
package com.palmergames.bukkit.TownyChat;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.Event.Priority;
|
import org.bukkit.event.Event.Priority;
|
||||||
|
import org.bukkit.permissions.Permission;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
@@ -110,8 +112,15 @@ public class Chat extends JavaPlugin {
|
|||||||
|
|
||||||
pm.registerEvent(Event.Type.PLAYER_CHAT, TownyPlayerListener, Priority.Highest, this); //Run this lower so we go before herochat? ( it needs to see us cancel).
|
pm.registerEvent(Event.Type.PLAYER_CHAT, TownyPlayerListener, Priority.Highest, this); //Run this lower so we go before herochat? ( it needs to see us cancel).
|
||||||
pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, TownyPlayerListener, Priority.Highest, this);
|
pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, TownyPlayerListener, Priority.Highest, this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void registerPermissions() {
|
||||||
|
// Register all Permissions.
|
||||||
|
for (String perm : getChannelsHandler().getAllPermissions()) {
|
||||||
|
pm.addPermission(new Permission(perm, new HashMap<String, Boolean>()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getRootPath() {
|
public String getRootPath() {
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.palmergames.bukkit.TownyChat.channels;
|
package com.palmergames.bukkit.TownyChat.channels;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@@ -94,4 +96,23 @@ public class ChannelsHolder {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch all channel permissions
|
||||||
|
*
|
||||||
|
* @return Set of all permission nodes
|
||||||
|
*/
|
||||||
|
public Set<String> getAllPermissions() {
|
||||||
|
|
||||||
|
Set<String> perms = new HashSet<String>();
|
||||||
|
|
||||||
|
for (Channel channel: channels.values()) {
|
||||||
|
if (!perms.contains(channel.getPermission())) {
|
||||||
|
perms.add(channel.getName());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return perms;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,7 @@ public class onLoadedTask implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugin.getLogger().info("-******* TownyChat enabled *******-");
|
plugin.getLogger().info("-******* TownyChat enabled *******-");
|
||||||
|
plugin.registerPermissions();
|
||||||
plugin.registerEvents();
|
plugin.registerEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
name: TownyChat
|
name: TownyChat
|
||||||
main: com.palmergames.bukkit.TownyChat.Chat
|
main: com.palmergames.bukkit.TownyChat.Chat
|
||||||
version: 0.13
|
version: 0.14
|
||||||
author: ElgarL, Shade
|
author: ElgarL, Shade
|
||||||
website: http://code.google.com/a/eclipselabs.org/p/towny/
|
website: http://code.google.com/a/eclipselabs.org/p/towny/
|
||||||
description: >
|
description: >
|
||||||
|
|||||||
Reference in new issue
Block a user