mirror of
https://github.com/MilkBowl/Vault.git
synced 2025-01-12 19:30:49 +01:00
Fixed formatting, and other stuff like licenses. I guess those changed out from under me.
This commit is contained in:
parent
eddd072f80
commit
05c5c36f47
Binary file not shown.
4
pom.xml
4
pom.xml
@ -407,10 +407,10 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
|
||||
<dependency>
|
||||
<groupId>com.overmc</groupId>
|
||||
<artifactId>overpermissions</artifactId>
|
||||
<version>1.0.5</version>
|
||||
<version>2.0.0</version>
|
||||
<optional>true</optional>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/overpermissions.jar</systemPath>
|
||||
<systemPath>${project.basedir}/lib/overpermissions-2.0.0.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -1,14 +1,31 @@
|
||||
/* This file is part of Vault.
|
||||
Vault is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
Vault is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with Vault. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package net.milkbowl.vault.chat.plugins;
|
||||
|
||||
import net.milkbowl.vault.chat.Chat;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
|
||||
import org.bukkit.event.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.server.PluginDisableEvent;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.overmc.overpermissions.api.*;
|
||||
import com.overmc.overpermissions.api.GroupManager;
|
||||
import com.overmc.overpermissions.api.PermissionGroup;
|
||||
import com.overmc.overpermissions.api.PermissionUser;
|
||||
import com.overmc.overpermissions.api.UserManager;
|
||||
import com.overmc.overpermissions.internal.OverPermissions;
|
||||
|
||||
public class Chat_OverPermissions extends Chat {
|
||||
@ -17,8 +34,7 @@ public class Chat_OverPermissions extends Chat {
|
||||
private UserManager userManager;
|
||||
private GroupManager groupManager;
|
||||
|
||||
public Chat_OverPermissions(Plugin plugin, Permission perms)
|
||||
{
|
||||
public Chat_OverPermissions(Plugin plugin, Permission perms) {
|
||||
super(perms);
|
||||
this.plugin = plugin;
|
||||
|
||||
@ -36,68 +52,57 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName( )
|
||||
{
|
||||
public String getName( ) {
|
||||
return "OverPermissions";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled( )
|
||||
{
|
||||
public boolean isEnabled( ) {
|
||||
return overPerms != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlayerPrefix(String world, String player)
|
||||
{
|
||||
public String getPlayerPrefix(String world, String player) {
|
||||
return getPlayerInfoString(world, player, "prefix", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerPrefix(String world, String player, String prefix)
|
||||
{
|
||||
public void setPlayerPrefix(String world, String player, String prefix) {
|
||||
setPlayerInfoString(world, player, "prefix", prefix);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlayerSuffix(String world, String player)
|
||||
{
|
||||
public String getPlayerSuffix(String world, String player) {
|
||||
return getPlayerInfoString(world, player, "suffix", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerSuffix(String world, String player, String suffix)
|
||||
{
|
||||
public void setPlayerSuffix(String world, String player, String suffix) {
|
||||
setPlayerInfoString(world, player, "suffix", suffix);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupPrefix(String world, String group)
|
||||
{
|
||||
public String getGroupPrefix(String world, String group) {
|
||||
return getGroupInfoString(world, group, "prefix", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroupPrefix(String world, String group, String prefix)
|
||||
{
|
||||
public void setGroupPrefix(String world, String group, String prefix) {
|
||||
setGroupInfoString(world, group, "prefix", prefix);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupSuffix(String world, String group)
|
||||
{
|
||||
public String getGroupSuffix(String world, String group) {
|
||||
return getGroupInfoString(world, group, "suffix", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroupSuffix(String world, String group, String suffix)
|
||||
{
|
||||
public void setGroupSuffix(String world, String group, String suffix) {
|
||||
setGroupInfoString(world, group, "prefix", suffix);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlayerInfoInteger(String world, String player, String node, int defaultValue)
|
||||
{
|
||||
public int getPlayerInfoInteger(String world, String player, String node, int defaultValue) {
|
||||
String s = getPlayerInfoString(world, player, node, null);
|
||||
if (s == null) {
|
||||
return defaultValue;
|
||||
@ -111,14 +116,12 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerInfoInteger(String world, String player, String node, int value)
|
||||
{
|
||||
public void setPlayerInfoInteger(String world, String player, String node, int value) {
|
||||
setPlayerInfoString(world, player, node, String.valueOf(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGroupInfoInteger(String world, String group, String node, int defaultValue)
|
||||
{
|
||||
public int getGroupInfoInteger(String world, String group, String node, int defaultValue) {
|
||||
String s = getGroupInfoString(world, group, node, null);
|
||||
if (s == null) {
|
||||
return defaultValue;
|
||||
@ -132,14 +135,12 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroupInfoInteger(String world, String group, String node, int value)
|
||||
{
|
||||
public void setGroupInfoInteger(String world, String group, String node, int value) {
|
||||
setGroupInfoString(world, group, node, String.valueOf(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerInfoDouble(String world, String player, String node, double defaultValue)
|
||||
{
|
||||
public double getPlayerInfoDouble(String world, String player, String node, double defaultValue) {
|
||||
String s = getPlayerInfoString(world, player, node, null);
|
||||
if (s == null) {
|
||||
return defaultValue;
|
||||
@ -153,14 +154,12 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerInfoDouble(String world, String player, String node, double value)
|
||||
{
|
||||
public void setPlayerInfoDouble(String world, String player, String node, double value) {
|
||||
setPlayerInfoString(world, player, node, String.valueOf(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getGroupInfoDouble(String world, String group, String node, double defaultValue)
|
||||
{
|
||||
public double getGroupInfoDouble(String world, String group, String node, double defaultValue) {
|
||||
String s = getGroupInfoString(world, group, node, null);
|
||||
if (s == null) {
|
||||
return defaultValue;
|
||||
@ -174,14 +173,12 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroupInfoDouble(String world, String group, String node, double value)
|
||||
{
|
||||
public void setGroupInfoDouble(String world, String group, String node, double value) {
|
||||
setGroupInfoString(world, group, node, String.valueOf(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getPlayerInfoBoolean(String world, String player, String node, boolean defaultValue)
|
||||
{
|
||||
public boolean getPlayerInfoBoolean(String world, String player, String node, boolean defaultValue) {
|
||||
String s = getPlayerInfoString(world, player, node, null);
|
||||
if (s == null) {
|
||||
return defaultValue;
|
||||
@ -191,14 +188,12 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerInfoBoolean(String world, String player, String node, boolean value)
|
||||
{
|
||||
public void setPlayerInfoBoolean(String world, String player, String node, boolean value) {
|
||||
setPlayerInfoString(world, player, node, String.valueOf(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getGroupInfoBoolean(String world, String group, String node, boolean defaultValue)
|
||||
{
|
||||
public boolean getGroupInfoBoolean(String world, String group, String node, boolean defaultValue) {
|
||||
String s = getGroupInfoString(world, group, node, null);
|
||||
if (s == null) {
|
||||
return defaultValue;
|
||||
@ -208,14 +203,12 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroupInfoBoolean(String world, String group, String node, boolean value)
|
||||
{
|
||||
public void setGroupInfoBoolean(String world, String group, String node, boolean value) {
|
||||
setGroupInfoString(world, group, node, String.valueOf(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlayerInfoString(String world, String playerName, String node, String defaultValue)
|
||||
{
|
||||
public String getPlayerInfoString(String world, String playerName, String node, String defaultValue) {
|
||||
if (!userManager.doesUserExist(playerName)) {
|
||||
return defaultValue;
|
||||
}
|
||||
@ -234,8 +227,7 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerInfoString(String world, String playerName, String node, String value)
|
||||
{
|
||||
public void setPlayerInfoString(String world, String playerName, String node, String value) {
|
||||
if (!userManager.canUserExist(playerName)) {
|
||||
return;
|
||||
}
|
||||
@ -256,8 +248,7 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupInfoString(String world, String groupName, String node, String defaultValue)
|
||||
{
|
||||
public String getGroupInfoString(String world, String groupName, String node, String defaultValue) {
|
||||
if (!groupManager.doesGroupExist(groupName)) {
|
||||
return defaultValue;
|
||||
}
|
||||
@ -276,8 +267,7 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroupInfoString(String world, String groupName, String node, String value)
|
||||
{
|
||||
public void setGroupInfoString(String world, String groupName, String node, String value) {
|
||||
if (!overPerms.getGroupManager().doesGroupExist(groupName)) {
|
||||
return;
|
||||
}
|
||||
@ -297,8 +287,7 @@ public class Chat_OverPermissions extends Chat {
|
||||
}
|
||||
}
|
||||
|
||||
public class PermissionServerListener implements Listener
|
||||
{
|
||||
public class PermissionServerListener implements Listener {
|
||||
Chat_OverPermissions chat = null;
|
||||
|
||||
public PermissionServerListener(Chat_OverPermissions chat) {
|
||||
|
@ -1,3 +1,15 @@
|
||||
/* This file is part of Vault.
|
||||
Vault is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
Vault is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with Vault. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package net.milkbowl.vault.permission.plugins;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -5,12 +17,17 @@ import java.util.ArrayList;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.server.PluginDisableEvent;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.overmc.overpermissions.api.*;
|
||||
import com.overmc.overpermissions.api.GroupManager;
|
||||
import com.overmc.overpermissions.api.PermissionGroup;
|
||||
import com.overmc.overpermissions.api.PermissionUser;
|
||||
import com.overmc.overpermissions.api.UserManager;
|
||||
import com.overmc.overpermissions.internal.OverPermissions;
|
||||
|
||||
public class Permission_OverPermissions extends Permission {
|
||||
@ -20,8 +37,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
private UserManager userManager;
|
||||
private GroupManager groupManager;
|
||||
|
||||
public Permission_OverPermissions(Plugin plugin)
|
||||
{
|
||||
public Permission_OverPermissions(Plugin plugin) {
|
||||
super.plugin = plugin;
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), plugin);
|
||||
|
||||
@ -37,20 +53,17 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName( )
|
||||
{
|
||||
public String getName( ) {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled( )
|
||||
{
|
||||
public boolean isEnabled( ) {
|
||||
return (overPerms != null) && (overPerms.isEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerHas(String worldName, String playerName, String permission)
|
||||
{
|
||||
public boolean playerHas(String worldName, String playerName, String permission) {
|
||||
if (!userManager.doesUserExist(playerName)) {
|
||||
return false;
|
||||
}
|
||||
@ -58,8 +71,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerAdd(String worldName, String playerName, String permission)
|
||||
{
|
||||
public boolean playerAdd(String worldName, String playerName, String permission) {
|
||||
if (!userManager.canUserExist(playerName)) {
|
||||
return false;
|
||||
}
|
||||
@ -67,8 +79,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerRemove(String worldName, String playerName, String permission)
|
||||
{
|
||||
public boolean playerRemove(String worldName, String playerName, String permission) {
|
||||
if (!userManager.canUserExist(playerName)) {
|
||||
return false;
|
||||
}
|
||||
@ -76,8 +87,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean groupHas(String worldName, String groupName, String permission)
|
||||
{
|
||||
public boolean groupHas(String worldName, String groupName, String permission) {
|
||||
if (!groupManager.doesGroupExist(groupName)) {
|
||||
return false;
|
||||
}
|
||||
@ -85,8 +95,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean groupAdd(String worldName, String groupName, String permission)
|
||||
{
|
||||
public boolean groupAdd(String worldName, String groupName, String permission) {
|
||||
if (!groupManager.doesGroupExist(groupName)) {
|
||||
return false;
|
||||
}
|
||||
@ -98,8 +107,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean groupRemove(String worldName, String groupName, String permission)
|
||||
{
|
||||
public boolean groupRemove(String worldName, String groupName, String permission) {
|
||||
if (!groupManager.doesGroupExist(groupName)) {
|
||||
return false;
|
||||
}
|
||||
@ -111,8 +119,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerInGroup(String worldName, String playerName, String groupName)
|
||||
{
|
||||
public boolean playerInGroup(String worldName, String playerName, String groupName) {
|
||||
if (!groupManager.doesGroupExist(groupName)) {
|
||||
return false;
|
||||
}
|
||||
@ -123,8 +130,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerAddGroup(String worldName, String playerName, String groupName)
|
||||
{
|
||||
public boolean playerAddGroup(String worldName, String playerName, String groupName) {
|
||||
if (!groupManager.doesGroupExist(groupName)) {
|
||||
return false;
|
||||
}
|
||||
@ -135,8 +141,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerRemoveGroup(String worldName, String playerName, String groupName)
|
||||
{
|
||||
public boolean playerRemoveGroup(String worldName, String playerName, String groupName) {
|
||||
if (!groupManager.doesGroupExist(groupName)) {
|
||||
return false;
|
||||
}
|
||||
@ -147,8 +152,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getPlayerGroups(String worldName, String playerName)
|
||||
{
|
||||
public String[] getPlayerGroups(String worldName, String playerName) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
if (!userManager.doesUserExist(playerName)) {
|
||||
return new String[0];
|
||||
@ -161,8 +165,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrimaryGroup(String worldName, String playerName)
|
||||
{
|
||||
public String getPrimaryGroup(String worldName, String playerName) {
|
||||
String[] playerGroups = getPlayerGroups(worldName, playerName);
|
||||
if (playerGroups.length == 0) {
|
||||
return null;
|
||||
@ -171,8 +174,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerAddTransient(String world, String playerName, String permission)
|
||||
{
|
||||
public boolean playerAddTransient(String world, String playerName, String permission) {
|
||||
if (!userManager.doesUserExist(playerName)) { // Can't add transient permissions to an offline player.
|
||||
return false;
|
||||
}
|
||||
@ -181,8 +183,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerRemoveTransient(String world, String playerName, String permission)
|
||||
{
|
||||
public boolean playerRemoveTransient(String world, String playerName, String permission) {
|
||||
if (!userManager.doesUserExist(playerName)) {
|
||||
return false;
|
||||
}
|
||||
@ -191,8 +192,7 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getGroups( )
|
||||
{
|
||||
public String[] getGroups( ) {
|
||||
ArrayList<String> groupNames = new ArrayList<String>();
|
||||
for (PermissionGroup s : groupManager.getGroups()) {
|
||||
groupNames.add(s.getName());
|
||||
@ -201,20 +201,17 @@ public class Permission_OverPermissions extends Permission {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSuperPermsCompat( )
|
||||
{
|
||||
public boolean hasSuperPermsCompat( ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGroupSupport( )
|
||||
{
|
||||
public boolean hasGroupSupport( ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public class PermissionServerListener
|
||||
implements Listener
|
||||
{
|
||||
implements Listener {
|
||||
Permission_OverPermissions permission = null;
|
||||
|
||||
public PermissionServerListener(Permission_OverPermissions permission) {
|
||||
|
Loading…
Reference in New Issue
Block a user