mirror of
https://github.com/filoghost/ChestCommands.git
synced 2024-11-26 03:55:40 +01:00
Cleanup
This commit is contained in:
parent
a48121dbad
commit
27c05ece6a
@ -25,7 +25,6 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import me.filoghost.chestcommands.ChestCommands;
|
||||
import me.filoghost.chestcommands.Permissions;
|
||||
import me.filoghost.chestcommands.action.Action;
|
||||
import me.filoghost.chestcommands.api.Icon;
|
||||
|
||||
public class AdvancedIconMenu extends BaseIconMenu<AdvancedIcon> {
|
||||
|
||||
@ -77,12 +76,8 @@ public class AdvancedIconMenu extends BaseIconMenu<AdvancedIcon> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canViewIcon(Player player, Icon icon) {
|
||||
if (icon instanceof AdvancedIcon) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return ((AdvancedIcon) icon).canViewIcon(player);
|
||||
protected boolean canViewIcon(Player player, AdvancedIcon icon) {
|
||||
return icon.canViewIcon(player);
|
||||
}
|
||||
|
||||
public void openCheckingPermission(Player player) {
|
||||
|
@ -72,7 +72,7 @@ public class BaseIconMenu<T extends Icon> {
|
||||
Inventory inventory = Bukkit.createInventory(new MenuInventoryHolder(this), getSize(), title);
|
||||
|
||||
for (int i = 0; i < inventoryGrid.getSize(); i++) {
|
||||
Icon icon = inventoryGrid.getElementAtIndex(i);
|
||||
T icon = inventoryGrid.getElementAtIndex(i);
|
||||
if (icon != null && canViewIcon(player, icon)) {
|
||||
inventory.setItem(i, hideAttributes(icon.createItemStack(player)));
|
||||
}
|
||||
@ -81,7 +81,7 @@ public class BaseIconMenu<T extends Icon> {
|
||||
player.openInventory(inventory);
|
||||
}
|
||||
|
||||
protected boolean canViewIcon(Player player, Icon icon) {
|
||||
protected boolean canViewIcon(Player player, T icon) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user