Browse Source

Some of VaultChat methods (deprecated and unsupported) were moved to separate intermediate class.

master
Stanislav Usenkov 10 years ago
parent
commit
fa64e7d34c
  1. 2
      src/main/java/ru/simsonic/rscPermissions/Bukkit/Commands/BukkitCommands.java
  2. 253
      src/main/java/ru/simsonic/rscPermissions/Bukkit/VaultChat.java
  3. 221
      src/main/java/ru/simsonic/rscPermissions/Bukkit/VaultDeprecatedChat.java
  4. 17
      src/main/java/ru/simsonic/rscPermissions/Bukkit/VaultPermission.java

2
src/main/java/ru/simsonic/rscPermissions/Bukkit/Commands/BukkitCommands.java

@ -276,7 +276,7 @@ public class BukkitCommands
};
if(args.length < 3)
throw new CommandAnswerException(help);
final Player player = rscp.getServer().getPlayerExact(args[1]);
final Player player = rscp.bridgeForBukkit.findPlayer(args[1]);
if(player == null)
throw new CommandAnswerException("Player should be online");
final ArrayList<String> list = new ArrayList<>();

253
src/main/java/ru/simsonic/rscPermissions/Bukkit/VaultChat.java

@ -1,12 +1,11 @@
package ru.simsonic.rscPermissions.Bukkit;
import java.util.Set;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.entity.Player;
import ru.simsonic.rscPermissions.BridgeForBukkitAPI;
import ru.simsonic.rscPermissions.BukkitPluginMain;
public final class VaultChat extends net.milkbowl.vault.chat.Chat
public final class VaultChat extends VaultDeprecatedChat
{
private final BridgeForBukkitAPI bridge;
private final BukkitPluginMain rscp;
@ -30,12 +29,6 @@ public final class VaultChat extends net.milkbowl.vault.chat.Chat
}
// ***** GET PLAYER PREFIX *****
@Override
public String getPlayerPrefix(String world, String player)
{
final Player online = bridge.findPlayer(player);
return online != null ? rscp.permissionManager.getPlayerPrefix(online) : null;
}
@Override
public String getPlayerPrefix(String world, OfflinePlayer player)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
@ -45,13 +38,14 @@ public final class VaultChat extends net.milkbowl.vault.chat.Chat
{
return rscp.permissionManager.getPlayerPrefix(player);
}
// ***** GET PLAYER SUFFIX *****
@Override
public String getPlayerSuffix(String world, String player)
@Deprecated
public String getPlayerPrefix(String world, String player)
{
final Player online = bridge.findPlayer(player);
return online != null ? rscp.permissionManager.getPlayerSuffix(online) : null;
return online != null ? rscp.permissionManager.getPlayerPrefix(online) : null;
}
// ***** GET PLAYER SUFFIX *****
@Override
public String getPlayerSuffix(String world, OfflinePlayer player)
{
@ -62,12 +56,14 @@ public final class VaultChat extends net.milkbowl.vault.chat.Chat
{
return rscp.permissionManager.getPlayerSuffix(player);
}
// ***** SET PLAYER PREFIX *****
@Override
public void setPlayerPrefix(String world, String player, String prefix)
@Deprecated
public String getPlayerSuffix(String world, String player)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
final Player online = bridge.findPlayer(player);
return online != null ? rscp.permissionManager.getPlayerSuffix(online) : null;
}
// ***** SET PLAYER PREFIX *****
@Override
public void setPlayerPrefix(String world, OfflinePlayer player, String prefix)
{
@ -78,12 +74,13 @@ public final class VaultChat extends net.milkbowl.vault.chat.Chat
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
// ***** SET PLAYER SUFFIX *****
@Override
public void setPlayerSuffix(String world, String player, String suffix)
@Deprecated
public void setPlayerPrefix(String world, String player, String prefix)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
// ***** SET PLAYER SUFFIX *****
@Override
public void setPlayerSuffix(String world, OfflinePlayer player, String suffix)
{
@ -94,6 +91,12 @@ public final class VaultChat extends net.milkbowl.vault.chat.Chat
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public void setPlayerSuffix(String world, String player, String suffix)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
// ***** GET GROUP PREFIX *****
@Override
public String getGroupPrefix(String world, String group)
@ -138,242 +141,40 @@ public final class VaultChat extends net.milkbowl.vault.chat.Chat
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
// ***********************************************************
// ***** DELEGATED TO PERMISSION *****
@Override
public boolean playerInGroup(String world, OfflinePlayer player, String group)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
return permissions.playerInGroup(world, player, group);
}
@Override
public boolean playerInGroup(Player player, String group)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
return permissions.playerInGroup(player, group);
}
@Override
public String[] getPlayerGroups(String world, OfflinePlayer player)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
return permissions.getPlayerGroups(world, player);
}
@Override
public String[] getPlayerGroups(Player player)
{
final Set<String> result = rscp.permissionManager.getPlayerGroups(player);
return result.toArray(new String[result.size()]);
return permissions.getPlayerGroups(player);
}
@Override
public String getPrimaryGroup(String world, OfflinePlayer player)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
return permissions.getPrimaryGroup(world, player);
}
@Override
public String getPrimaryGroup(Player player)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
return permissions.getPrimaryGroup(player);
}
@Override
public String[] getGroups()
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
// ***** THIS IS TRASH FOR ME :) *****
@Override
public int getPlayerInfoInteger(String world, String player, String node, int defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoInteger(String world, String player, String node, int value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public int getGroupInfoInteger(String world, String group, String node, int defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoInteger(String world, String group, String node, int value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public double getPlayerInfoDouble(String world, String player, String node, double defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoDouble(String world, String player, String node, double value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public double getGroupInfoDouble(String world, String group, String node, double defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoDouble(String world, String group, String node, double value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public boolean getPlayerInfoBoolean(String world, String player, String node, boolean defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoBoolean(String world, String player, String node, boolean value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public boolean getGroupInfoBoolean(String world, String group, String node, boolean defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoBoolean(String world, String group, String node, boolean value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public String getPlayerInfoString(String world, String player, String node, String defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoString(String world, String player, String node, String value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public String getGroupInfoString(String world, String group, String node, String defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoString(String world, String group, String node, String value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public int getPlayerInfoInteger(String world, OfflinePlayer player, String node, int defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public int getPlayerInfoInteger(Player player, String node, int defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoInteger(String world, OfflinePlayer player, String node, int value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoInteger(Player player, String node, int value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public int getGroupInfoInteger(World world, String group, String node, int defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoInteger(World world, String group, String node, int value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public double getPlayerInfoDouble(String world, OfflinePlayer player, String node, double defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public double getPlayerInfoDouble(Player player, String node, double defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoDouble(String world, OfflinePlayer player, String node, double value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoDouble(Player player, String node, double value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public double getGroupInfoDouble(World world, String group, String node, double defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoDouble(World world, String group, String node, double value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public boolean getPlayerInfoBoolean(String world, OfflinePlayer player, String node, boolean defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public boolean getPlayerInfoBoolean(Player player, String node, boolean defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoBoolean(String world, OfflinePlayer player, String node, boolean value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoBoolean(Player player, String node, boolean value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public boolean getGroupInfoBoolean(World world, String group, String node, boolean defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoBoolean(World world, String group, String node, boolean value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public String getPlayerInfoString(String world, OfflinePlayer player, String node, String defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public String getPlayerInfoString(Player player, String node, String defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoString(String world, OfflinePlayer player, String node, String value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoString(Player player, String node, String value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public String getGroupInfoString(World world, String group, String node, String defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoString(World world, String group, String node, String value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
return permissions.getGroups();
}
}

221
src/main/java/ru/simsonic/rscPermissions/Bukkit/VaultDeprecatedChat.java

@ -0,0 +1,221 @@
package ru.simsonic.rscPermissions.Bukkit;
import net.milkbowl.vault.permission.Permission;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.entity.Player;
public abstract class VaultDeprecatedChat extends net.milkbowl.vault.chat.Chat
{
public VaultDeprecatedChat(Permission permissions)
{
super(permissions);
}
@Override
@Deprecated
public int getPlayerInfoInteger(String world, String player, String node, int defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public void setPlayerInfoInteger(String world, String player, String node, int value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public int getGroupInfoInteger(String world, String group, String node, int defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoInteger(String world, String group, String node, int value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public double getPlayerInfoDouble(String world, String player, String node, double defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public void setPlayerInfoDouble(String world, String player, String node, double value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public double getGroupInfoDouble(String world, String group, String node, double defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoDouble(String world, String group, String node, double value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public boolean getPlayerInfoBoolean(String world, String player, String node, boolean defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public void setPlayerInfoBoolean(String world, String player, String node, boolean value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public boolean getGroupInfoBoolean(String world, String group, String node, boolean defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoBoolean(String world, String group, String node, boolean value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public String getPlayerInfoString(String world, String player, String node, String defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public void setPlayerInfoString(String world, String player, String node, String value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public String getGroupInfoString(String world, String group, String node, String defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoString(String world, String group, String node, String value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public int getPlayerInfoInteger(String world, OfflinePlayer player, String node, int defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public int getPlayerInfoInteger(Player player, String node, int defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoInteger(String world, OfflinePlayer player, String node, int value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoInteger(Player player, String node, int value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public int getGroupInfoInteger(World world, String group, String node, int defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoInteger(World world, String group, String node, int value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public double getPlayerInfoDouble(String world, OfflinePlayer player, String node, double defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public double getPlayerInfoDouble(Player player, String node, double defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoDouble(String world, OfflinePlayer player, String node, double value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoDouble(Player player, String node, double value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public double getGroupInfoDouble(World world, String group, String node, double defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoDouble(World world, String group, String node, double value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public boolean getPlayerInfoBoolean(String world, OfflinePlayer player, String node, boolean defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public boolean getPlayerInfoBoolean(Player player, String node, boolean defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoBoolean(String world, OfflinePlayer player, String node, boolean value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoBoolean(Player player, String node, boolean value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public boolean getGroupInfoBoolean(World world, String group, String node, boolean defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoBoolean(World world, String group, String node, boolean value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public String getPlayerInfoString(String world, OfflinePlayer player, String node, String defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public String getPlayerInfoString(Player player, String node, String defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoString(String world, OfflinePlayer player, String node, String value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setPlayerInfoString(Player player, String node, String value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public String getGroupInfoString(World world, String group, String node, String defaultValue)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
public void setGroupInfoString(World world, String group, String node, String value)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
}

17
src/main/java/ru/simsonic/rscPermissions/Bukkit/VaultPermission.java

@ -1,4 +1,5 @@
package ru.simsonic.rscPermissions.Bukkit;
import java.util.Set;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
@ -6,10 +7,10 @@ import org.bukkit.entity.Player;
import ru.simsonic.rscPermissions.BridgeForBukkitAPI;
import ru.simsonic.rscPermissions.BukkitPluginMain;
public class VaultPermission extends net.milkbowl.vault.permission.Permission
public final class VaultPermission extends net.milkbowl.vault.permission.Permission
{
private final BridgeForBukkitAPI bridge;
private final BukkitPluginMain rscp;
private final BukkitPluginMain rscp;
public VaultPermission(BridgeForBukkitAPI bridge)
{
this.bridge = bridge;
@ -31,16 +32,19 @@ public class VaultPermission extends net.milkbowl.vault.permission.Permission
return true;
}
@Override
@Deprecated
public boolean playerHas(String world, String player, String permission)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public boolean playerAdd(String world, String player, String permission)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public boolean playerRemove(String world, String player, String permission)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
@ -61,26 +65,31 @@ public class VaultPermission extends net.milkbowl.vault.permission.Permission
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public boolean playerInGroup(String world, String player, String group)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public boolean playerAddGroup(String world, String player, String group)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public boolean playerRemoveGroup(String world, String player, String group)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public String[] getPlayerGroups(String world, String player)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public String getPrimaryGroup(String world, String player)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
@ -161,6 +170,7 @@ public class VaultPermission extends net.milkbowl.vault.permission.Permission
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
}
@Override
@Deprecated
public boolean playerRemove(World world, String player, String permission)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
@ -233,7 +243,8 @@ public class VaultPermission extends net.milkbowl.vault.permission.Permission
@Override
public String[] getPlayerGroups(Player player)
{
throw new UnsupportedOperationException("This method is unsupported by rscPermissions.");
final Set<String> result = rscp.permissionManager.getPlayerGroups(player);
return result.toArray(new String[result.size()]);
}
@Override
public String getPrimaryGroup(String world, OfflinePlayer player)

Loading…
Cancel
Save