mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
This is better too.
This commit is contained in:
parent
a17d1d3a2f
commit
435522415d
@ -40,13 +40,12 @@ public class PartyInviteCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Party playerParty = mcMMOPlayer.getParty();
|
if (!PartyManager.canInvite(mcMMOPlayer)) {
|
||||||
|
|
||||||
if (!PartyManager.canInvite(playerName, playerParty)) {
|
|
||||||
player.sendMessage(LocaleLoader.getString("Party.Locked"));
|
player.sendMessage(LocaleLoader.getString("Party.Locked"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Party playerParty = mcMMOPlayer.getParty();
|
||||||
mcMMOTarget.setPartyInvite(playerParty);
|
mcMMOTarget.setPartyInvite(playerParty);
|
||||||
|
|
||||||
sender.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));
|
||||||
|
@ -378,8 +378,10 @@ public final class PartyManager {
|
|||||||
* @param party The party to check
|
* @param party The party to check
|
||||||
* @return true if the player can invite
|
* @return true if the player can invite
|
||||||
*/
|
*/
|
||||||
public static boolean canInvite(String playerName, Party party) {
|
public static boolean canInvite(McMMOPlayer mcMMOPlayer) {
|
||||||
return !party.isLocked() || party.getLeader().equalsIgnoreCase(playerName);
|
Party party = mcMMOPlayer.getParty();
|
||||||
|
|
||||||
|
return !party.isLocked() || party.getLeader().equalsIgnoreCase(mcMMOPlayer.getPlayer().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user