3
0
Mirror von https://github.com/TheSilentPro/HeadDB.git synchronisiert 2024-12-28 03:40:06 +01:00

Merge pull request #10 from leandrotlz/ui_permissions

Hide the Favorites, Search and Local UI options based on permissions.
Dieser Commit ist enthalten in:
Silent 2021-07-04 21:26:35 +02:00 committet von GitHub
Commit 14e5ecdf25
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -163,33 +163,39 @@ public class InventoryUtils {
inventory.addItem(item);
}
if (player.hasPermission("headdb.favorites")) {
inventory.setItem(39, buildButton(
XMaterial.BOOK.parseItem(),
"&eFavorites",
"",
"&8Click to view your favorites")
);
}
if (player.hasPermission("headdb.search")) {
inventory.setItem(40, buildButton(
XMaterial.DARK_OAK_SIGN.parseItem(),
"&9Search",
"",
"&8Click to open search menu"
));
}
if (player.hasPermission("headdb.local")) {
inventory.setItem(41, buildButton(
XMaterial.COMPASS.parseItem(),
"&aLocal",
"",
"&8Heads from any players that have logged on the server"
));
}
player.openInventory(inventory);
}
public static void fill(Inventory inv, ItemStack item) {
int size = inv.getSize();
int[] ignored = new int[]{20, 21, 22, 23, 24, 29, 30, 31, 32, 33, 39, 40, 41};
int[] ignored = new int[]{20, 21, 22, 23, 24, 29, 30, 31, 32, 33};
// Fill
for (int i = 0; i < size; i++) {