mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Changed names to refer to partyInvite for the sake of clarity.
This commit is contained in:
parent
79b96c380d
commit
9de6b4724a
@ -171,11 +171,11 @@ public class McMMOPlayer {
|
||||
|
||||
// Party Stuff
|
||||
|
||||
public void setInvite(Party invite) {
|
||||
public void setPartyInvite(Party invite) {
|
||||
this.invite = invite;
|
||||
}
|
||||
|
||||
public Party getInvite() {
|
||||
public Party getPartyInvite() {
|
||||
return invite;
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ public class McMMOPlayer {
|
||||
party = null;
|
||||
}
|
||||
|
||||
public void removeInvite() {
|
||||
public void removePartyInvite() {
|
||||
invite = null;
|
||||
}
|
||||
|
||||
|
@ -339,14 +339,14 @@ public final class PartyManager {
|
||||
* @param mcMMOPlayer The player to add to the party
|
||||
*/
|
||||
public static void joinInvitedParty(Player player, McMMOPlayer mcMMOPlayer) {
|
||||
Party invite = mcMMOPlayer.getInvite();
|
||||
Party invite = mcMMOPlayer.getPartyInvite();
|
||||
|
||||
if (!parties.contains(invite)) {
|
||||
parties.add(invite);
|
||||
}
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Invite.Accepted", invite.getName()));
|
||||
mcMMOPlayer.removeInvite();
|
||||
mcMMOPlayer.removePartyInvite();
|
||||
addToParty(player.getName(), mcMMOPlayer, invite);
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ public class PartyCommand implements CommandExecutor {
|
||||
private Player player;
|
||||
|
||||
private CommandExecutor partyJoinCommand = new PartyJoinCommand();
|
||||
private CommandExecutor partyAcceptCommand = new PartyAcceptCommand();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
@ -179,7 +180,7 @@ public class PartyCommand implements CommandExecutor {
|
||||
if (mcMMOPlayer.hasPartyInvite()) {
|
||||
if (mcMMOPlayer.inParty()) {
|
||||
Party party = mcMMOPlayer.getParty();
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, party.getName(), mcMMOPlayer.getInvite().getName(), EventReason.CHANGED_PARTIES);
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, party.getName(), mcMMOPlayer.getPartyInvite().getName(), EventReason.CHANGED_PARTIES);
|
||||
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
@ -190,7 +191,7 @@ public class PartyCommand implements CommandExecutor {
|
||||
PartyManager.removeFromParty(player.getName(), party);
|
||||
}
|
||||
else {
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, null, mcMMOPlayer.getInvite().getName(), EventReason.JOINED_PARTY);
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, null, mcMMOPlayer.getPartyInvite().getName(), EventReason.JOINED_PARTY);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -361,7 +362,7 @@ public class PartyCommand implements CommandExecutor {
|
||||
if (PartyManager.canInvite(player, mcMMOPlayer)) {
|
||||
Party party = mcMMOPlayer.getParty();
|
||||
|
||||
Users.getPlayer(target).setInvite(party);
|
||||
Users.getPlayer(target).setPartyInvite(party);
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));
|
||||
target.sendMessage(LocaleLoader.getString("Commands.Party.Invite.0", party.getName(), player.getName()));
|
||||
target.sendMessage(LocaleLoader.getString("Commands.Party.Invite.1"));
|
||||
|
Loading…
Reference in New Issue
Block a user