Configuration


ClassAPI

Current Version - Version 1.1

For CraftBukkit - 1.6.2-R0.1


Links


Configuration

Main configuration type

Located: MainConfigDirectorySpecifiedByThePlugin/Classes.yml (Multiple files of the Main type is supported, this is the first generated.)

In ClassAPI, there are 2 configuration file types. The main type contains the classes itself in a serialized format(Broken down into a configurable, somewhat human understandable format.) that looks as shown:

Classes:
  Example1:
    {{{==: FullClass}}}
    Permission: bukkit.op
    Name: Example1
    Team: Blue
    Description: Default kit description.
    Items:
    - IRON_SWORD:0:1:&3Destruction KNOCKBACK:2
    - COOKED_BEEF:0:8
    - COMPASS:0:1
    - SPEED:100:2:true:false:1
    Armour:
    - LEATHER_CHESTPLATE:0:1
    - LEATHER_LEGGINGS:0:1
    - LEATHER_BOOTS:0:1
    Potion Effects:
    - SPEED:100:2:false:false
  Example2:
    {{{==: FullClass}}}
    Permission: bukkit.op
    Name: Example2
    Items:
    - IRON_SWORD:0:1:&3Destruction KNOCKBACK:2
    - COOKED_BEEF:0:8
    - COMPASS:0:1

NB: Do NOT change the "==:" node. This would result in the API not working correctly and there's no need to change it, unless a plugin hooks into the serialization of it in which case it would be fine.

NB: Ignore the {{{ and the }}} in the config listed above. ^ That's just a wiki formatting bug,

The only thing that might confuse you in this is the Item, Armour(Yes, it's spelt like that in locations other than the US.) and Potion Effects, which I would expain now:

Items / Armour configuration

Items and armour follow the same format:

Item_Name:ItemData:Amount:&3Coloured_ItemDisplayNameWhere(%20)RepresentsASpace ENCHANTMENT1:EnchantmentLevel ENCHANTMENT2:EnchantLevel

Where enchantments and Item names are optional.

Some useful links:

Potion Effects configuration

If you did not know, this contains of a list of potion effects that a plugin would use to apply to a Player upon receiving the kit.
NB: You can use the same format under Items to give your player the Potion itself, or use the normal format with the item name as "POTION" and Data as the potion you want.

Potion effects follow the following format:

PotionTypeName:LengthInTicks(20=1second):(Level 0=level1):splashPotion:ExtendedPotion

Some useful links:

Default configuration type

Located: MainConfigDirectorySpecifiedByThePlugin/Default Class.yml.

In ClassAPI's main configuration, you are presented with the option of not putting a value at all for that particular category.

NB: Permission, Name and Items are MUSTs. You must have them in all your classes in your main config.

If you look at the configuration example at the beginning of the page, you would notice that Example2 has far less categories than Example1, yet it still works. In that case, the plugin seeks out the missing information from the default configuration, which contains information that would be used for EVERY class that is missing in the main config. This is to save HDD space, and to make the API faster by having less configuration options to parse for every class. So if you want a particular variable to be the same for ALL classes (NOT PERMISSION, NAME OR ITEMS) then you configure that in your default config. If an error occurred, for example a plugin tries to obtain a class from a name that is not configured, it would send back all the information from the default configuration file. (Which is why the default configuration file has Permission, Name and Items categories).

The configuration for this is much simpler than that of the Main type, but follows the same rules.

Permission: "Bukkit.op"
Name: Null Class.
Description: Default class description.
Team: "Null Team."
Items:
  - AIR:0:0
Armour:
  - AIR:0:0
Potion Effects:
  - SPEED:0:0:false:false

Items, Armour and Potion Effects follow the same format as explained above. ^



Comments

Posts Quoted:
Reply
Clear All Quotes