mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Using getPlayerExact is faster.
This commit is contained in:
parent
f0dcfb0346
commit
69aead58a7
@ -1,7 +1,6 @@
|
|||||||
package com.gmail.nossr50.commands.party;
|
package com.gmail.nossr50.commands.party;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -43,12 +42,12 @@ public class PartyInfoCommand implements CommandExecutor {
|
|||||||
StringBuilder memberList = new StringBuilder();
|
StringBuilder memberList = new StringBuilder();
|
||||||
|
|
||||||
for (String memberName : playerParty.getMembers()) {
|
for (String memberName : playerParty.getMembers()) {
|
||||||
OfflinePlayer member = mcMMO.p.getServer().getOfflinePlayer(memberName);
|
Player member = mcMMO.p.getServer().getPlayerExact(memberName);
|
||||||
|
|
||||||
if (playerParty.getLeader().equalsIgnoreCase(memberName)) {
|
if (playerParty.getLeader().equalsIgnoreCase(memberName)) {
|
||||||
memberList.append(ChatColor.GOLD);
|
memberList.append(ChatColor.GOLD);
|
||||||
}
|
}
|
||||||
else if (member.isOnline()) {
|
else if (member != null) {
|
||||||
memberList.append(ChatColor.WHITE);
|
memberList.append(ChatColor.WHITE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -403,7 +403,7 @@ public class EntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We can make this assumption because we (should) be the only ones using this exact metadata
|
// We can make this assumption because we (should) be the only ones using this exact metadata
|
||||||
Player player = plugin.getServer().getPlayer(entity.getMetadata(mcMMO.tntMetadataKey).get(0).asString());
|
Player player = plugin.getServer().getPlayerExact(entity.getMetadata(mcMMO.tntMetadataKey).get(0).asString());
|
||||||
|
|
||||||
if (Misc.isNPCEntity(player)) {
|
if (Misc.isNPCEntity(player)) {
|
||||||
return;
|
return;
|
||||||
@ -430,7 +430,7 @@ public class EntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We can make this assumption because we (should) be the only ones using this exact metadata
|
// We can make this assumption because we (should) be the only ones using this exact metadata
|
||||||
Player player = plugin.getServer().getPlayer(entity.getMetadata(mcMMO.tntMetadataKey).get(0).asString());
|
Player player = plugin.getServer().getPlayerExact(entity.getMetadata(mcMMO.tntMetadataKey).get(0).asString());
|
||||||
|
|
||||||
if (Misc.isNPCEntity(player)) {
|
if (Misc.isNPCEntity(player)) {
|
||||||
return;
|
return;
|
||||||
|
@ -25,7 +25,7 @@ public class McrankCommandDisplayTask extends BukkitRunnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Player player = mcMMO.p.getServer().getPlayer(playerName);
|
Player player = mcMMO.p.getServer().getPlayerExact(playerName);
|
||||||
Integer rank;
|
Integer rank;
|
||||||
|
|
||||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading"));
|
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading"));
|
||||||
|
Loading…
Reference in New Issue
Block a user