forked from Upstream/mmocore
Set playerhead async
This commit is contained in:
parent
603bbd5210
commit
63e63083f0
@ -88,12 +88,12 @@ public class EditableFriendList extends EditableInventory {
|
|||||||
ItemStack disp = super.display(inv, n);
|
ItemStack disp = super.display(inv, n);
|
||||||
ItemMeta meta = disp.getItemMeta();
|
ItemMeta meta = disp.getItemMeta();
|
||||||
|
|
||||||
/*
|
|
||||||
* run async to save performance
|
|
||||||
*/
|
|
||||||
if (meta instanceof SkullMeta) {
|
if (meta instanceof SkullMeta) {
|
||||||
((SkullMeta) meta).setOwningPlayer(friend);
|
Bukkit.getScheduler().runTaskAsynchronously(MMOCore.plugin, () -> {
|
||||||
disp.setItemMeta(meta);
|
((SkullMeta) meta).setOwningPlayer(friend);
|
||||||
|
disp.setItemMeta(meta);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return NBTItem.get(disp).add(new ItemTag("uuid", friend.getUniqueId().toString())).toItem();
|
return NBTItem.get(disp).add(new ItemTag("uuid", friend.getUniqueId().toString())).toItem();
|
||||||
@ -217,6 +217,13 @@ public class EditableFriendList extends EditableInventory {
|
|||||||
return;
|
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));
|
playerData.sendFriendRequest(PlayerData.get(target));
|
||||||
player.sendMessage(MMOCore.plugin.configManager.getSimpleMessage("sent-friend-request", "player", target.getName()));
|
player.sendMessage(MMOCore.plugin.configManager.getSimpleMessage("sent-friend-request", "player", target.getName()));
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1);
|
player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user