mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Changed appearance of party member list
This commit is contained in:
parent
818962e668
commit
6b653fa606
@ -33,6 +33,7 @@ Version 1.4.08-dev
|
|||||||
= Fixed bug where the /ptp request expiration time was checked wrongly - preventing players from using the command
|
= Fixed bug where the /ptp request expiration time was checked wrongly - preventing players from using the command
|
||||||
= Fixed bug where Hylian Luck was broken
|
= Fixed bug where Hylian Luck was broken
|
||||||
! Changed party system. Parties now have XP and Levels. Party features such as party teleport and party chat have to be unlocked before they can be used by the party members
|
! Changed party system. Parties now have XP and Levels. Party features such as party teleport and party chat have to be unlocked before they can be used by the party members
|
||||||
|
! Changed appearance of party member list. Gold = party leader, White = online, Gray = offline, Italic = not nearby
|
||||||
! Updated localization files
|
! Updated localization files
|
||||||
! Changed the appearance of /mcmmo commands
|
! Changed the appearance of /mcmmo commands
|
||||||
! Changed AxesCritical to CriticalHit in config file
|
! Changed AxesCritical to CriticalHit in config file
|
||||||
|
@ -9,7 +9,6 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.party.Party;
|
import com.gmail.nossr50.datatypes.party.Party;
|
||||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||||
@ -126,32 +125,6 @@ public class PartyInfoCommand implements CommandExecutor {
|
|||||||
|
|
||||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Members.Header"));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.Members.Header"));
|
||||||
player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size(), membersOnline));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size(), membersOnline));
|
||||||
player.sendMessage(createMembersList(party, nearMembers));
|
player.sendMessage(party.createMembersList(player.getName(), nearMembers));
|
||||||
}
|
|
||||||
|
|
||||||
private String createMembersList(Party party, List<Player> nearMembers) {
|
|
||||||
StringBuilder memberList = new StringBuilder();
|
|
||||||
|
|
||||||
for (String memberName : party.getMembers()) {
|
|
||||||
Player member = mcMMO.p.getServer().getPlayerExact(memberName);
|
|
||||||
|
|
||||||
if (!nearMembers.contains(member)) {
|
|
||||||
memberList.append(ChatColor.ITALIC);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (party.getLeader().equalsIgnoreCase(memberName)) {
|
|
||||||
memberList.append(ChatColor.GOLD);
|
|
||||||
}
|
|
||||||
else if (member != null) {
|
|
||||||
memberList.append(ChatColor.WHITE);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
memberList.append(ChatColor.GRAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
memberList.append(memberName).append(ChatColor.RESET).append(" ");
|
|
||||||
}
|
|
||||||
|
|
||||||
return memberList.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,13 +12,12 @@ import org.bukkit.command.TabExecutor;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.StringUtil;
|
import org.bukkit.util.StringUtil;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
|
||||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.party.Party;
|
import com.gmail.nossr50.datatypes.party.Party;
|
||||||
|
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.party.PartyManager;
|
||||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ public class PartyAllianceCommand implements TabExecutor {
|
|||||||
targetParty = playerParty.getAlly();
|
targetParty = playerParty.getAlly();
|
||||||
|
|
||||||
displayPartyHeader();
|
displayPartyHeader();
|
||||||
displayMemberInfo();
|
displayMemberInfo(mcMMOPlayer);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
@ -91,7 +90,7 @@ public class PartyAllianceCommand implements TabExecutor {
|
|||||||
targetParty = playerParty.getAlly();
|
targetParty = playerParty.getAlly();
|
||||||
|
|
||||||
displayPartyHeader();
|
displayPartyHeader();
|
||||||
displayMemberInfo();
|
displayMemberInfo(mcMMOPlayer);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -127,32 +126,11 @@ public class PartyAllianceCommand implements TabExecutor {
|
|||||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Ally", playerParty.getName(), targetParty.getName()));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Ally", playerParty.getName(), targetParty.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayMemberInfo() {
|
private void displayMemberInfo(McMMOPlayer mcMMOPlayer) {
|
||||||
|
List<Player> nearMembers = PartyManager.getNearMembers(mcMMOPlayer);
|
||||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Members.Header"));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Members.Header"));
|
||||||
player.sendMessage(createMembersList(playerParty));
|
player.sendMessage(playerParty.createMembersList(player.getName(), nearMembers));
|
||||||
player.sendMessage(ChatColor.DARK_GRAY + "----------------------------");
|
player.sendMessage(ChatColor.DARK_GRAY + "----------------------------");
|
||||||
player.sendMessage(createMembersList(targetParty));
|
player.sendMessage(targetParty.createMembersList(player.getName(), nearMembers));
|
||||||
}
|
|
||||||
|
|
||||||
private String createMembersList(Party party) {
|
|
||||||
StringBuilder memberList = new StringBuilder();
|
|
||||||
|
|
||||||
for (String memberName : party.getMembers()) {
|
|
||||||
Player member = mcMMO.p.getServer().getPlayerExact(memberName);
|
|
||||||
|
|
||||||
if (party.getLeader().equalsIgnoreCase(memberName)) {
|
|
||||||
memberList.append(ChatColor.GOLD);
|
|
||||||
}
|
|
||||||
else if (member != null) {
|
|
||||||
memberList.append(ChatColor.WHITE);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
memberList.append(ChatColor.GRAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
memberList.append(memberName).append(" ");
|
|
||||||
}
|
|
||||||
|
|
||||||
return memberList.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -286,6 +287,36 @@ public class Party {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String createMembersList(String playerName, List<Player> nearMembers) {
|
||||||
|
StringBuilder memberList = new StringBuilder();
|
||||||
|
|
||||||
|
for (String memberName : this.getMembers()) {
|
||||||
|
Player member = mcMMO.p.getServer().getPlayerExact(memberName);
|
||||||
|
|
||||||
|
if (this.getLeader().equalsIgnoreCase(memberName)) {
|
||||||
|
memberList.append(ChatColor.GOLD);
|
||||||
|
|
||||||
|
if (member == null) {
|
||||||
|
memberName = memberName.substring(0, 1) + ChatColor.GRAY + ChatColor.ITALIC + "" + memberName.substring(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (member != null) {
|
||||||
|
memberList.append(ChatColor.WHITE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
memberList.append(ChatColor.GRAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!nearMembers.contains(member) && !playerName.equalsIgnoreCase(memberName)) {
|
||||||
|
memberList.append(ChatColor.ITALIC + "");
|
||||||
|
}
|
||||||
|
|
||||||
|
memberList.append(memberName).append(ChatColor.RESET).append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
return memberList.toString();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user