Parties can now have max size limits (configurable), by default party sizes are unlimited.

This commit is contained in:
nossr50
2019-01-11 06:17:07 -08:00
parent c7a49dd283
commit 19c38f0cb1
10 changed files with 78 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.config.Config;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@ -45,6 +46,13 @@ public class PartyInviteCommand implements CommandExecutor {
}
Party playerParty = mcMMOPlayer.getParty();
if(PartyManager.isPartyFull(target, playerParty))
{
player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull.Invite", target.getName(), playerParty.toString(), Config.getInstance().getPartyMaxSize()));
return true;
}
mcMMOTarget.setPartyInvite(playerParty);
sender.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.config.Config;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@ -55,6 +56,12 @@ public class PartyJoinCommand implements CommandExecutor {
return true;
}
if(PartyManager.isPartyFull(player, targetParty))
{
player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull", targetParty.toString()));
return true;
}
player.sendMessage(LocaleLoader.getString("Commands.Party.Join", partyName));
PartyManager.addToParty(mcMMOPlayer, targetParty);
return true;