1.4 completely removed "click menus" as they are barely used by anyone. Added view_requirement
1.4
Removed "click menus" as it was confusing to some people and barely anyone actually used them. This should improve performance a bit as there are no longer 2 different GUI implementations inside of the plugin.
Changed view permission to view requirement which uses javascript to evaluate if a player should meet the requirement to view an item in the GUI.
This should allow more flexibility as you can do much more than simply check if a player has a certain permission node to view an item in your GUI menu.
More information on view_requirements:
Code (Text):
# ==============================================================
#
# View requirement information
#
# You can add a 'view requirement' to an item if it has a priority value set for it
# The view requirement has replaced the 'permission' entry for items
# This allows you to specify a specific requirement in javascript for the item to be shown
# In order to use view requirements, the item must have a priority value and a valid javascript expression
# that returns true or false.
#
# 'item_one':
# material: DIAMOND
# slot: 3
# priority: 1
# view_requirement: '%vaulteco_balance% > 100'
# 'item_two':
# material: IRON_INGOT
# slot: 3
# priority: 2
# view_requirement: 'BukkitPlayer.hasPermission("some.permission")'
# 'item_three':
# material: STONE
# slot: 3
# priority: 3
#
# In the example above, the priority 1 item view requirement will be checked first, if a player has over 100 dollars, that item will be shown.
# If the player does not meet the requirement for the first item, the item with priority 2 will be checked. If the player does not have the permission
# node some.permission, the final item 'item_three' will be set to slot 3 as the player did not meet the requirement for the first 2 items with
# a higher priority.
#
# You may use placeholders in your Javascript expressions to evaluate if the player meets the requirement or not.
# You may also use a few keywords which give you access to the Player class and Bukkit.Server class if you understand the Bukkit API
#
# BukkitPlayer - references the Player object your expression is evaluating.
# BukkitServer - references Bukkit.getServer() in the Bukkit API.
#
# The choice to use this system to evaluate if a player meets requirements to click an item was an easy choice.
# This way I do not have to hook into every plugin to check if a player meets the requirement to click an item successfully.
# You can simply use placeholders, or the keywords provided to give you access to the Player and Server objects.
# If you want to check if a player has enough money, simply use an expression like so:
#
# view_requirement: '%vaulteco_balance% >= 100' (checks if players balance is greater than or equal to 100)
# ==============================================================