diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java index 84a7d8bdc..00fc15c9f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java @@ -400,7 +400,7 @@ public class FriendManager extends MiniDbClientPlugin> { if (_repository.updateVisibility(accountId, visibility)) { - runSync(() -> player.sendMessage(F.main(getName(), "Updated your friend visibility to " + F.elem(visibility.getName()) + "."))); + runSync(() -> player.sendMessage(F.main(getName(), "Updated your friend status to " + F.elem(visibility.getName()) + "."))); } }); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendVisibility.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendVisibility.java index 4b462dfb2..fcd398f4a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendVisibility.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendVisibility.java @@ -2,20 +2,30 @@ package mineplex.core.friend; import net.md_5.bungee.api.ChatColor; +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.itemstack.ItemBuilder; + public enum FriendVisibility { - SHOWN("Visible", ChatColor.GREEN), - PRESENCE("Semi-Visible", ChatColor.YELLOW), - INVISIBLE("Invisible", ChatColor.RED); + SHOWN("Visible", ChatColor.GREEN, Material.EMERALD), + PRESENCE("Semi-Visible", ChatColor.YELLOW, Material.GLOWSTONE_DUST), + INVISIBLE("Invisible", ChatColor.RED, Material.REDSTONE); private final String _name; private final ChatColor _colour; + private final ItemStack _itemStack; - FriendVisibility(String name, ChatColor colour) + FriendVisibility(String name, ChatColor colour, Material material) { _name = name; _colour = colour; + _itemStack = new ItemBuilder(material) + .setTitle(colour + name) + .addLore("Click to set your status", "to " + name + "!") + .build(); } public String getName() @@ -27,4 +37,9 @@ public enum FriendVisibility { return _colour; } + + public ItemStack getItemStack() + { + return _itemStack; + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendMainPage.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendMainPage.java index 0a7d4c92a..ef1bd3866 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendMainPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendMainPage.java @@ -125,10 +125,23 @@ public class FriendMainPage extends ShopPageBase .addLore("", "Click to display your friends in", "chat instead of this chest.") .build(), (player, clickType) -> { - player.closeInventory(); getPlugin().showFriends(player, true); + player.closeInventory(); }); + slot = 47; + + for (FriendVisibility visibility : FriendVisibility.values()) + { + addButton(slot, visibility.getItemStack(), (player, clickType) -> + { + getPlugin().setVisibility(player, visibility); + player.closeInventory(); + }); + + slot += 2; + } + _pageManager.buildPage(); }