mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-23 00:05:52 +01:00
Set playerhead async
This commit is contained in:
parent
603bbd5210
commit
63e63083f0
@ -88,14 +88,14 @@ public class EditableFriendList extends EditableInventory {
|
||||
ItemStack disp = super.display(inv, n);
|
||||
ItemMeta meta = disp.getItemMeta();
|
||||
|
||||
/*
|
||||
* run async to save performance
|
||||
*/
|
||||
if (meta instanceof SkullMeta) {
|
||||
((SkullMeta) meta).setOwningPlayer(friend);
|
||||
disp.setItemMeta(meta);
|
||||
}
|
||||
|
||||
if (meta instanceof SkullMeta) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(MMOCore.plugin, () -> {
|
||||
((SkullMeta) meta).setOwningPlayer(friend);
|
||||
disp.setItemMeta(meta);
|
||||
});
|
||||
}
|
||||
|
||||
return NBTItem.get(disp).add(new ItemTag("uuid", friend.getUniqueId().toString())).toItem();
|
||||
}
|
||||
}
|
||||
@ -217,6 +217,13 @@ public class EditableFriendList extends EditableInventory {
|
||||
return;
|
||||
}
|
||||
|
||||
if (playerData.getUniqueId().equals(target.getUniqueId())) {
|
||||
player.sendMessage(MMOCore.plugin.configManager.getSimpleMessage("yourself", "player", target.getName()));
|
||||
player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_NO, 1, 1);
|
||||
open();
|
||||
return;
|
||||
}
|
||||
|
||||
playerData.sendFriendRequest(PlayerData.get(target));
|
||||
player.sendMessage(MMOCore.plugin.configManager.getSimpleMessage("sent-friend-request", "player", target.getName()));
|
||||
player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user