# Config (ShopChest 1.12 API)
Date: 2017-06-08

de.epiceric.shopchest.config

## Class Config

- java.lang.Object
- - de.epiceric.shopchest.config.Config

    public class Config
    extends Object

### Field Summary

Fields
`boolean` `allow_broken_items` Whether players are allowed to sell/buy broken items
`boolean` `allow_decimals_in_price` Whether prices may contain decimals
`boolean` `append_potion_level_to_item_name` Whether the extension of a potion or tipped arrow (if available) should be appended to the item name.
`List<String>` `areashop_remove_shop_events` The events of AreaShop when shops in that region should be removed
`boolean` `auto_calculate_item_amount` Whether the item amount should be calculated to fit the available money or inventory space
`List<String>` `blacklist` List containing items, of which players can't create a shop If this list contains an item (e.g "STONE", "STONE:1"), it's in the blacklist.
`boolean` `buy_greater_or_equal_sell` Whether the buy price of a shop must be greater than or equal the sell price
`String` `database_mysql_database` The database used for ShopChest's MySQL database
`String` `database_mysql_host` The hostname used in ShopChest's MySQL database
`String` `database_mysql_password` The password used in ShopChest's MySQL database
`int` `database_mysql_ping_interval` The interval in seconds, a ping is sent to the MySQL server
`int` `database_mysql_port` The port used for ShopChest's MySQL database
`String` `database_mysql_username` The username used in ShopChest's MySQL database
`Database.DatabaseType` `database_type` The database type used for ShopChest.
`int` `default_limit` The default shop limit for players whose limit is not set via a permission
`boolean` `enable_areashop_integration` Whether AreaShop integration should be enabled
`boolean` `enable_askyblock_integration` Whether ASkyBlock integration should be enabled
`boolean` `enable_authme_integration` Whether AuthMe integration should be enabled
`boolean` `enable_debug_log` Whether the debug log file should be created
`boolean` `enable_griefprevention_integration` Whether GriefPrevention integration should be enabled
`boolean` `enable_hologram_interaction` Whether hologram interaction should be enabled
`boolean` `enable_islandworld_integration` Whether IslandWorld integration should be enabled
`boolean` `enable_plotsquared_integration` Whether PlotSquared integration should be enabled
`boolean` `enable_quality_mode` Whether quality mode should be enabled
`boolean` `enable_towny_integration` Whether Towny integration should be enabled
`boolean` `enable_uskyblock_integration` Whether uSkyBlock integration should be enabled
`boolean` `enable_vendor_messages` Whether the vendor of the shop should get messages about buys and sells
`boolean` `enable_worldguard_integration` Whether WorldGuard integration should be enabled
`boolean` `exclude_admin_shops` Whether admin shops should be excluded of the shop limits
`boolean` `explosion_protection` Whether shops should be protected by explosions
`boolean` `hologram_fixed_bottom` Whether the hologram's location should be fixed at the bottom
`double` `hologram_lift` Amount every hologram should be lifted
`boolean` `hopper_protection` Whether shops should be protected by hoppers
`boolean` `invert_mouse_buttons` Whether the mouse buttons are inverted Default: Right-Click: Buy Left-Click: Sell
`String` `language_file` The language file to use (e.g en_US, de_DE)
`String` `main_command_name` The main command of ShopChest (default: shop)
`double` `maximal_distance` The maximum distance between a player and a shop to see the hologram
`double` `maximal_item_distance` The maximum distance between a player and a shop to see the shop item
`Set<String>` `maximum_prices` The maximum prices for certain items This returns a key set, which contains e.g "STONE", "STONE:1", of the `maximum-prices` section in ShopChest's config.
`Set<String>` `minimum_prices` The minimum prices for certain items This returns a key set, which contains e.g "STONE", "STONE:1", of the minimum-prices section in ShopChest's config.
`boolean` `only_show_first_shop_in_sight` Whether only the shop a player is looking at should be shown to him
`boolean` `only_show_shops_in_sight` Whether only the shops a player has in sight should be shown to him
`boolean` `remove_shop_on_error` Whether shops should automatically be removed from the database if an error occurred while loading (e.g. when no chest is found at a shop's location)
`double` `shop_creation_price_admin` The price a player has to pay in order to create an admin shop
`double` `shop_creation_price_normal` The price a player has to pay in order to create a normal shop
`org.bukkit.inventory.ItemStack` `shop_info_item` The item with which a player can click a shop to retrieve information
`boolean` `show_shop_items` Whether the shop items should be shown
`List<String>` `towny_shop_plots_king` The types of town plots the king is allowed to create shops in
`List<String>` `towny_shop_plots_mayor` The types of town plots the mayor is allowed to create shops in
`List<String>` `towny_shop_plots_residents` The types of town plots residents are allowed to create shops in
`ShopUpdateEvent.UpdateQuality` `update_quality` The quality of hologram and item updating (performance saving, or better quality)
`boolean` `wg_allow_create_shop_default` The default value for the custom WorldGuard flag 'create-shop'
`boolean` `wg_allow_use_admin_shop_default` The default value for the custom WorldGuard flag 'use-admin-shop'
`boolean` `wg_allow_use_shop_default` The default value for the custom WorldGuard flag 'use-shop'

### Constructor Summary

Constructors
Constructor and Description
`Config(ShopChest plugin)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `add(String property, String value)` Add a value to a list in the config.yml.
`LanguageConfiguration` `getLanguageConfig()`
`void` `reload(boolean firstLoad, boolean langReload, boolean showMessages)` Reload the configuration values from config.yml
`void` `remove(String property, String value)`
`void` `set(String property, String value)` Set a configuration value Config is automatically reloaded

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### update_quality

    public ShopUpdateEvent.UpdateQuality update_quality

The quality of hologram and item updating (performance saving, or better quality)

#### shop_info_item

    public org.bukkit.inventory.ItemStack shop_info_item

The item with which a player can click a shop to retrieve information

#### wg_allow_create_shop_default

    public boolean wg_allow_create_shop_default

The default value for the custom WorldGuard flag 'create-shop'

#### wg_allow_use_admin_shop_default

    public boolean wg_allow_use_admin_shop_default

The default value for the custom WorldGuard flag 'use-admin-shop'

#### wg_allow_use_shop_default

    public boolean wg_allow_use_shop_default

The default value for the custom WorldGuard flag 'use-shop'

#### towny_shop_plots_residents

    public List<String> towny_shop_plots_residents

The types of town plots residents are allowed to create shops in

#### towny_shop_plots_mayor

    public List<String> towny_shop_plots_mayor

The types of town plots the mayor is allowed to create shops in

#### towny_shop_plots_king

    public List<String> towny_shop_plots_king

The types of town plots the king is allowed to create shops in

#### areashop_remove_shop_events

    public List<String> areashop_remove_shop_events

The events of AreaShop when shops in that region should be removed

#### database_mysql_host

    public String database_mysql_host

The hostname used in ShopChest's MySQL database

#### database_mysql_port

    public int database_mysql_port

The port used for ShopChest's MySQL database

#### database_mysql_database

    public String database_mysql_database

The database used for ShopChest's MySQL database

#### database_mysql_username

    public String database_mysql_username

The username used in ShopChest's MySQL database

#### database_mysql_password

    public String database_mysql_password

The password used in ShopChest's MySQL database

#### database_type

    public Database.DatabaseType database_type

The database type used for ShopChest.

#### database_mysql_ping_interval

    public int database_mysql_ping_interval

The interval in seconds, a ping is sent to the MySQL server

#### minimum_prices

    public Set<String> minimum_prices

The minimum prices for certain items

This returns a key set, which contains e.g "STONE", "STONE:1", of the minimum-prices section in ShopChest's config. To actually retrieve the minimum price for an item, you have to get the double `minimum-prices.<key>`.

#### maximum_prices

    public Set<String> maximum_prices

The maximum prices for certain items

This returns a key set, which contains e.g "STONE", "STONE:1", of the `maximum-prices` section in ShopChest's config. To actually retrieve the maximum price for an item, you have to get the double `maximum-prices.<key>`.

#### blacklist

    public List<String> blacklist

List containing items, of which players can't create a shop

If this list contains an item (e.g "STONE", "STONE:1"), it's in the blacklist.

#### allow_decimals_in_price

    public boolean allow_decimals_in_price

Whether prices may contain decimals

#### buy_greater_or_equal_sell

    public boolean buy_greater_or_equal_sell

Whether the buy price of a shop must be greater than or equal the sell price

#### hopper_protection

    public boolean hopper_protection

Whether shops should be protected by hoppers

#### explosion_protection

    public boolean explosion_protection

Whether shops should be protected by explosions

#### enable_quality_mode

    public boolean enable_quality_mode

Whether quality mode should be enabled

#### enable_hologram_interaction

    public boolean enable_hologram_interaction

Whether hologram interaction should be enabled

#### enable_debug_log

    public boolean enable_debug_log

Whether the debug log file should be created

#### enable_worldguard_integration

    public boolean enable_worldguard_integration

Whether WorldGuard integration should be enabled

#### enable_towny_integration

    public boolean enable_towny_integration

Whether Towny integration should be enabled

#### enable_authme_integration

    public boolean enable_authme_integration

Whether AuthMe integration should be enabled

#### enable_plotsquared_integration

    public boolean enable_plotsquared_integration

Whether PlotSquared integration should be enabled

#### enable_uskyblock_integration

    public boolean enable_uskyblock_integration

Whether uSkyBlock integration should be enabled

#### enable_askyblock_integration

    public boolean enable_askyblock_integration

Whether ASkyBlock integration should be enabled

#### enable_islandworld_integration

    public boolean enable_islandworld_integration

Whether IslandWorld integration should be enabled

#### enable_griefprevention_integration

    public boolean enable_griefprevention_integration

Whether GriefPrevention integration should be enabled

#### enable_areashop_integration

    public boolean enable_areashop_integration

Whether AreaShop integration should be enabled

#### enable_vendor_messages

    public boolean enable_vendor_messages

Whether the vendor of the shop should get messages about buys and sells

#### exclude_admin_shops

    public boolean exclude_admin_shops

Whether admin shops should be excluded of the shop limits

#### append_potion_level_to_item_name

    public boolean append_potion_level_to_item_name

Whether the extension of a potion or tipped arrow (if available) should be appended to the item name.

#### show_shop_items

    public boolean show_shop_items

Whether the shop items should be shown

#### allow_broken_items

    public boolean allow_broken_items

Whether players are allowed to sell/buy broken items

#### only_show_shops_in_sight

    public boolean only_show_shops_in_sight

Whether only the shops a player has in sight should be shown to him

#### only_show_first_shop_in_sight

    public boolean only_show_first_shop_in_sight

Whether only the shop a player is looking at should be shown to him

#### remove_shop_on_error

    public boolean remove_shop_on_error

Whether shops should automatically be removed from the database if an error occurred while loading

(e.g. when no chest is found at a shop's location)

#### auto_calculate_item_amount

    public boolean auto_calculate_item_amount

Whether the item amount should be calculated to fit the available money or inventory space

#### invert_mouse_buttons

    public boolean invert_mouse_buttons

Whether the mouse buttons are inverted

Default:
Right-Click: Buy
Left-Click: Sell

#### hologram_fixed_bottom

    public boolean hologram_fixed_bottom

Whether the hologram's location should be fixed at the bottom

#### hologram_lift

    public double hologram_lift

Amount every hologram should be lifted

#### maximal_distance

    public double maximal_distance

The maximum distance between a player and a shop to see the hologram

#### maximal_item_distance

    public double maximal_item_distance

The maximum distance between a player and a shop to see the shop item

#### shop_creation_price_normal

    public double shop_creation_price_normal

The price a player has to pay in order to create a normal shop

#### shop_creation_price_admin

    public double shop_creation_price_admin

The price a player has to pay in order to create an admin shop

#### default_limit

    public int default_limit

The default shop limit for players whose limit is not set via a permission

#### main_command_name

    public String main_command_name

The main command of ShopChest (default: shop)

#### language_file

    public String language_file

The language file to use (e.g en_US, de_DE)

### Constructor Detail

#### Config

    public Config(ShopChest plugin)

### Method Detail

#### set

    public void set(String property,
                    String value)

Set a configuration value

Config is automatically reloaded

Parameters:
  `property` - Property to change
  `value` - Value to set

#### add

    public void add(String property,
                    String value)

Add a value to a list in the config.yml. If the list does not exist, a new list with the given value will be created

Parameters:
  `property` - Location of the list
  `value` - Value to add

#### remove

    public void remove(String property,
                       String value)

#### reload

    public void reload(boolean firstLoad,
                       boolean langReload,
                       boolean showMessages)

Reload the configuration values from config.yml

#### getLanguageConfig

    public LanguageConfiguration getLanguageConfig()

Returns:
  ShopChest's `LanguageConfiguration`