mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-25 01:57:48 +01:00
Remove the old Vault group management system. (THIS COMMIT BREAKS THE COMPILATION)
This commit is contained in:
parent
579b7e7b97
commit
579c51f4a2
@ -70,9 +70,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
/** Defines the current AuthMeReloaded version name. */
|
/** Defines the current AuthMeReloaded version name. */
|
||||||
private static final String PLUGIN_VERSION_NAME = "5.1-SNAPSHOT";
|
private static final String PLUGIN_VERSION_NAME = "5.1-SNAPSHOT";
|
||||||
/** Defines the current AuthMeReloaded version code. */
|
/** Defines the current AuthMeReloaded version code. */
|
||||||
private static final int PLUGIN_VERSION_CODE = 100; // Increase this number
|
// Increase this number by one when an update is released
|
||||||
// by one when an update
|
private static final int PLUGIN_VERSION_CODE = 100;
|
||||||
// is released
|
|
||||||
|
|
||||||
private static AuthMe plugin;
|
private static AuthMe plugin;
|
||||||
private static Server server;
|
private static Server server;
|
||||||
@ -96,7 +95,6 @@ public class AuthMe extends JavaPlugin {
|
|||||||
public boolean delayedAntiBot = true;
|
public boolean delayedAntiBot = true;
|
||||||
|
|
||||||
// Hooks TODO: move into modules
|
// Hooks TODO: move into modules
|
||||||
public Permission vaultGroupManagement; // TODO: Remove this instance, and replace every usage with permissions manager!
|
|
||||||
public Essentials ess;
|
public Essentials ess;
|
||||||
public MultiverseCore multiverse;
|
public MultiverseCore multiverse;
|
||||||
public CombatTagPlus combatTagPlus;
|
public CombatTagPlus combatTagPlus;
|
||||||
@ -278,9 +276,6 @@ public class AuthMe extends JavaPlugin {
|
|||||||
mail = new SendMailSSL(this);
|
mail = new SendMailSSL(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find Permissions
|
|
||||||
checkVault();
|
|
||||||
|
|
||||||
// Check Combat Tag Plus Version
|
// Check Combat Tag Plus Version
|
||||||
checkCombatTagPlus();
|
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
|
// Get the Multiverse plugin
|
||||||
public void checkMultiverse() {
|
public void checkMultiverse() {
|
||||||
if (Settings.multiverse && server.getPluginManager().isPluginEnabled("Multiverse-Core")) {
|
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!");
|
ConsoleLogger.info("AutoPurging the Database: " + cleared.size() + " accounts removed!");
|
||||||
if (Settings.purgeEssentialsFile && this.ess != null)
|
if (Settings.purgeEssentialsFile && this.ess != null)
|
||||||
dataManager.purgeEssentials(cleared); // name to UUID convertion
|
dataManager.purgeEssentials(cleared);
|
||||||
// needed with latest versions
|
|
||||||
if (Settings.purgePlayerDat)
|
if (Settings.purgePlayerDat)
|
||||||
dataManager.purgeDat(cleared); // name to UUID convertion needed
|
dataManager.purgeDat(cleared);
|
||||||
// with latest versions of MC
|
|
||||||
if (Settings.purgeLimitedCreative)
|
if (Settings.purgeLimitedCreative)
|
||||||
dataManager.purgeLimitedCreative(cleared);
|
dataManager.purgeLimitedCreative(cleared);
|
||||||
if (Settings.purgeAntiXray)
|
if (Settings.purgeAntiXray)
|
||||||
dataManager.purgeAntiXray(cleared); // IDK if it uses UUID or
|
dataManager.purgeAntiXray(cleared);
|
||||||
// names... (Actually it purges
|
|
||||||
// only names!)
|
|
||||||
if (Settings.purgePermissions)
|
if (Settings.purgePermissions)
|
||||||
dataManager.purgePermissions(cleared, vaultGroupManagement);
|
dataManager.purgePermissions(cleared, vaultGroupManagement);
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ public class ForceLoginCommand extends ExecutableCommand {
|
|||||||
|
|
||||||
// Command logic
|
// Command logic
|
||||||
try {
|
try {
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
Player player = Bukkit.getPlayer(playerName);
|
Player player = Bukkit.getPlayer(playerName);
|
||||||
if (player == null || !player.isOnline()) {
|
if (player == null || !player.isOnline()) {
|
||||||
sender.sendMessage("Player needs to be online!");
|
sender.sendMessage("Player needs to be online!");
|
||||||
|
@ -22,6 +22,7 @@ public class GetIpCommand extends ExecutableCommand {
|
|||||||
if(commandArguments.getCount() >= 1)
|
if(commandArguments.getCount() >= 1)
|
||||||
playerName = commandArguments.get(0);
|
playerName = commandArguments.get(0);
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
Player player = Bukkit.getPlayer(playerName);
|
Player player = Bukkit.getPlayer(playerName);
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
sender.sendMessage("This player is not actually online");
|
sender.sendMessage("This player is not actually online");
|
||||||
|
@ -6,7 +6,6 @@ import org.bukkit.entity.Player;
|
|||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.command.CommandParts;
|
import fr.xephi.authme.command.CommandParts;
|
||||||
import fr.xephi.authme.command.ExecutableCommand;
|
import fr.xephi.authme.command.ExecutableCommand;
|
||||||
import fr.xephi.authme.settings.Messages;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
@ -90,10 +90,6 @@ public class AuthMeServerListener implements Listener {
|
|||||||
plugin.combatTagPlus = null;
|
plugin.combatTagPlus = null;
|
||||||
ConsoleLogger.info("CombatTagPlus has been disabled, unhook!");
|
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")) {
|
if (pluginName.equalsIgnoreCase("ProtocolLib")) {
|
||||||
plugin.inventoryProtector = null;
|
plugin.inventoryProtector = null;
|
||||||
ConsoleLogger.showError("ProtocolLib has been disabled, unhook packet inventory protection!");
|
ConsoleLogger.showError("ProtocolLib has been disabled, unhook packet inventory protection!");
|
||||||
@ -116,8 +112,6 @@ public class AuthMeServerListener implements Listener {
|
|||||||
plugin.checkMultiverse();
|
plugin.checkMultiverse();
|
||||||
if (pluginName.equalsIgnoreCase("CombatTagPlus"))
|
if (pluginName.equalsIgnoreCase("CombatTagPlus"))
|
||||||
plugin.checkCombatTagPlus();
|
plugin.checkCombatTagPlus();
|
||||||
if (pluginName.equalsIgnoreCase("Vault"))
|
|
||||||
plugin.checkVault();
|
|
||||||
if (pluginName.equalsIgnoreCase("ProtocolLib")) {
|
if (pluginName.equalsIgnoreCase("ProtocolLib")) {
|
||||||
plugin.checkProtocolLib();
|
plugin.checkProtocolLib();
|
||||||
}
|
}
|
||||||
|
@ -560,7 +560,6 @@ public class PermissionsManager {
|
|||||||
* @return True if succeed, false otherwise.
|
* @return True if succeed, false otherwise.
|
||||||
* False is also returned if this feature isn't supported for the current permissions system.
|
* 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) {
|
public boolean addGroup(Player player, String groupName) {
|
||||||
// If no permissions system is used, return false
|
// If no permissions system is used, return false
|
||||||
if(!isEnabled())
|
if(!isEnabled())
|
||||||
@ -623,7 +622,6 @@ public class PermissionsManager {
|
|||||||
* @return True if succeed, false otherwise.
|
* @return True if succeed, false otherwise.
|
||||||
* False is also returned if this feature isn't supported for the current permissions system.
|
* 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) {
|
public boolean addGroups(Player player, List<String> groupNames) {
|
||||||
// If no permissions system is used, return false
|
// If no permissions system is used, return false
|
||||||
if(!isEnabled())
|
if(!isEnabled())
|
||||||
@ -648,7 +646,6 @@ public class PermissionsManager {
|
|||||||
* @return True if succeed, false otherwise.
|
* @return True if succeed, false otherwise.
|
||||||
* False is also returned if this feature isn't supported for the current permissions system.
|
* 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) {
|
public boolean removeGroup(Player player, String groupName) {
|
||||||
// If no permissions system is used, return false
|
// If no permissions system is used, return false
|
||||||
if(!isEnabled())
|
if(!isEnabled())
|
||||||
@ -711,7 +708,6 @@ public class PermissionsManager {
|
|||||||
* @return True if succeed, false otherwise.
|
* @return True if succeed, false otherwise.
|
||||||
* False is also returned if this feature isn't supported for the current permissions system.
|
* 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) {
|
public boolean removeGroups(Player player, List<String> groupNames) {
|
||||||
// If no permissions system is used, return false
|
// If no permissions system is used, return false
|
||||||
if(!isEnabled())
|
if(!isEnabled())
|
||||||
@ -737,7 +733,6 @@ public class PermissionsManager {
|
|||||||
* @return True if succeed, false otherwise.
|
* @return True if succeed, false otherwise.
|
||||||
* False is also returned if this feature isn't supported for the current permissions system.
|
* 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) {
|
public boolean setGroup(Player player, String groupName) {
|
||||||
// If no permissions system is used, return false
|
// If no permissions system is used, return false
|
||||||
if(!isEnabled())
|
if(!isEnabled())
|
||||||
@ -808,7 +803,6 @@ public class PermissionsManager {
|
|||||||
* @return True if succeed, false otherwise.
|
* @return True if succeed, false otherwise.
|
||||||
* False is also returned if this feature isn't supported for the current permissions system.
|
* 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) {
|
public boolean setGroups(Player player, List<String> groupNames) {
|
||||||
// If no permissions system is used or if there's no group supplied, return false
|
// If no permissions system is used or if there's no group supplied, return false
|
||||||
if(!isEnabled() || groupNames.size() <= 0)
|
if(!isEnabled() || groupNames.size() <= 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user