mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-01 07:03:26 +01:00
Cleanup in Settings
Removed purge-related settings. Renamed all database-related settings and methods to replace `db` with `database`. Moved confirmationTime to `island.confirmation.time`. Renamed inviteWait, banWait and resetWait to inviteCooldown, banCooldown, resetCooldown. Also moved them under `island.cooldown.x`. Removed kickWait and leaveWait, using confirmationTime instead. Moved `island.require-confirmation.<command>` to `island.confirmation.commands.<command>`. Updated tests. Updated getters and setters using code automation. Sadly, this wiped out all the Javadoc.
This commit is contained in:
parent
4203ce85b4
commit
24d783be24
@ -49,17 +49,6 @@ public class Settings implements DataObject {
|
|||||||
@ConfigEntry(path = "general.starting-money")
|
@ConfigEntry(path = "general.starting-money")
|
||||||
private double startingMoney = 10.0;
|
private double startingMoney = 10.0;
|
||||||
|
|
||||||
// Purge
|
|
||||||
@ConfigComment("Only islands below this level will be removed if they are abandoned and admins issue the purge command")
|
|
||||||
@ConfigEntry(path = "general.purge.max-island-level")
|
|
||||||
private int purgeMaxIslandLevel = 50;
|
|
||||||
|
|
||||||
@ConfigComment("Remove user data when its island gets purged.")
|
|
||||||
@ConfigComment("Helps a lot to avoid huge backups and can save some performance on startup,")
|
|
||||||
@ConfigComment("but the player settings and data will be reset.")
|
|
||||||
@ConfigEntry(path = "general.purge.remove-user-data")
|
|
||||||
private boolean purgeRemoveUserData = false;
|
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
@ConfigComment("FLATFILE, MYSQL, MONGO")
|
@ConfigComment("FLATFILE, MYSQL, MONGO")
|
||||||
@ConfigComment("if you use MONGO, you must also run the BSBMongo plugin (not addon)")
|
@ConfigComment("if you use MONGO, you must also run the BSBMongo plugin (not addon)")
|
||||||
@ -68,20 +57,20 @@ public class Settings implements DataObject {
|
|||||||
private DatabaseType databaseType = DatabaseType.FLATFILE;
|
private DatabaseType databaseType = DatabaseType.FLATFILE;
|
||||||
|
|
||||||
@ConfigEntry(path = "general.database.host")
|
@ConfigEntry(path = "general.database.host")
|
||||||
private String dbHost = "localhost";
|
private String databaseHost = "localhost";
|
||||||
|
|
||||||
@ConfigComment("Port 3306 is MySQL's default. Port 27017 is MongoDB's default.")
|
@ConfigComment("Port 3306 is MySQL's default. Port 27017 is MongoDB's default.")
|
||||||
@ConfigEntry(path = "general.database.port")
|
@ConfigEntry(path = "general.database.port")
|
||||||
private int dbPort = 3306;
|
private int databasePort = 3306;
|
||||||
|
|
||||||
@ConfigEntry(path = "general.database.name")
|
@ConfigEntry(path = "general.database.name")
|
||||||
private String dbName = "bentobox";
|
private String databaseName = "bentobox";
|
||||||
|
|
||||||
@ConfigEntry(path = "general.database.username")
|
@ConfigEntry(path = "general.database.username")
|
||||||
private String dbUsername = "username";
|
private String databaseUsername = "username";
|
||||||
|
|
||||||
@ConfigEntry(path = "general.database.password")
|
@ConfigEntry(path = "general.database.password")
|
||||||
private String dbPassword = "password";
|
private String databasePassword = "password";
|
||||||
|
|
||||||
@ConfigComment("How often the data will be saved to file in mins. Default is 5 minutes.")
|
@ConfigComment("How often the data will be saved to file in mins. Default is 5 minutes.")
|
||||||
@ConfigComment("This helps prevent issues if the server crashes.")
|
@ConfigComment("This helps prevent issues if the server crashes.")
|
||||||
@ -101,10 +90,6 @@ public class Settings implements DataObject {
|
|||||||
@ConfigEntry(path = "general.allow-obsidian-scooping")
|
@ConfigEntry(path = "general.allow-obsidian-scooping")
|
||||||
private boolean allowObsidianScooping = true;
|
private boolean allowObsidianScooping = true;
|
||||||
|
|
||||||
@ConfigComment("Time in seconds that players have to confirm sensitive commands, e.g. island reset")
|
|
||||||
@ConfigEntry(path = "general.confirmation-time")
|
|
||||||
private int confirmationTime = 20;
|
|
||||||
|
|
||||||
@ConfigComment("Rank required to use a command. e.g., use the invite command. Default is owner rank is required.")
|
@ConfigComment("Rank required to use a command. e.g., use the invite command. Default is owner rank is required.")
|
||||||
@ConfigEntry(path = "general.rank-command")
|
@ConfigEntry(path = "general.rank-command")
|
||||||
private Map<String, Integer> rankCommand = new HashMap<>();
|
private Map<String, Integer> rankCommand = new HashMap<>();
|
||||||
@ -115,46 +100,44 @@ public class Settings implements DataObject {
|
|||||||
/*
|
/*
|
||||||
* Island
|
* Island
|
||||||
*/
|
*/
|
||||||
// Invites
|
// Cooldowns
|
||||||
@ConfigComment("How long a player must wait until they can rejoin a team island after being")
|
@ConfigComment("How long a player must wait until they can rejoin a team island after being")
|
||||||
@ConfigComment("kicked in minutes. This slows the effectiveness of players repeating challenges")
|
@ConfigComment("kicked in minutes. This slows the effectiveness of players repeating challenges")
|
||||||
@ConfigComment("by repetitively being invited to a team island.")
|
@ConfigComment("by repetitively being invited to a team island.")
|
||||||
@ConfigEntry(path = "island.invite-wait")
|
@ConfigEntry(path = "island.cooldown.invite")
|
||||||
private int inviteWait = 60;
|
private int inviteCooldown = 60;
|
||||||
|
|
||||||
|
@ConfigComment("How long a player must wait until they can ban a player")
|
||||||
|
@ConfigComment("after unbanning them. In minutes.")
|
||||||
|
@ConfigEntry(path = "island.cooldown.ban")
|
||||||
|
private int banCooldown = 10;
|
||||||
|
|
||||||
|
@ConfigComment("How long a player must wait before they can reset their island again in seconds.")
|
||||||
|
@ConfigEntry(path = "island.cooldown.reset")
|
||||||
|
private int resetCooldown = 300;
|
||||||
|
|
||||||
// Timeout for team kick and leave commands
|
// Timeout for team kick and leave commands
|
||||||
|
@ConfigComment("Time in seconds that players have to confirm sensitive commands, e.g. island reset")
|
||||||
|
@ConfigEntry(path = "island.confirmation.time")
|
||||||
|
private int confirmationTime = 10;
|
||||||
|
|
||||||
@ConfigComment("Ask the player to confirm the command he is using by typing it again.")
|
@ConfigComment("Ask the player to confirm the command he is using by typing it again.")
|
||||||
@ConfigComment("The 'wait' value is the number of seconds to wait for confirmation.")
|
@ConfigComment("The 'wait' value is the number of seconds to wait for confirmation.")
|
||||||
@ConfigEntry(path = "island.require-confirmation.kick")
|
@ConfigEntry(path = "island.confirmation.commands.kick")
|
||||||
private boolean kickConfirmation = true;
|
private boolean kickConfirmation = true;
|
||||||
|
|
||||||
@ConfigEntry(path = "island.require-confirmation.kick-wait")
|
@ConfigEntry(path = "island.confirmation.commands.leave")
|
||||||
private int kickWait = 10;
|
|
||||||
|
|
||||||
@ConfigEntry(path = "island.require-confirmation.leave")
|
|
||||||
private boolean leaveConfirmation = true;
|
private boolean leaveConfirmation = true;
|
||||||
|
|
||||||
@ConfigEntry(path = "island.require-confirmation.leave-wait")
|
@ConfigEntry(path = "island.confirmation.commands.reset")
|
||||||
private int leaveWait = 10;
|
|
||||||
|
|
||||||
@ConfigEntry(path = "island.require-confirmation.reset")
|
|
||||||
private boolean resetConfirmation = true;
|
private boolean resetConfirmation = true;
|
||||||
|
|
||||||
@ConfigComment("How long a player must wait before they can reset their island again in seconds")
|
|
||||||
@ConfigEntry(path = "island.reset-wait")
|
|
||||||
private int resetWait = 300;
|
|
||||||
|
|
||||||
@ConfigComment("These set the minimum and maximum size of a name.")
|
@ConfigComment("These set the minimum and maximum size of a name.")
|
||||||
@ConfigEntry(path = "island.name.min-length")
|
@ConfigEntry(path = "island.name.min-length")
|
||||||
private int nameMinLength = 4;
|
private int nameMinLength = 4;
|
||||||
@ConfigEntry(path = "island.name.max-length")
|
@ConfigEntry(path = "island.name.max-length")
|
||||||
private int nameMaxLength = 20;
|
private int nameMaxLength = 20;
|
||||||
|
|
||||||
@ConfigComment("How long a player must wait until they can ban a player")
|
|
||||||
@ConfigComment("after unbanning them. In minutes.")
|
|
||||||
@ConfigEntry(path = "island.ban-wait")
|
|
||||||
private int banWait = 10;
|
|
||||||
|
|
||||||
// Ranks
|
// Ranks
|
||||||
@ConfigEntry(path = "island.customranks")
|
@ConfigEntry(path = "island.customranks")
|
||||||
private Map<String, Integer> customRanks = new HashMap<>();
|
private Map<String, Integer> customRanks = new HashMap<>();
|
||||||
@ -163,123 +146,216 @@ public class Settings implements DataObject {
|
|||||||
@ConfigComment("These settings should not be edited")
|
@ConfigComment("These settings should not be edited")
|
||||||
private String uniqueId = "config";
|
private String uniqueId = "config";
|
||||||
|
|
||||||
/**
|
//---------------------------------------------------------------------------------------/
|
||||||
* @return the metrics
|
// Getters and setters
|
||||||
*/
|
|
||||||
|
|
||||||
public boolean isMetrics() {
|
public boolean isMetrics() {
|
||||||
return metrics;
|
return metrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setMetrics(boolean metrics) {
|
||||||
* @return the defaultLanguage
|
this.metrics = metrics;
|
||||||
*/
|
}
|
||||||
|
|
||||||
public String getDefaultLanguage() {
|
public String getDefaultLanguage() {
|
||||||
return defaultLanguage;
|
return defaultLanguage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setDefaultLanguage(String defaultLanguage) {
|
||||||
* @return the useEconomy
|
this.defaultLanguage = defaultLanguage;
|
||||||
*/
|
}
|
||||||
|
|
||||||
public boolean isUseEconomy() {
|
public boolean isUseEconomy() {
|
||||||
return useEconomy;
|
return useEconomy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setUseEconomy(boolean useEconomy) {
|
||||||
* @return the startingMoney
|
this.useEconomy = useEconomy;
|
||||||
*/
|
}
|
||||||
|
|
||||||
public double getStartingMoney() {
|
public double getStartingMoney() {
|
||||||
return startingMoney;
|
return startingMoney;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setStartingMoney(double startingMoney) {
|
||||||
* @return the purgeMaxIslandLevel
|
this.startingMoney = startingMoney;
|
||||||
*/
|
|
||||||
public int getPurgeMaxIslandLevel() {
|
|
||||||
return purgeMaxIslandLevel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the purgeRemoveUserData
|
|
||||||
*/
|
|
||||||
public boolean isPurgeRemoveUserData() {
|
|
||||||
return purgeRemoveUserData;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the databaseType
|
|
||||||
*/
|
|
||||||
public DatabaseType getDatabaseType() {
|
public DatabaseType getDatabaseType() {
|
||||||
return databaseType;
|
return databaseType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setDatabaseType(DatabaseType databaseType) {
|
||||||
* @return the dbHost
|
this.databaseType = databaseType;
|
||||||
*/
|
|
||||||
public String getDbHost() {
|
|
||||||
return dbHost;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public String getDatabaseHost() {
|
||||||
* @return the dbPort
|
return databaseHost;
|
||||||
*/
|
|
||||||
public int getDbPort() {
|
|
||||||
return dbPort;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setDatabaseHost(String databaseHost) {
|
||||||
* @return the dbName
|
this.databaseHost = databaseHost;
|
||||||
*/
|
|
||||||
public String getDbName() {
|
|
||||||
return dbName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public int getDatabasePort() {
|
||||||
* @return the dbUsername
|
return databasePort;
|
||||||
*/
|
|
||||||
public String getDbUsername() {
|
|
||||||
return dbUsername;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setDatabasePort(int databasePort) {
|
||||||
* @return the dbPassword
|
this.databasePort = databasePort;
|
||||||
*/
|
}
|
||||||
public String getDbPassword() {
|
|
||||||
return dbPassword;
|
public String getDatabaseName() {
|
||||||
|
return databaseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatabaseName(String databaseName) {
|
||||||
|
this.databaseName = databaseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDatabaseUsername() {
|
||||||
|
return databaseUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatabaseUsername(String databaseUsername) {
|
||||||
|
this.databaseUsername = databaseUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDatabasePassword() {
|
||||||
|
return databasePassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatabasePassword(String databasePassword) {
|
||||||
|
this.databasePassword = databasePassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the databaseBackupPeriod
|
|
||||||
*/
|
|
||||||
public int getDatabaseBackupPeriod() {
|
public int getDatabaseBackupPeriod() {
|
||||||
return databaseBackupPeriod;
|
return databaseBackupPeriod;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setDatabaseBackupPeriod(int databaseBackupPeriod) {
|
||||||
* @return the fakePlayers
|
this.databaseBackupPeriod = databaseBackupPeriod;
|
||||||
*/
|
}
|
||||||
|
|
||||||
public Set<String> getFakePlayers() {
|
public Set<String> getFakePlayers() {
|
||||||
return fakePlayers;
|
return fakePlayers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setFakePlayers(Set<String> fakePlayers) {
|
||||||
* @return the allowObsidianScooping
|
this.fakePlayers = fakePlayers;
|
||||||
*/
|
}
|
||||||
|
|
||||||
public boolean isAllowObsidianScooping() {
|
public boolean isAllowObsidianScooping() {
|
||||||
return allowObsidianScooping;
|
return allowObsidianScooping;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setAllowObsidianScooping(boolean allowObsidianScooping) {
|
||||||
* @return the confirmationTime
|
this.allowObsidianScooping = allowObsidianScooping;
|
||||||
*/
|
}
|
||||||
|
|
||||||
|
public Map<String, Integer> getRankCommand() {
|
||||||
|
return rankCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRankCommand(String command) {
|
||||||
|
return rankCommand.getOrDefault(command, RanksManager.OWNER_RANK);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRankCommand(String command, int rank) {
|
||||||
|
rankCommand.put(command, rank);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRankCommand(Map<String, Integer> rankCommand) {
|
||||||
|
this.rankCommand = rankCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isClosePanelOnClickOutside() {
|
||||||
|
return closePanelOnClickOutside;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClosePanelOnClickOutside(boolean closePanelOnClickOutside) {
|
||||||
|
this.closePanelOnClickOutside = closePanelOnClickOutside;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getInviteCooldown() {
|
||||||
|
return inviteCooldown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInviteCooldown(int inviteCooldown) {
|
||||||
|
this.inviteCooldown = inviteCooldown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBanCooldown() {
|
||||||
|
return banCooldown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBanCooldown(int banCooldown) {
|
||||||
|
this.banCooldown = banCooldown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getResetCooldown() {
|
||||||
|
return resetCooldown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResetCooldown(int resetCooldown) {
|
||||||
|
this.resetCooldown = resetCooldown;
|
||||||
|
}
|
||||||
|
|
||||||
public int getConfirmationTime() {
|
public int getConfirmationTime() {
|
||||||
return confirmationTime;
|
return confirmationTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setConfirmationTime(int confirmationTime) {
|
||||||
* @return the closePanelOnClickOutside
|
this.confirmationTime = confirmationTime;
|
||||||
*/
|
}
|
||||||
public boolean isClosePanelOnClickOutside() {
|
|
||||||
return closePanelOnClickOutside;
|
public boolean isKickConfirmation() {
|
||||||
|
return kickConfirmation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKickConfirmation(boolean kickConfirmation) {
|
||||||
|
this.kickConfirmation = kickConfirmation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isLeaveConfirmation() {
|
||||||
|
return leaveConfirmation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLeaveConfirmation(boolean leaveConfirmation) {
|
||||||
|
this.leaveConfirmation = leaveConfirmation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isResetConfirmation() {
|
||||||
|
return resetConfirmation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResetConfirmation(boolean resetConfirmation) {
|
||||||
|
this.resetConfirmation = resetConfirmation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNameMinLength() {
|
||||||
|
return nameMinLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNameMinLength(int nameMinLength) {
|
||||||
|
this.nameMinLength = nameMinLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNameMaxLength() {
|
||||||
|
return nameMaxLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNameMaxLength(int nameMaxLength) {
|
||||||
|
this.nameMaxLength = nameMaxLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Integer> getCustomRanks() {
|
||||||
|
return customRanks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomRanks(Map<String, Integer> customRanks) {
|
||||||
|
this.customRanks = customRanks;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -290,125 +366,6 @@ public class Settings implements DataObject {
|
|||||||
return uniqueId;
|
return uniqueId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param metrics the metrics to set
|
|
||||||
*/
|
|
||||||
public void setMetrics(boolean metrics) {
|
|
||||||
this.metrics = metrics;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param defaultLanguage the defaultLanguage to set
|
|
||||||
*/
|
|
||||||
public void setDefaultLanguage(String defaultLanguage) {
|
|
||||||
this.defaultLanguage = defaultLanguage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param useEconomy the useEconomy to set
|
|
||||||
*/
|
|
||||||
public void setUseEconomy(boolean useEconomy) {
|
|
||||||
this.useEconomy = useEconomy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param startingMoney the startingMoney to set
|
|
||||||
*/
|
|
||||||
public void setStartingMoney(double startingMoney) {
|
|
||||||
this.startingMoney = startingMoney;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param purgeMaxIslandLevel the purgeMaxIslandLevel to set
|
|
||||||
*/
|
|
||||||
public void setPurgeMaxIslandLevel(int purgeMaxIslandLevel) {
|
|
||||||
this.purgeMaxIslandLevel = purgeMaxIslandLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param purgeRemoveUserData the purgeRemoveUserData to set
|
|
||||||
*/
|
|
||||||
public void setPurgeRemoveUserData(boolean purgeRemoveUserData) {
|
|
||||||
this.purgeRemoveUserData = purgeRemoveUserData;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param databaseType the databaseType to set
|
|
||||||
*/
|
|
||||||
public void setDatabaseType(DatabaseType databaseType) {
|
|
||||||
this.databaseType = databaseType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param dbHost the dbHost to set
|
|
||||||
*/
|
|
||||||
public void setDbHost(String dbHost) {
|
|
||||||
this.dbHost = dbHost;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param dbPort the dbPort to set
|
|
||||||
*/
|
|
||||||
public void setDbPort(int dbPort) {
|
|
||||||
this.dbPort = dbPort;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param dbName the dbName to set
|
|
||||||
*/
|
|
||||||
public void setDbName(String dbName) {
|
|
||||||
this.dbName = dbName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param dbUsername the dbUsername to set
|
|
||||||
*/
|
|
||||||
public void setDbUsername(String dbUsername) {
|
|
||||||
this.dbUsername = dbUsername;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param dbPassword the dbPassword to set
|
|
||||||
*/
|
|
||||||
public void setDbPassword(String dbPassword) {
|
|
||||||
this.dbPassword = dbPassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param databaseBackupPeriod the databaseBackupPeriod to set
|
|
||||||
*/
|
|
||||||
public void setDatabaseBackupPeriod(int databaseBackupPeriod) {
|
|
||||||
this.databaseBackupPeriod = databaseBackupPeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param fakePlayers the fakePlayers to set
|
|
||||||
*/
|
|
||||||
public void setFakePlayers(Set<String> fakePlayers) {
|
|
||||||
this.fakePlayers = fakePlayers;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param allowObsidianScooping the allowObsidianScooping to set
|
|
||||||
*/
|
|
||||||
public void setAllowObsidianScooping(boolean allowObsidianScooping) {
|
|
||||||
this.allowObsidianScooping = allowObsidianScooping;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param confirmationTime the confirmationTime to set
|
|
||||||
*/
|
|
||||||
public void setConfirmationTime(int confirmationTime) {
|
|
||||||
this.confirmationTime = confirmationTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param closePanelOnClickOutside the closePanelOnClickOutside to set
|
|
||||||
*/
|
|
||||||
public void setClosePanelOnClickOutside(boolean closePanelOnClickOutside) {
|
|
||||||
this.closePanelOnClickOutside = closePanelOnClickOutside;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param uniqueId the uniqueId to set
|
* @param uniqueId the uniqueId to set
|
||||||
*/
|
*/
|
||||||
@ -417,182 +374,4 @@ public class Settings implements DataObject {
|
|||||||
this.uniqueId = uniqueId;
|
this.uniqueId = uniqueId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the customRanks
|
|
||||||
*/
|
|
||||||
public Map<String, Integer> getCustomRanks() {
|
|
||||||
return customRanks;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param customRanks the customRanks to set
|
|
||||||
*/
|
|
||||||
public void setCustomRanks(Map<String, Integer> customRanks) {
|
|
||||||
this.customRanks = customRanks;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the inviteWait
|
|
||||||
*/
|
|
||||||
public int getInviteWait() {
|
|
||||||
return inviteWait;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param inviteWait the inviteWait to set
|
|
||||||
*/
|
|
||||||
public void setInviteWait(int inviteWait) {
|
|
||||||
this.inviteWait = inviteWait;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the kickConfirmation
|
|
||||||
*/
|
|
||||||
public boolean isKickConfirmation() {
|
|
||||||
return kickConfirmation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the kickWait
|
|
||||||
*/
|
|
||||||
public int getKickWait() {
|
|
||||||
return kickWait;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the leaveConfirmation
|
|
||||||
*/
|
|
||||||
public boolean isLeaveConfirmation() {
|
|
||||||
return leaveConfirmation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the leaveWait
|
|
||||||
*/
|
|
||||||
public int getLeaveWait() {
|
|
||||||
return leaveWait;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param kickConfirmation the kickConfirmation to set
|
|
||||||
*/
|
|
||||||
public void setKickConfirmation(boolean kickConfirmation) {
|
|
||||||
this.kickConfirmation = kickConfirmation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param kickWait the kickWait to set
|
|
||||||
*/
|
|
||||||
public void setKickWait(int kickWait) {
|
|
||||||
this.kickWait = kickWait;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param leaveConfirmation the leaveConfirmation to set
|
|
||||||
*/
|
|
||||||
public void setLeaveConfirmation(boolean leaveConfirmation) {
|
|
||||||
this.leaveConfirmation = leaveConfirmation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param leaveWait the leaveWait to set
|
|
||||||
*/
|
|
||||||
public void setLeaveWait(int leaveWait) {
|
|
||||||
this.leaveWait = leaveWait;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the resetWait
|
|
||||||
*/
|
|
||||||
public int getResetWait() {
|
|
||||||
return resetWait;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param resetWait the resetWait to set
|
|
||||||
*/
|
|
||||||
public void setResetWait(int resetWait) {
|
|
||||||
this.resetWait = resetWait;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the resetConfirmation
|
|
||||||
*/
|
|
||||||
public boolean isResetConfirmation() {
|
|
||||||
return resetConfirmation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param resetConfirmation the resetConfirmation to set
|
|
||||||
*/
|
|
||||||
public void setResetConfirmation(boolean resetConfirmation) {
|
|
||||||
this.resetConfirmation = resetConfirmation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the nameMinLength
|
|
||||||
*/
|
|
||||||
public int getNameMinLength() {
|
|
||||||
return nameMinLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the nameMaxLength
|
|
||||||
*/
|
|
||||||
public int getNameMaxLength() {
|
|
||||||
return nameMaxLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param nameMinLength the nameMinLength to set
|
|
||||||
*/
|
|
||||||
public void setNameMinLength(int nameMinLength) {
|
|
||||||
this.nameMinLength = nameMinLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param nameMaxLength the nameMaxLength to set
|
|
||||||
*/
|
|
||||||
public void setNameMaxLength(int nameMaxLength) {
|
|
||||||
this.nameMaxLength = nameMaxLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the banWait
|
|
||||||
*/
|
|
||||||
public int getBanWait() {
|
|
||||||
return banWait;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param banWait the banWait to set
|
|
||||||
*/
|
|
||||||
public void setBanWait(int banWait) {
|
|
||||||
this.banWait = banWait;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRankCommand(String command) {
|
|
||||||
return rankCommand.getOrDefault(command, RanksManager.OWNER_RANK);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRankCommand(String command, int rank) {
|
|
||||||
rankCommand.put(command, rank);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the rankCommand
|
|
||||||
*/
|
|
||||||
public Map<String, Integer> getRankCommand() {
|
|
||||||
return rankCommand;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param rankCommand the rankCommand to set
|
|
||||||
*/
|
|
||||||
public void setRankCommand(Map<String, Integer> rankCommand) {
|
|
||||||
this.rankCommand = rankCommand;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -67,7 +67,7 @@ public class IslandBanCommand extends CompositeCommand {
|
|||||||
user.sendMessage("commands.island.ban.player-already-banned");
|
user.sendMessage("commands.island.ban.player-already-banned");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getSettings().getBanWait() > 0 && checkCooldown(user, targetUUID)) {
|
if (getSettings().getBanCooldown() > 0 && checkCooldown(user, targetUUID)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
User target = User.getInstance(targetUUID);
|
User target = User.getInstance(targetUUID);
|
||||||
|
@ -30,7 +30,7 @@ public class IslandResetCommand extends ConfirmableCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, String label, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// Check cooldown
|
// Check cooldown
|
||||||
if (getSettings().getResetWait() > 0 && checkCooldown(user, null)) {
|
if (getSettings().getResetCooldown() > 0 && checkCooldown(user, null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ public class IslandResetCommand extends ConfirmableCommand {
|
|||||||
user.sendMessage("commands.island.create.unable-create-island");
|
user.sendMessage("commands.island.create.unable-create-island");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setCooldown(user.getUniqueId(), null, getSettings().getResetWait());
|
setCooldown(user.getUniqueId(), null, getSettings().getResetCooldown());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,9 +69,9 @@ public class IslandUnbanCommand extends CompositeCommand {
|
|||||||
user.sendMessage("general.success");
|
user.sendMessage("general.success");
|
||||||
targetUser.sendMessage("commands.island.unban.you-are-unbanned", TextVariables.NAME, user.getName());
|
targetUser.sendMessage("commands.island.unban.you-are-unbanned", TextVariables.NAME, user.getName());
|
||||||
// Set cooldown
|
// Set cooldown
|
||||||
if (getSettings().getBanWait() > 0 && getParent() != null) {
|
if (getSettings().getBanCooldown() > 0 && getParent() != null) {
|
||||||
getParent().getSubCommand("ban").ifPresent(subCommand ->
|
getParent().getSubCommand("ban").ifPresent(subCommand ->
|
||||||
subCommand.setCooldown(user.getUniqueId(), targetUser.getUniqueId(), getSettings().getBanWait() * 60));
|
subCommand.setCooldown(user.getUniqueId(), targetUser.getUniqueId(), getSettings().getBanCooldown() * 60));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public class IslandTeamCoopCommand extends CompositeCommand {
|
|||||||
user.sendMessage("general.errors.unknown-player");
|
user.sendMessage("general.errors.unknown-player");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return (getSettings().getInviteWait() <= 0 || !checkCooldown(user, targetUUID)) && coopCmd(user, targetUUID);
|
return (getSettings().getInviteCooldown() <= 0 || !checkCooldown(user, targetUUID)) && coopCmd(user, targetUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean coopCmd(User user, UUID targetUUID) {
|
private boolean coopCmd(User user, UUID targetUUID) {
|
||||||
|
@ -76,7 +76,7 @@ public class IslandTeamInviteCommand extends CompositeCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Check cool down
|
// Check cool down
|
||||||
if (getSettings().getInviteWait() > 0 && checkCooldown(user, invitedPlayerUUID)) {
|
if (getSettings().getInviteCooldown() > 0 && checkCooldown(user, invitedPlayerUUID)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Player cannot invite someone already on a team
|
// Player cannot invite someone already on a team
|
||||||
|
@ -76,9 +76,9 @@ public class IslandTeamKickCommand extends ConfirmableCommand {
|
|||||||
user.sendMessage("general.success");
|
user.sendMessage("general.success");
|
||||||
|
|
||||||
// Add cooldown for this player and target
|
// Add cooldown for this player and target
|
||||||
if (getSettings().getInviteWait() > 0 && getParent() != null) {
|
if (getSettings().getInviteCooldown() > 0 && getParent() != null) {
|
||||||
// Get the invite class from the parent
|
// Get the invite class from the parent
|
||||||
getParent().getSubCommand("invite").ifPresent(c -> c.setCooldown(user.getUniqueId(), targetUUID, getSettings().getInviteWait() * 60));
|
getParent().getSubCommand("invite").ifPresent(c -> c.setCooldown(user.getUniqueId(), targetUUID, getSettings().getInviteCooldown() * 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -58,7 +58,7 @@ public class IslandTeamTrustCommand extends CompositeCommand {
|
|||||||
user.sendMessage("general.errors.unknown-player");
|
user.sendMessage("general.errors.unknown-player");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return (getSettings().getInviteWait() <= 0 || !checkCooldown(user, targetUUID)) && trustCmd(user, targetUUID);
|
return (getSettings().getInviteCooldown() <= 0 || !checkCooldown(user, targetUUID)) && trustCmd(user, targetUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean trustCmd(User user, UUID targetUUID) {
|
private boolean trustCmd(User user, UUID targetUUID) {
|
||||||
|
@ -84,9 +84,9 @@ public class IslandTeamUncoopCommand extends CompositeCommand {
|
|||||||
user.sendMessage("general.success");
|
user.sendMessage("general.success");
|
||||||
target.sendMessage("commands.island.team.uncoop.you-are-no-longer-a-coop-member", TextVariables.NAME, user.getName());
|
target.sendMessage("commands.island.team.uncoop.you-are-no-longer-a-coop-member", TextVariables.NAME, user.getName());
|
||||||
// Set cooldown
|
// Set cooldown
|
||||||
if (getSettings().getInviteWait() > 0 && getParent() != null) {
|
if (getSettings().getInviteCooldown() > 0 && getParent() != null) {
|
||||||
getParent().getSubCommand("coop").ifPresent(subCommand ->
|
getParent().getSubCommand("coop").ifPresent(subCommand ->
|
||||||
subCommand.setCooldown(user.getUniqueId(), targetUUID, getSettings().getInviteWait() * 60));
|
subCommand.setCooldown(user.getUniqueId(), targetUUID, getSettings().getInviteCooldown() * 60));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -84,9 +84,9 @@ public class IslandTeamUntrustCommand extends CompositeCommand {
|
|||||||
user.sendMessage("general.success");
|
user.sendMessage("general.success");
|
||||||
target.sendMessage("commands.island.team.untrust.you-are-no-longer-trusted", TextVariables.NAME, user.getName());
|
target.sendMessage("commands.island.team.untrust.you-are-no-longer-trusted", TextVariables.NAME, user.getName());
|
||||||
// Set cooldown
|
// Set cooldown
|
||||||
if (getSettings().getInviteWait() > 0 && getParent() != null) {
|
if (getSettings().getInviteCooldown() > 0 && getParent() != null) {
|
||||||
getParent().getSubCommand("trust").ifPresent(subCommand ->
|
getParent().getSubCommand("trust").ifPresent(subCommand ->
|
||||||
subCommand.setCooldown(user.getUniqueId(), targetUUID, getSettings().getInviteWait() * 60));
|
subCommand.setCooldown(user.getUniqueId(), targetUUID, getSettings().getInviteCooldown() * 60));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -18,11 +18,11 @@ public class MongoDBDatabase implements DatabaseSetup {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new MongoDBDatabaseHandler<>(plugin, type, new MongoDBDatabaseConnector(new DatabaseConnectionSettingsImpl(
|
return new MongoDBDatabaseHandler<>(plugin, type, new MongoDBDatabaseConnector(new DatabaseConnectionSettingsImpl(
|
||||||
plugin.getSettings().getDbHost(),
|
plugin.getSettings().getDatabaseHost(),
|
||||||
plugin.getSettings().getDbPort(),
|
plugin.getSettings().getDatabasePort(),
|
||||||
plugin.getSettings().getDbName(),
|
plugin.getSettings().getDatabaseName(),
|
||||||
plugin.getSettings().getDbUsername(),
|
plugin.getSettings().getDatabaseUsername(),
|
||||||
plugin.getSettings().getDbPassword()
|
plugin.getSettings().getDatabasePassword()
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,11 +15,11 @@ public class MySQLDatabase implements DatabaseSetup {
|
|||||||
public <T> AbstractDatabaseHandler<T> getHandler(Class<T> type) {
|
public <T> AbstractDatabaseHandler<T> getHandler(Class<T> type) {
|
||||||
BentoBox plugin = BentoBox.getInstance();
|
BentoBox plugin = BentoBox.getInstance();
|
||||||
return new MySQLDatabaseHandler<>(plugin, type, new MySQLDatabaseConnector(new DatabaseConnectionSettingsImpl(
|
return new MySQLDatabaseHandler<>(plugin, type, new MySQLDatabaseConnector(new DatabaseConnectionSettingsImpl(
|
||||||
plugin.getSettings().getDbHost(),
|
plugin.getSettings().getDatabaseHost(),
|
||||||
plugin.getSettings().getDbPort(),
|
plugin.getSettings().getDatabasePort(),
|
||||||
plugin.getSettings().getDbName(),
|
plugin.getSettings().getDatabaseName(),
|
||||||
plugin.getSettings().getDbUsername(),
|
plugin.getSettings().getDatabaseUsername(),
|
||||||
plugin.getSettings().getDbPassword()
|
plugin.getSettings().getDatabasePassword()
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public class AdminClearResetsAllCommandTest {
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
Settings s = mock(Settings.class);
|
Settings s = mock(Settings.class);
|
||||||
when(s.getResetWait()).thenReturn(0);
|
when(s.getResetCooldown()).thenReturn(0);
|
||||||
when(plugin.getSettings()).thenReturn(s);
|
when(plugin.getSettings()).thenReturn(s);
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
|
@ -67,7 +67,7 @@ public class AdminDeleteCommandTest {
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
Settings s = mock(Settings.class);
|
Settings s = mock(Settings.class);
|
||||||
when(s.getResetWait()).thenReturn(0);
|
when(s.getResetCooldown()).thenReturn(0);
|
||||||
when(plugin.getSettings()).thenReturn(s);
|
when(plugin.getSettings()).thenReturn(s);
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
|
@ -70,7 +70,7 @@ public class IslandResetCommandTest {
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
s = mock(Settings.class);
|
s = mock(Settings.class);
|
||||||
when(s.getResetWait()).thenReturn(0);
|
when(s.getResetCooldown()).thenReturn(0);
|
||||||
when(plugin.getSettings()).thenReturn(s);
|
when(plugin.getSettings()).thenReturn(s);
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
|
@ -209,7 +209,7 @@ public class IslandTeamCoopCommandTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testExecuteCoolDownActive() {
|
public void testExecuteCoolDownActive() {
|
||||||
// 10 minutes = 600 seconds
|
// 10 minutes = 600 seconds
|
||||||
when(s.getInviteWait()).thenReturn(10);
|
when(s.getInviteCooldown()).thenReturn(10);
|
||||||
IslandTeamCoopCommand itl = new IslandTeamCoopCommand(ic);
|
IslandTeamCoopCommand itl = new IslandTeamCoopCommand(ic);
|
||||||
String[] name = {"tastybento"};
|
String[] name = {"tastybento"};
|
||||||
itl.execute(user, itl.getLabel(), Arrays.asList(name));
|
itl.execute(user, itl.getLabel(), Arrays.asList(name));
|
||||||
|
@ -224,7 +224,7 @@ public class IslandTeamInviteCommandTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testExecuteCoolDownActive() {
|
public void testExecuteCoolDownActive() {
|
||||||
// 10 minutes = 600 seconds
|
// 10 minutes = 600 seconds
|
||||||
when(s.getInviteWait()).thenReturn(10);
|
when(s.getInviteCooldown()).thenReturn(10);
|
||||||
IslandTeamInviteCommand itl = new IslandTeamInviteCommand(ic);
|
IslandTeamInviteCommand itl = new IslandTeamInviteCommand(ic);
|
||||||
String[] name = {"tastybento"};
|
String[] name = {"tastybento"};
|
||||||
itl.execute(user, itl.getLabel(), Arrays.asList(name));
|
itl.execute(user, itl.getLabel(), Arrays.asList(name));
|
||||||
|
@ -275,7 +275,7 @@ public class IslandTeamKickCommandTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testCooldown() {
|
public void testCooldown() {
|
||||||
// 10 minutes = 600 seconds
|
// 10 minutes = 600 seconds
|
||||||
when(s.getInviteWait()).thenReturn(10);
|
when(s.getInviteCooldown()).thenReturn(10);
|
||||||
testExecuteNoConfirmation();
|
testExecuteNoConfirmation();
|
||||||
Mockito.verify(subCommand).setCooldown(uuid, notUUID, 600);
|
Mockito.verify(subCommand).setCooldown(uuid, notUUID, 600);
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public class IslandTeamLeaveCommandTest {
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
s = mock(Settings.class);
|
s = mock(Settings.class);
|
||||||
when(s.getResetWait()).thenReturn(0);
|
when(s.getResetCooldown()).thenReturn(0);
|
||||||
when(plugin.getSettings()).thenReturn(s);
|
when(plugin.getSettings()).thenReturn(s);
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
@ -149,7 +149,7 @@ public class IslandTeamLeaveCommandTest {
|
|||||||
public void testExecuteWithConfirmation() {
|
public void testExecuteWithConfirmation() {
|
||||||
when(s.isLeaveConfirmation()).thenReturn(true);
|
when(s.isLeaveConfirmation()).thenReturn(true);
|
||||||
// 3 second timeout
|
// 3 second timeout
|
||||||
when(s.getLeaveWait()).thenReturn(3);
|
when(s.getConfirmationTime()).thenReturn(3);
|
||||||
when(im.hasIsland(Mockito.any(), Mockito.eq(uuid))).thenReturn(false);
|
when(im.hasIsland(Mockito.any(), Mockito.eq(uuid))).thenReturn(false);
|
||||||
when(im.isOwner(Mockito.any(), Mockito.eq(uuid))).thenReturn(false);
|
when(im.isOwner(Mockito.any(), Mockito.eq(uuid))).thenReturn(false);
|
||||||
// Add a team leader - null
|
// Add a team leader - null
|
||||||
@ -158,7 +158,7 @@ public class IslandTeamLeaveCommandTest {
|
|||||||
IslandTeamLeaveCommand itl = new IslandTeamLeaveCommand(ic);
|
IslandTeamLeaveCommand itl = new IslandTeamLeaveCommand(ic);
|
||||||
assertFalse(itl.execute(user, itl.getLabel(), new ArrayList<>()));
|
assertFalse(itl.execute(user, itl.getLabel(), new ArrayList<>()));
|
||||||
// Confirmation required
|
// Confirmation required
|
||||||
Mockito.verify(user).sendMessage(Mockito.eq("commands.confirmation.confirm"), Mockito.eq("[seconds]"), Mockito.eq("0"));
|
Mockito.verify(user).sendMessage(Mockito.eq("commands.confirmation.confirm"), Mockito.eq("[seconds]"), Mockito.eq("3"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -209,7 +209,7 @@ public class IslandTeamTrustCommandTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testExecuteCoolDownActive() {
|
public void testExecuteCoolDownActive() {
|
||||||
// 10 minutes = 600 seconds
|
// 10 minutes = 600 seconds
|
||||||
when(s.getInviteWait()).thenReturn(10);
|
when(s.getInviteCooldown()).thenReturn(10);
|
||||||
IslandTeamTrustCommand itl = new IslandTeamTrustCommand(ic);
|
IslandTeamTrustCommand itl = new IslandTeamTrustCommand(ic);
|
||||||
String[] name = {"tastybento"};
|
String[] name = {"tastybento"};
|
||||||
itl.execute(user, itl.getLabel(), Arrays.asList(name));
|
itl.execute(user, itl.getLabel(), Arrays.asList(name));
|
||||||
|
@ -209,7 +209,7 @@ public class IslandTeamUncoopCommandTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testExecuteCoolDownActive() {
|
public void testExecuteCoolDownActive() {
|
||||||
// 10 minutes = 600 seconds
|
// 10 minutes = 600 seconds
|
||||||
when(s.getInviteWait()).thenReturn(10);
|
when(s.getInviteCooldown()).thenReturn(10);
|
||||||
IslandTeamUncoopCommand itl = new IslandTeamUncoopCommand(ic);
|
IslandTeamUncoopCommand itl = new IslandTeamUncoopCommand(ic);
|
||||||
String[] name = {"tastybento"};
|
String[] name = {"tastybento"};
|
||||||
itl.execute(user, itl.getLabel(), Arrays.asList(name));
|
itl.execute(user, itl.getLabel(), Arrays.asList(name));
|
||||||
|
@ -209,7 +209,7 @@ public class IslandTeamUntrustCommandTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testExecuteCoolDownActive() {
|
public void testExecuteCoolDownActive() {
|
||||||
// 10 minutes = 600 seconds
|
// 10 minutes = 600 seconds
|
||||||
when(s.getInviteWait()).thenReturn(10);
|
when(s.getInviteCooldown()).thenReturn(10);
|
||||||
IslandTeamUntrustCommand itl = new IslandTeamUntrustCommand(ic);
|
IslandTeamUntrustCommand itl = new IslandTeamUntrustCommand(ic);
|
||||||
String[] name = {"tastybento"};
|
String[] name = {"tastybento"};
|
||||||
itl.execute(user, itl.getLabel(), Arrays.asList(name));
|
itl.execute(user, itl.getLabel(), Arrays.asList(name));
|
||||||
|
Loading…
Reference in New Issue
Block a user