mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-02 14:38: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
+36
-2
No files matched your search
+4
-1
@@ -74,4 +74,7 @@ v0.12:
|
||||
- towny_default_modes now uses the full chat channel name. To allow use of the default channel it would be towny_default_modes: 'general'
|
||||
- Moved ALL chat settings to 'ChatConfig.yml' found in the Towny/Settings folder.
|
||||
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;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
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_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() {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.palmergames.bukkit.TownyChat.channels;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -93,5 +95,24 @@ public class ChannelsHolder {
|
||||
}
|
||||
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.registerPermissions();
|
||||
plugin.registerEvents();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
name: TownyChat
|
||||
main: com.palmergames.bukkit.TownyChat.Chat
|
||||
version: 0.13
|
||||
version: 0.14
|
||||
author: ElgarL, Shade
|
||||
website: http://code.google.com/a/eclipselabs.org/p/towny/
|
||||
description: >
|
||||
|
||||
Reference in new issue
Block a user