diff --git a/lib/currency.jar b/lib/MultiCurrency.jar similarity index 100% rename from lib/currency.jar rename to lib/MultiCurrency.jar diff --git a/lib/PermissionsEx.jar b/lib/PermissionsEx.jar index c44cde2..9f686b3 100644 Binary files a/lib/PermissionsEx.jar and b/lib/PermissionsEx.jar differ diff --git a/src/net/milkbowl/vault/chat/Chat.java b/src/net/milkbowl/vault/chat/Chat.java new file mode 100644 index 0000000..9e66759 --- /dev/null +++ b/src/net/milkbowl/vault/chat/Chat.java @@ -0,0 +1,618 @@ +package net.milkbowl.vault.chat; + +import org.bukkit.World; +import org.bukkit.entity.Player; + +public abstract class Chat { + + /** + * Gets name of permission method + * @return Name of Permission Method + */ + abstract public String getName(); + + /** + * Checks if permission method is enabled. + * @return Success or Failure + */ + abstract public boolean isEnabled(); + + /** + * Get players prefix + * @param world World name + * @param player Player name + * @return Prefix + */ + abstract public String getPlayerPrefix(String world, String player); + + /** + * Get players prefix + * @param world World Object + * @param player Player name + * @return Prefix + */ + public String getPlayerPrefix(World world, String player) { + return getPlayerPrefix(world.getName(), player); + } + + /** + * Get players prefix + * @param player Player Object + * @return Prefix + */ + public String getPlayerPrefix(Player player) { + return getPlayerPrefix(player.getWorld().getName(), player.getName()); + } + + /** + * Set players prefix + * @param world World name + * @param player Player name + * @param prefix Prefix + */ + abstract public void setPlayerPrefix(String world, String player, String prefix); + + /** + * Set players prefix + * @param world World Object + * @param player Player name + * @param prefix Prefix + */ + public void setPlayerPrefix(World world, String player, String prefix) { + setPlayerPrefix(world.getName(), player, prefix); + } + + /** + * Set players prefix + * @param player Player Object + * @param prefix Prefix + */ + public void setPlayerPrefix(Player player, String prefix) { + setPlayerPrefix(player.getWorld().getName(), player.getName(), prefix); + } + + /** + * Get players suffix + * @param world World name + * @param player Player name + * @return Suffix + */ + abstract public String getPlayerSuffix(String world, String player); + + /** + * Get players suffix + * @param world World Object + * @param player Player name + * @return Suffix + */ + public String getPlayerSuffix(World world, String player) { + return getPlayerSuffix(world.getName(), player); + } + + /** + * Get players suffix + * @param player Player Object + * @return Suffix + */ + public String getPlayerSuffix(Player player) { + return getPlayerSuffix(player.getWorld().getName(), player.getName()); + } + + /** + * Set players suffix + * @param world World name + * @param player Player name + * @param suffix Suffix + */ + abstract public void setPlayerSuffix(String world, String player, String suffix); + + /** + * Set players suffix + * @param world World Object + * @param player Player name + * @param suffix Suffix + */ + public void setPlayerSuffix(World world, String player, String suffix) { + setPlayerSuffix(world.getName(), player, suffix); + } + + /** + * Set players suffix + * @param player Player Object + * @param suffix Suffix + */ + public void setPlayerSuffix(Player player, String suffix) { + setPlayerSuffix(player.getWorld().getName(), player.getName(), suffix); + } + + /** + * Get group prefix + * @param world World name + * @param group Group name + * @return Prefix + */ + abstract public String getGroupPrefix(String world, String group); + + /** + * Get group prefix + * @param world World Object + * @param group Group name + * @return Prefix + */ + public String getGroupPrefix(World world, String group) { + return getGroupPrefix(world.getName(), group); + } + + /** + * Set group prefix + * @param world World name + * @param group Group name + * @param prefix Prefix + */ + abstract public void setGroupPrefix(String world, String group, String prefix); + + /** + * Set group prefix + * @param world World Object + * @param group Group name + * @param prefix Prefix + */ + public void setGroupPrefix(World world, String group, String prefix) { + setGroupPrefix(world.getName(), group, prefix); + } + + /** + * Get group suffix + * @param world World name + * @param group Group name + * @return Suffix + */ + abstract public String getGroupSuffix(String world, String group); + + /** + * Get group suffix + * @param world World Object + * @param group Group name + * @return Suffix + */ + public String getGroupSuffix(World world, String group) { + return getGroupSuffix(world.getName(), group); + } + + /** + * Set group suffix + * @param world World name + * @param group Group name + * @param suffix Suffix + */ + abstract public void setGroupSuffix(String world, String group, String suffix); + + /** + * Set group suffix + * @param world World Object + * @param group Group name + * @param suffix Suffix + */ + public void setGroupSuffix(World world, String group, String suffix) { + setGroupSuffix(world.getName(), group, suffix); + } + /** + * Get a players informational node (Integer) value + * @param world World name + * @param player Player name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + abstract public int getPlayerInfoInteger(String world, String player, String node, int defaultValue); + + /** + * Get a players informational node (Integer) value + * @param world World Object + * @param player Player name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public int getPlayerInfoInteger(World world, String player, String node, int defaultValue) { + return getPlayerInfoInteger(world.getName(), player, node, defaultValue); + } + + /** + * Get a players informational node (Integer) value + * @param player Player Object + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public int getPlayerInfoInteger(Player player, String node, int defaultValue) { + return getPlayerInfoInteger(player.getWorld().getName(), player.getName(), node, defaultValue); + } + + /** + * Set a players informational node (Integer) value + * @param world World name + * @param player Player name + * @param node Permission node + * @param value Value to set + */ + abstract public void setPlayerInfoInteger(String world, String player, String node, int value); + + /** + * Set a players informational node (Integer) value + * @param world World Object + * @param player Player name + * @param node Permission node + * @param value Value to set + */ + public void setPlayerInfoInteger(World world, String player, String node, int value) { + setPlayerInfoInteger(world.getName(), player, node, value); + } + + /** + * Set a players informational node (Integer) value + * @param player Player Object + * @param node Permission node + * @param value Value to set + */ + public void setPlayerInfoInteger(Player player, String node, int value) { + setPlayerInfoInteger(player.getWorld().getName(), player.getName(), node, value); + } + + /** + * Get a groups informational node (Integer) value + * @param world World name + * @param group Group name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + abstract public int getGroupInfoInteger(String world, String group, String node, int defaultValue); + + /** + * Get a groups informational node (Integer) value + * @param world World Object + * @param group Group name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public int getGroupInfoInteger(World world, String group, String node, int defaultValue) { + return getGroupInfoInteger(world.getName(), group, node, defaultValue); + } + + /** + * Set a groups informational node (Integer) value + * @param world World name + * @param group Group name + * @param node Permission node + * @param value Value to set + */ + abstract public void setGroupInfoInteger(String world, String group, String node, int value); + + /** + * Set a groups informational node (Integer) value + * @param world World Object + * @param group Group name + * @param node Permission node + * @param value Value to set + */ + public void setGroupInfoInteger(World world, String group, String node, int value) { + setGroupInfoInteger(world.getName(), group, node, value); + } + + /** + * Get a players informational node (Double) value + * @param world World name + * @param player Group name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + abstract public double getPlayerInfoDouble(String world, String player, String node, double defaultValue); + + /** + * Get a players informational node (Double) value + * @param world World Object + * @param player Player name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public double getPlayerInfoDouble(World world, String player, String node, double defaultValue) { + return getPlayerInfoDouble(world.getName(), player, node, defaultValue); + } + + /** + * Get a players informational node (Double) value + * @param player Player Object + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public double getPlayerInfoDouble(Player player, String node, double defaultValue) { + return getPlayerInfoDouble(player.getWorld().getName(), player.getName(), node, defaultValue); + } + + /** + * Set a players informational node (Double) value + * @param world World name + * @param player Group name + * @param node Permission node + * @param value Value to set + */ + abstract public void setPlayerInfoDouble(String world, String player, String node, double value); + + /** + * Set a players informational node (Double) value + * @param world World Object + * @param player Player name + * @param node Permission node + * @param value Value to set + */ + public void setPlayerInfoDouble(World world, String player, String node, double value) { + setPlayerInfoDouble(world.getName(), player, node, value); + } + + /** + * Set a players informational node (Double) value + * @param player Player Object + * @param node Permission node + * @param value Value to set + */ + public void setPlayerInfoDouble(Player player, String node, double value) { + setPlayerInfoDouble(player.getWorld().getName(), player.getName(), node, value); + } + + /** + * Get a groups informational node (Double) value + * @param world World name + * @param group Group name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + abstract public double getGroupInfoDouble(String world, String group, String node, double defaultValue); + + /** + * Get a groups informational node (Double) value + * @param world World Object + * @param group Group name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public double getGroupInfoDouble(World world, String group, String node, double defaultValue) { + return getGroupInfoDouble(world.getName(), group, node, defaultValue); + } + + /** + * Set a groups informational node (Double) value + * @param world World name + * @param group Group name + * @param node Permission node + * @param value Value to set + */ + abstract public void setGroupInfoDouble(String world, String group, String node, double value); + + /** + * Set a groups informational node (Double) value + * @param world World Object + * @param group Group name + * @param node Permission node + * @param value Value to set + */ + public void setGroupInfoDouble(World world, String group, String node, double value) { + setGroupInfoDouble(world.getName(), group, node, value); + } + + /** + * Get a players informational node (Boolean) value + * @param world World name + * @param player Player name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + abstract public boolean getPlayerInfoBoolean(String world, String player, String node, boolean defaultValue); + + /** + * Get a players informational node (Boolean) value + * @param world World Object + * @param player Player name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public boolean getPlayerInfoBoolean(World world, String player, String node, boolean defaultValue) { + return getPlayerInfoBoolean(world.getName(), player, node, defaultValue); + } + + /** + * Get a players informational node (Boolean) value + * @param player Player Object + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public boolean getPlayerInfoBoolean(Player player, String node, boolean defaultValue) { + return getPlayerInfoBoolean(player.getWorld().getName(), player.getName(), node, defaultValue); + } + + /** + * Set a players informational node (Boolean) value + * @param world World name + * @param player Player name + * @param node Permission node + * @param value Value to set + */ + abstract public void setPlayerInfoBoolean(String world, String player, String node, boolean value); + + /** + * Set a players informational node (Boolean) value + * @param world World Object + * @param player Player name + * @param node Permission node + * @param value Value to set + */ + public void setPlayerInfoBoolean(World world, String player, String node, boolean value) { + setPlayerInfoBoolean(world.getName(), player, node, value); + } + + /** + * Set a players informational node (Boolean) value + * @param player Player Object + * @param node Permission node + * @param value Value to set + */ + public void setPlayerInfoBoolean(Player player, String node, boolean value) { + setPlayerInfoBoolean(player.getWorld().getName(), player.getName(), node, value); + } + + /** + * Get a groups informational node (Boolean) value + * @param world Name of World + * @param group Name of Group + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + abstract public boolean getGroupInfoBoolean(String world, String group, String node, boolean defaultValue); + + /** + * Set a players informational node (Boolean) value + * @param world World Object + * @param group Group name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public boolean getGroupInfoBoolean(World world, String group, String node, boolean defaultValue) { + return getGroupInfoBoolean(world.getName(), group, node, defaultValue); + } + + /** + * Set a groups informational node (Boolean) value + * @param world World name + * @param group Group name + * @param node Permission node + * @param value Value to set + */ + abstract public void setGroupInfoBoolean(String world, String group, String node, boolean value); + + /** + * Set a players informational node (Boolean) value + * @param world World Object + * @param group Group name + * @param node Permission node + * @param value Value to set + */ + public void setGroupInfoBoolean(World world, String group, String node, boolean value) { + setGroupInfoBoolean(world.getName(), group, node, value); + } + + /** + * Get a players informational node (String) value + * @param world World name + * @param player Player name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + abstract public String getPlayerInfoString(String world, String player, String node, String defaultValue); + + /** + * Get a players informational node (String) value + * @param world World Object + * @param player Player name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public String getPlayerInfoString(World world, String player, String node, String defaultValue) { + return getPlayerInfoString(world.getName(), player, node, defaultValue); + } + + /** + * Get a players informational node (String) value + * @param player Player Object + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public String getPlayerInfoString(Player player, String node, String defaultValue) { + return getPlayerInfoString(player.getWorld().getName(), player.getName(), node, defaultValue); + } + + /** + * Set a players informational node (String) value + * @param world World name + * @param player Player name + * @param node Permission node + * @param value Value to set + */ + abstract public void setPlayerInfoString(String world, String player, String node, String value); + + /** + * Set a players informational node (String) value + * @param world World name + * @param player Player name + * @param node Permission node + * @param value Value to set + */ + public void setPlayerInfoString(World world, String player, String node, String value) { + setPlayerInfoString(world.getName(), player, node, value); + } + + /** + * Set a players informational node (String) value + * @param player Player Object + * @param node Permission node + * @param value Value ot set + */ + public void setPlayerInfoString(Player player, String node, String value) { + setPlayerInfoString(player.getWorld().getName(), player.getName(), node, value); + } + + /** + * Get a groups informational node (String) value + * @param world Name of World + * @param group Name of Group + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + abstract public String getGroupInfoString(String world, String group, String node, String defaultValue); + + /** + * Set a players informational node (String) value + * @param world World Object + * @param group Group name + * @param node Permission node + * @param defaultValue Default value + * @return Value + */ + public String getGroupInfoString(World world, String group, String node, String defaultValue) { + return getGroupInfoString(world.getName(), group, node, defaultValue); + } + + /** + * Set a groups informational node (String) value + * @param world World name + * @param group Group name + * @param node Permission node + * @param value Value to set + */ + abstract public void setGroupInfoString(String world, String group, String node, String value); + + /** + * Set a groups informational node (String) value + * @param world World name + * @param group Group name + * @param node Permission node + * @param value Value to set + */ + public void setGroupInfoString(World world, String group, String node, String value) { + setGroupInfoString(world.getName(), group, node, value); + } +} diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_GroupManager.java b/src/net/milkbowl/vault/chat/plugins/Chat_GroupManager.java new file mode 100644 index 0000000..c8cc12d --- /dev/null +++ b/src/net/milkbowl/vault/chat/plugins/Chat_GroupManager.java @@ -0,0 +1,5 @@ +package net.milkbowl.vault.chat.plugins; + +public class Chat_GroupManager { + +} diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_Permissions2.java b/src/net/milkbowl/vault/chat/plugins/Chat_Permissions2.java new file mode 100644 index 0000000..04cac92 --- /dev/null +++ b/src/net/milkbowl/vault/chat/plugins/Chat_Permissions2.java @@ -0,0 +1,5 @@ +package net.milkbowl.vault.chat.plugins; + +public class Chat_Permissions2 { + +} diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java b/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java new file mode 100644 index 0000000..1c7957d --- /dev/null +++ b/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java @@ -0,0 +1,5 @@ +package net.milkbowl.vault.chat.plugins; + +public class Chat_Permissions3 { + +} diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_PermissionsEx.java b/src/net/milkbowl/vault/chat/plugins/Chat_PermissionsEx.java new file mode 100644 index 0000000..21e0843 --- /dev/null +++ b/src/net/milkbowl/vault/chat/plugins/Chat_PermissionsEx.java @@ -0,0 +1,5 @@ +package net.milkbowl.vault.chat.plugins; + +public class Chat_PermissionsEx { + +} diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions.java b/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions.java new file mode 100644 index 0000000..0e34a0b --- /dev/null +++ b/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions.java @@ -0,0 +1,5 @@ +package net.milkbowl.vault.chat.plugins; + +public class Chat_bPermissions { + +} diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_mChat.java b/src/net/milkbowl/vault/chat/plugins/Chat_mChat.java new file mode 100644 index 0000000..6a9a24b --- /dev/null +++ b/src/net/milkbowl/vault/chat/plugins/Chat_mChat.java @@ -0,0 +1,179 @@ +package net.milkbowl.vault.chat.plugins; + +import net.milkbowl.vault.chat.Chat; + +public class Chat_mChat extends Chat { + + @Override + public String getName() { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean isEnabled() { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getPlayerPrefix(String world, String player) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPlayerPrefix(String world, String player, String prefix) { + // TODO Auto-generated method stub + + } + + @Override + public String getPlayerSuffix(String world, String player) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPlayerSuffix(String world, String player, String suffix) { + // TODO Auto-generated method stub + + } + + @Override + public String getGroupPrefix(String world, String group) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setGroupPrefix(String world, String group, String prefix) { + // TODO Auto-generated method stub + + } + + @Override + public String getGroupSuffix(String world, String group) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setGroupSuffix(String world, String group, String suffix) { + // TODO Auto-generated method stub + + } + + @Override + public int getPlayerInfoInteger(String world, String player, String node, + int defaultValue) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void setPlayerInfoInteger(String world, String player, String node, + int value) { + // TODO Auto-generated method stub + + } + + @Override + public int getGroupInfoInteger(String world, String group, String node, + int defaultValue) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void setGroupInfoInteger(String world, String group, String node, + int value) { + // TODO Auto-generated method stub + + } + + @Override + public double getPlayerInfoDouble(String world, String player, String node, + double defaultValue) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void setPlayerInfoDouble(String world, String player, String node, + double value) { + // TODO Auto-generated method stub + + } + + @Override + public double getGroupInfoDouble(String world, String group, String node, + double defaultValue) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void setGroupInfoDouble(String world, String group, String node, + double value) { + // TODO Auto-generated method stub + + } + + @Override + public boolean getPlayerInfoBoolean(String world, String player, + String node, boolean defaultValue) { + // TODO Auto-generated method stub + return false; + } + + @Override + public void setPlayerInfoBoolean(String world, String player, String node, + boolean value) { + // TODO Auto-generated method stub + + } + + @Override + public boolean getGroupInfoBoolean(String world, String group, String node, + boolean defaultValue) { + // TODO Auto-generated method stub + return false; + } + + @Override + public void setGroupInfoBoolean(String world, String group, String node, + boolean value) { + // TODO Auto-generated method stub + + } + + @Override + public String getPlayerInfoString(String world, String player, String node, + String defaultValue) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPlayerInfoString(String world, String player, String node, + String value) { + // TODO Auto-generated method stub + + } + + @Override + public String getGroupInfoString(String world, String group, String node, + String defaultValue) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setGroupInfoString(String world, String group, String node, + String value) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/net/milkbowl/vault/permission/Permission.java b/src/net/milkbowl/vault/permission/Permission.java index de8f053..fd217b7 100644 --- a/src/net/milkbowl/vault/permission/Permission.java +++ b/src/net/milkbowl/vault/permission/Permission.java @@ -1019,4 +1019,10 @@ public abstract class Permission { public void setGroupSuffix(World world, String group, String suffix) { setGroupSuffix(world.getName(), group, suffix); } + + /** + * Returns a list of all known groups + * @return an Array of String of all groups + */ + abstract public String[] getGroups(); } \ No newline at end of file diff --git a/src/net/milkbowl/vault/permission/plugins/Permission_GroupManager.java b/src/net/milkbowl/vault/permission/plugins/Permission_GroupManager.java index ff121fb..db83afa 100644 --- a/src/net/milkbowl/vault/permission/plugins/Permission_GroupManager.java +++ b/src/net/milkbowl/vault/permission/plugins/Permission_GroupManager.java @@ -1,11 +1,17 @@ package net.milkbowl.vault.permission.plugins; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; import java.util.logging.Logger; import net.milkbowl.vault.permission.Permission; import org.anjocaido.groupmanager.GroupManager; +import org.anjocaido.groupmanager.data.Group; import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler; +import org.bukkit.Bukkit; +import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.event.Event.Priority; import org.bukkit.event.Event.Type; @@ -321,4 +327,16 @@ public class Permission_GroupManager extends Permission { } return false; } + + @Override + public String[] getGroups() { + Set groupNames = new HashSet(); + for (World world : Bukkit.getServer().getWorlds()) { + Collection groups = groupManager.getWorldsHolder().getWorldData(world.getName()).getGroupList(); + for (Group group : groups) { + groupNames.add(group.getName()); + } + } + return groupNames.toArray(new String[0]); + } } diff --git a/src/net/milkbowl/vault/permission/plugins/Permission_Permissions2.java b/src/net/milkbowl/vault/permission/plugins/Permission_Permissions2.java index 54c67e1..4a0913a 100644 --- a/src/net/milkbowl/vault/permission/plugins/Permission_Permissions2.java +++ b/src/net/milkbowl/vault/permission/plugins/Permission_Permissions2.java @@ -1,7 +1,11 @@ package net.milkbowl.vault.permission.plugins; +import java.util.HashSet; +import java.util.Set; import java.util.logging.Logger; +import org.bukkit.Bukkit; +import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.event.Event.Priority; import org.bukkit.event.Event.Type; @@ -13,6 +17,7 @@ import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; +import com.nijiko.permissions.Group; import com.nijiko.permissions.PermissionHandler; import com.nijikokun.bukkit.Permissions.Permissions; @@ -328,4 +333,15 @@ public class Permission_Permissions2 extends Permission { return false; } + @Override + public String[] getGroups() { + Set groupNames = new HashSet(); + for (World world : Bukkit.getServer().getWorlds()) { + for (Group group : perms.getGroups(world.getName())) { + groupNames.add(group.getName()); + } + } + return groupNames.toArray(new String[0]); + } + } diff --git a/src/net/milkbowl/vault/permission/plugins/Permission_Permissions3.java b/src/net/milkbowl/vault/permission/plugins/Permission_Permissions3.java index 4806f15..2df3481 100644 --- a/src/net/milkbowl/vault/permission/plugins/Permission_Permissions3.java +++ b/src/net/milkbowl/vault/permission/plugins/Permission_Permissions3.java @@ -19,10 +19,14 @@ package net.milkbowl.vault.permission.plugins; +import java.util.HashSet; +import java.util.Set; import java.util.logging.Logger; import net.milkbowl.vault.permission.Permission; +import org.bukkit.Bukkit; +import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.event.Event.Priority; import org.bukkit.event.Event.Type; @@ -339,4 +343,15 @@ public class Permission_Permissions3 extends Permission { return false; } } + + @Override + public String[] getGroups() { + Set groupNames = new HashSet(); + for (World world : Bukkit.getServer().getWorlds()) { + for (Group group : perms.getGroups(world.getName())) { + groupNames.add(group.getName()); + } + } + return groupNames.toArray(new String[0]); + } } diff --git a/src/net/milkbowl/vault/permission/plugins/Permission_PermissionsBukkit.java b/src/net/milkbowl/vault/permission/plugins/Permission_PermissionsBukkit.java index f826e64..5418f9b 100644 --- a/src/net/milkbowl/vault/permission/plugins/Permission_PermissionsBukkit.java +++ b/src/net/milkbowl/vault/permission/plugins/Permission_PermissionsBukkit.java @@ -401,7 +401,16 @@ public class Permission_PermissionsBukkit extends Permission { @Override public void setGroupSuffix(String world, String group, String suffix) { - // TODO Auto-generated method stub + throw new UnsupportedOperationException(getName() + " does not support group info nodes."); + } + @Override + public String[] getGroups() { + List groupNames = new ArrayList(); + for (Group group : perms.getAllGroups()) { + groupNames.add(group.getName()); + } + + return groupNames.toArray(new String[0]); } } diff --git a/src/net/milkbowl/vault/permission/plugins/Permission_PermissionsEx.java b/src/net/milkbowl/vault/permission/plugins/Permission_PermissionsEx.java index 5d76eec..41f5647 100644 --- a/src/net/milkbowl/vault/permission/plugins/Permission_PermissionsEx.java +++ b/src/net/milkbowl/vault/permission/plugins/Permission_PermissionsEx.java @@ -466,4 +466,16 @@ public class Permission_PermissionsEx extends Permission { return false; } } + + @Override + public String[] getGroups() { + PermissionGroup[] groups = PermissionsEx.getPermissionManager().getGroups(); + if (groups == null || groups.length == 0) + return null; + String[] groupNames = new String[groups.length]; + for (int i = 0; i < groups.length; i++) { + groupNames[i] = groups[i].getName(); + } + return groupNames; + } } \ No newline at end of file diff --git a/src/net/milkbowl/vault/permission/plugins/Permission_SuperPerms.java b/src/net/milkbowl/vault/permission/plugins/Permission_SuperPerms.java index cd4f461..5bf6876 100644 --- a/src/net/milkbowl/vault/permission/plugins/Permission_SuperPerms.java +++ b/src/net/milkbowl/vault/permission/plugins/Permission_SuperPerms.java @@ -242,4 +242,9 @@ public class Permission_SuperPerms extends Permission { public void setGroupSuffix(String world, String group, String suffix) { throw new UnsupportedOperationException(getName() + " no data permissions."); } + + @Override + public String[] getGroups() { + throw new UnsupportedOperationException(getName() + " does not support group listing!"); + } }