API/Documentation

Methods and Usage

addBlockedItem(String Playername, Integer Id)

- Adds an item to Playername's blocked list. Playername will not be able to craft it.

removeBlockedItem(String Playername, Integer Id)

- Removes an item earlier added to Playername's blocked list. Playername will then be able to successfully craft it.

addGlobalBlockedItem(Integer Id, String ExemptionPermission)

- Adds an item to the globally blocked list. You can add a permission so that if the player has the permission they can still craft it.

removeGlobalBlockedItem(Integer Id)

- Removes an item earlier added to the globally blocked list.

getBlockedItems(String Playername)

- Returns an ArrayList with Integer as the parameter of all the blocked items for the specified player.

getGlobalBlockedItems()

- Returns a HashMap with Integer, String as the parameters of all the globally blocked items and their exemption permissions.

setBlockedItems(String Playername, ArrayList<Integer> BlockedIds)

- Sets an entire list of blocked ids to Playername in the same format that is returned from getBlockedItems. WARNING! Replaces the entire list for Playername, destroying any previous list.

setGlobalBlockedItems(HashMap<Integer, String> BlockedIds)

- Maps an entire list of blocked ids and their exemption permissions to the globally blocked list. WARNING! Replaces the entire globally blocked list, destroying any previous list.

setBanMessage(String BanMessage)

- Sets the message sent to the player when they are blocked from crafting something. Will be automatically displayed in red.

setEnchantBanMessage(String BanMessage)

- Sets the message sent to the player when they are blocked from enchanting something. Will be automatically displayed in red.

All these methods are accessible from RecipeHandler (defined during setup in the main class file).

Exemption Permission (Global List)

You can set a permission as a string (superperms) which if the player has means they won't be blocked from that item in the globally blocked list. You can also set it as "op" so that ops are exempt whereas everyone else isn't. You can also set it as "none" or null meaning that they are no exceptions, everyone is blocked.

Banned Message Parameters

The ban message can be set as "none" or null so that no message is displayed. It also has variables that can be put into it. These can be placed anywhere within the message, and more than once or not at all.
%%ID%% - Returns the blocked id. Recipe Specific
%%MATERIAL%% - Returns the blocked material in lower case and with spaces. Recipe Specific
%%PLAYER%% - Returns the player's display name (not always login name, can be changed by nickname plugins).
%%ENCHANTMENT%% - Returns the enchantment in lower case and with spaces. Enchant Specific

Remember to tell your users they require this plugin as well as yours!


Comments

Posts Quoted:
Reply
Clear All Quotes