Party system can now be disabled via config

Closes #4873
This commit is contained in:
nossr50
2024-02-19 17:55:57 -08:00
parent c358c8ce0b
commit 3361d28887
34 changed files with 478 additions and 433 deletions

View File

@@ -3,6 +3,7 @@ package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
@@ -51,25 +52,25 @@ public class PartyJoinCommand implements CommandExecutor {
String password = getPassword(args);
// Make sure party passwords match
if (!PartyManager.checkPartyPassword(player, targetParty, password)) {
if (!mcMMO.p.getPartyManager().checkPartyPassword(player, targetParty, password)) {
return true;
}
String partyName = targetParty.getName();
// Changing parties
if (!PartyManager.changeOrJoinParty(mcMMOPlayer, partyName)) {
if (!mcMMO.p.getPartyManager().changeOrJoinParty(mcMMOPlayer, partyName)) {
return true;
}
if(PartyManager.isPartyFull(player, targetParty))
if(mcMMO.p.getPartyManager().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);
mcMMO.p.getPartyManager().addToParty(mcMMOPlayer, targetParty);
return true;
default: