Fixed MaxMembers upgrade

This commit is contained in:
Fabrizio La Rosa 2020-07-10 07:34:32 +02:00
parent f3ad27c9e7
commit 9dcfe25d06
3 changed files with 3 additions and 5 deletions

View File

@ -99,8 +99,7 @@ public class AcceptCommand extends SubCommand {
island.save(); island.save();
if ((island.getRole(IslandRole.Member).size() + island.getRole(IslandRole.Operator).size() if ((island.getRole(IslandRole.Member).size() + island.getRole(IslandRole.Operator).size()
+ 1) >= fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")) + 1) >= island.getMaxMembers()) {
.getFileConfiguration().getInt("Island.Member.Capacity")) {
Map<UUID, Invite> invites = inviteManager.getInvites(); Map<UUID, Invite> invites = inviteManager.getInvites();
for (UUID inviteList : invites.keySet()) { for (UUID inviteList : invites.keySet()) {

View File

@ -50,7 +50,7 @@ public class InviteCommand extends SubCommand {
Config mainConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")); Config mainConfig = fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml"));
if ((island.getRole(IslandRole.Member).size() + island.getRole(IslandRole.Operator).size() if ((island.getRole(IslandRole.Member).size() + island.getRole(IslandRole.Operator).size()
+ 1) >= mainConfig.getFileConfiguration().getInt("Island.Member.Capacity")) { + 1) >= island.getMaxMembers()) {
messageManager.sendMessage(player, configLoad.getString("Command.Island.Invite.Capacity.Message")); messageManager.sendMessage(player, configLoad.getString("Command.Island.Invite.Capacity.Message"));
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1.0F, 1.0F); soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1.0F, 1.0F);
} else { } else {

View File

@ -333,8 +333,7 @@ public class Members {
new Placeholder("%island_members", new Placeholder("%island_members",
"" + (islandMembers.size() + islandOperators.size() + 1)), "" + (islandMembers.size() + islandOperators.size() + 1)),
new Placeholder("%island_capacity", new Placeholder("%island_capacity",
"" + fileManager.getConfig(new File(plugin.getDataFolder(), "config.yml")) "" + island.getMaxMembers()),
.getFileConfiguration().getInt("Island.Member.Capacity")),
new Placeholder("%members", "" + islandMembers.size()), new Placeholder("%members", "" + islandMembers.size()),
new Placeholder("%operators", "" + islandOperators.size())}, new Placeholder("%operators", "" + islandOperators.size())},
null, null), 4); null, null), 4);