Remove the old Vault group management system. (THIS COMMIT BREAKS THE COMPILATION)

This commit is contained in:
Gabriele C 2015-11-21 20:16:07 +01:00
parent 579b7e7b97
commit 579c51f4a2
6 changed files with 7 additions and 42 deletions

View File

@ -70,9 +70,8 @@ public class AuthMe extends JavaPlugin {
/** Defines the current AuthMeReloaded version name. */
private static final String PLUGIN_VERSION_NAME = "5.1-SNAPSHOT";
/** Defines the current AuthMeReloaded version code. */
private static final int PLUGIN_VERSION_CODE = 100; // Increase this number
// by one when an update
// is released
// Increase this number by one when an update is released
private static final int PLUGIN_VERSION_CODE = 100;
private static AuthMe plugin;
private static Server server;
@ -96,7 +95,6 @@ public class AuthMe extends JavaPlugin {
public boolean delayedAntiBot = true;
// Hooks TODO: move into modules
public Permission vaultGroupManagement; // TODO: Remove this instance, and replace every usage with permissions manager!
public Essentials ess;
public MultiverseCore multiverse;
public CombatTagPlus combatTagPlus;
@ -278,9 +276,6 @@ public class AuthMe extends JavaPlugin {
mail = new SendMailSSL(this);
}
// Find Permissions
checkVault();
// Check Combat Tag Plus Version
checkCombatTagPlus();
@ -525,21 +520,6 @@ public class AuthMe extends JavaPlugin {
});
}
// Check the presence of the Vault plugin and a permissions provider
public void checkVault() {
if (server.getPluginManager().isPluginEnabled("Vault")) {
RegisteredServiceProvider<Permission> permissionProvider = server.getServicesManager().getRegistration(net.milkbowl.vault.permission.Permission.class);
if (permissionProvider != null) {
vaultGroupManagement = permissionProvider.getProvider();
ConsoleLogger.info("Vault detected, hooking with the " + vaultGroupManagement.getName() + " group management system...");
} else {
ConsoleLogger.showError("Vault detected, but I can't find any group management plugin to hook with!");
}
} else {
vaultGroupManagement = null;
}
}
// Get the Multiverse plugin
public void checkMultiverse() {
if (Settings.multiverse && server.getPluginManager().isPluginEnabled("Multiverse-Core")) {
@ -706,17 +686,13 @@ public class AuthMe extends JavaPlugin {
}
ConsoleLogger.info("AutoPurging the Database: " + cleared.size() + " accounts removed!");
if (Settings.purgeEssentialsFile && this.ess != null)
dataManager.purgeEssentials(cleared); // name to UUID convertion
// needed with latest versions
dataManager.purgeEssentials(cleared);
if (Settings.purgePlayerDat)
dataManager.purgeDat(cleared); // name to UUID convertion needed
// with latest versions of MC
dataManager.purgeDat(cleared);
if (Settings.purgeLimitedCreative)
dataManager.purgeLimitedCreative(cleared);
if (Settings.purgeAntiXray)
dataManager.purgeAntiXray(cleared); // IDK if it uses UUID or
// names... (Actually it purges
// only names!)
dataManager.purgeAntiXray(cleared);
if (Settings.purgePermissions)
dataManager.purgePermissions(cleared, vaultGroupManagement);
}

View File

@ -24,6 +24,7 @@ public class ForceLoginCommand extends ExecutableCommand {
// Command logic
try {
@SuppressWarnings("deprecation")
Player player = Bukkit.getPlayer(playerName);
if (player == null || !player.isOnline()) {
sender.sendMessage("Player needs to be online!");

View File

@ -22,6 +22,7 @@ public class GetIpCommand extends ExecutableCommand {
if(commandArguments.getCount() >= 1)
playerName = commandArguments.get(0);
@SuppressWarnings("deprecation")
Player player = Bukkit.getPlayer(playerName);
if (player == null) {
sender.sendMessage("This player is not actually online");

View File

@ -6,7 +6,6 @@ import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Messages;
/**
*/

View File

@ -90,10 +90,6 @@ public class AuthMeServerListener implements Listener {
plugin.combatTagPlus = null;
ConsoleLogger.info("CombatTagPlus has been disabled, unhook!");
}
if (pluginName.equalsIgnoreCase("Vault")) {
plugin.vaultGroupManagement = null;
ConsoleLogger.showError("Vault has been disabled, unhook permissions!");
}
if (pluginName.equalsIgnoreCase("ProtocolLib")) {
plugin.inventoryProtector = null;
ConsoleLogger.showError("ProtocolLib has been disabled, unhook packet inventory protection!");
@ -116,8 +112,6 @@ public class AuthMeServerListener implements Listener {
plugin.checkMultiverse();
if (pluginName.equalsIgnoreCase("CombatTagPlus"))
plugin.checkCombatTagPlus();
if (pluginName.equalsIgnoreCase("Vault"))
plugin.checkVault();
if (pluginName.equalsIgnoreCase("ProtocolLib")) {
plugin.checkProtocolLib();
}

View File

@ -560,7 +560,6 @@ public class PermissionsManager {
* @return True if succeed, false otherwise.
* False is also returned if this feature isn't supported for the current permissions system.
*/
@SuppressWarnings({"unchecked", "rawtypes", "deprecation"})
public boolean addGroup(Player player, String groupName) {
// If no permissions system is used, return false
if(!isEnabled())
@ -623,7 +622,6 @@ public class PermissionsManager {
* @return True if succeed, false otherwise.
* False is also returned if this feature isn't supported for the current permissions system.
*/
@SuppressWarnings({"unchecked", "rawtypes", "deprecation"})
public boolean addGroups(Player player, List<String> groupNames) {
// If no permissions system is used, return false
if(!isEnabled())
@ -648,7 +646,6 @@ public class PermissionsManager {
* @return True if succeed, false otherwise.
* False is also returned if this feature isn't supported for the current permissions system.
*/
@SuppressWarnings({"unchecked", "rawtypes", "deprecation"})
public boolean removeGroup(Player player, String groupName) {
// If no permissions system is used, return false
if(!isEnabled())
@ -711,7 +708,6 @@ public class PermissionsManager {
* @return True if succeed, false otherwise.
* False is also returned if this feature isn't supported for the current permissions system.
*/
@SuppressWarnings({"unchecked", "rawtypes", "deprecation"})
public boolean removeGroups(Player player, List<String> groupNames) {
// If no permissions system is used, return false
if(!isEnabled())
@ -737,7 +733,6 @@ public class PermissionsManager {
* @return True if succeed, false otherwise.
* False is also returned if this feature isn't supported for the current permissions system.
*/
@SuppressWarnings({"unchecked", "rawtypes", "deprecation"})
public boolean setGroup(Player player, String groupName) {
// If no permissions system is used, return false
if(!isEnabled())
@ -808,7 +803,6 @@ public class PermissionsManager {
* @return True if succeed, false otherwise.
* False is also returned if this feature isn't supported for the current permissions system.
*/
@SuppressWarnings({"unchecked", "rawtypes", "deprecation"})
public boolean setGroups(Player player, List<String> groupNames) {
// If no permissions system is used or if there's no group supplied, return false
if(!isEnabled() || groupNames.size() <= 0)