mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Clean up
This commit is contained in:
parent
e2faeac505
commit
433c99e239
@ -216,7 +216,6 @@ public class PartyCommand implements CommandExecutor {
|
||||
return true; // End before any event is fired.
|
||||
}
|
||||
|
||||
// TODO: We shoudln't fire the event before checking if the password is correct
|
||||
if (party != null) {
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, party.getName(), targetParty.getName(), EventReason.CHANGED_PARTIES);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||
@ -362,7 +361,7 @@ public class PartyCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (args.length < 2) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "expshare", "[sharemode]"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "expshare", "[NONE / EQUAL]"));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -376,13 +375,18 @@ public class PartyCommand implements CommandExecutor {
|
||||
for (Player onlineMembers : party.getOnlineMembers()) {
|
||||
onlineMembers.sendMessage(LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Exp"), LocaleLoader.getString("Party.ShareMode.NoShare")));
|
||||
}
|
||||
} else if (args[1].equalsIgnoreCase("equal") || args[1].equalsIgnoreCase("even")) {
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("equal") || args[1].equalsIgnoreCase("even")) {
|
||||
party.setXpShareMode(ShareHandler.XpShareMode.EQUAL);
|
||||
|
||||
for (Player onlineMembers : party.getOnlineMembers()) {
|
||||
onlineMembers.sendMessage(LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Exp"), LocaleLoader.getString("Party.ShareMode.Equal")));
|
||||
}
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "expshare", "[NONE / EQUAL]"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -565,8 +569,16 @@ public class PartyCommand implements CommandExecutor {
|
||||
String playerName = player.getName();
|
||||
Party party = mcMMOPlayer.getParty();
|
||||
|
||||
if (party != null) {
|
||||
if (party.getLeader().equals(playerName)) {
|
||||
if (party == null) {
|
||||
player.sendMessage("Commands.Party.None");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!party.getLeader().equals(playerName)) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.NotOwner"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (party.isLocked()) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.IsLocked"));
|
||||
}
|
||||
@ -574,15 +586,6 @@ public class PartyCommand implements CommandExecutor {
|
||||
party.setLocked(true);
|
||||
player.sendMessage(LocaleLoader.getString("Party.Locked"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Party.NotOwner"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
player.sendMessage("Commands.Party.None");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -597,8 +600,16 @@ public class PartyCommand implements CommandExecutor {
|
||||
String playerName = player.getName();
|
||||
Party party = mcMMOPlayer.getParty();
|
||||
|
||||
if (party != null) {
|
||||
if (party.getLeader().equals(playerName)) {
|
||||
if (party == null) {
|
||||
player.sendMessage("Commands.Party.None");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!party.getLeader().equals(playerName)) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.NotOwner"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!party.isLocked()) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.IsntLocked"));
|
||||
}
|
||||
@ -606,15 +617,6 @@ public class PartyCommand implements CommandExecutor {
|
||||
party.setLocked(false);
|
||||
player.sendMessage(LocaleLoader.getString("Party.Unlocked"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Party.NotOwner"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
player.sendMessage("Commands.Party.None");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user