mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-19 07:07:55 +01:00
cleanup
This commit is contained in:
parent
cc8401e841
commit
28e742e42f
@ -1,30 +1,22 @@
|
||||
package fr.xephi.authme;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The AntiBot Service Management class.
|
||||
*/
|
||||
public class AntiBot {
|
||||
|
||||
public enum AntiBotStatus {
|
||||
ARMED,
|
||||
DISARMED,
|
||||
DELAYED,
|
||||
ACTIVATED
|
||||
}
|
||||
|
||||
private static AntiBotStatus antiBotStatus = AntiBotStatus.DISARMED;
|
||||
private static final AuthMe plugin = AuthMe.getInstance();
|
||||
private static final Messages messages = plugin.getMessages();
|
||||
private static final List<String> antibotPlayers = new ArrayList<>();
|
||||
private static AntiBotStatus antiBotStatus = AntiBotStatus.DISARMED;
|
||||
|
||||
public static void setupAntiBotService() {
|
||||
if (!Settings.enableAntiBot) {
|
||||
@ -38,11 +30,11 @@ public class AntiBot {
|
||||
}, 2400);
|
||||
}
|
||||
|
||||
public static void switchAntiBotStatus(boolean activated) {
|
||||
if(antiBotStatus == AntiBotStatus.DISARMED || antiBotStatus == AntiBotStatus.DELAYED) {
|
||||
public static void overrideAntiBotStatus(boolean activated) {
|
||||
if (antiBotStatus == AntiBotStatus.DISARMED || antiBotStatus == AntiBotStatus.DELAYED) {
|
||||
return;
|
||||
}
|
||||
if(activated) {
|
||||
if (activated) {
|
||||
antiBotStatus = AntiBotStatus.ACTIVATED;
|
||||
} else {
|
||||
antiBotStatus = AntiBotStatus.ARMED;
|
||||
@ -98,4 +90,11 @@ public class AntiBot {
|
||||
}, 300);
|
||||
}
|
||||
|
||||
public enum AntiBotStatus {
|
||||
ARMED,
|
||||
DISARMED,
|
||||
DELAYED,
|
||||
ACTIVATED
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,14 +33,14 @@ public class SwitchAntiBotCommand extends ExecutableCommand {
|
||||
|
||||
// Enable the mod
|
||||
if (newState.equalsIgnoreCase("ON")) {
|
||||
AntiBot.switchAntiBotStatus(true);
|
||||
AntiBot.overrideAntiBotStatus(true);
|
||||
sender.sendMessage("[AuthMe] AntiBot Manual Ovverride: enabled!");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Disable the mod
|
||||
if (newState.equalsIgnoreCase("OFF")) {
|
||||
AntiBot.switchAntiBotStatus(false);
|
||||
AntiBot.overrideAntiBotStatus(false);
|
||||
sender.sendMessage("[AuthMe] AntiBotMod Manual Ovverride: disabled!");
|
||||
return true;
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.datasource.DataSource.DataSourceType;
|
||||
import fr.xephi.authme.listener.AuthMeInventoryPacketAdapter;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user