diff --git a/Plugin/src/main/java/me/filoghost/chestcommands/internal/AdvancedIconMenu.java b/Plugin/src/main/java/me/filoghost/chestcommands/internal/AdvancedIconMenu.java index b24e8c3..5a94e07 100644 --- a/Plugin/src/main/java/me/filoghost/chestcommands/internal/AdvancedIconMenu.java +++ b/Plugin/src/main/java/me/filoghost/chestcommands/internal/AdvancedIconMenu.java @@ -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 { @@ -77,12 +76,8 @@ public class AdvancedIconMenu extends BaseIconMenu { } @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) { diff --git a/Plugin/src/main/java/me/filoghost/chestcommands/internal/BaseIconMenu.java b/Plugin/src/main/java/me/filoghost/chestcommands/internal/BaseIconMenu.java index 0389aa0..f5264a0 100644 --- a/Plugin/src/main/java/me/filoghost/chestcommands/internal/BaseIconMenu.java +++ b/Plugin/src/main/java/me/filoghost/chestcommands/internal/BaseIconMenu.java @@ -72,7 +72,7 @@ public class BaseIconMenu { 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 { player.openInventory(inventory); } - protected boolean canViewIcon(Player player, Icon icon) { + protected boolean canViewIcon(Player player, T icon) { return true; }