Skip to content

Configuration

ElitoGame edited this page Jun 6, 2023 · 6 revisions

Configuration

EzChestShop offers many options for customization with it's config.yml and Locale_XX.yml files. The focus of this page is on the config.yml file and how to configure it.

Unless explicitly mentioned below, all the settings in the configuration file can be reloaded using /ecsadmin reload while the server is running.

Language

This defines the language file that will be used by default. See the Language Wiki for further Information.

Holograms

You can toggle Hologram rendering entirely using shops.hologram.show-holograms. If set to false, shops will have no visual indications.

Hologram Structure

The Layout of the Holograms can be completely customized and you can have different Structures for adminshops then for playershops. Each line of a Hologram is defined with a dash - then the text follows.

If you think the texts and floating item(s) are too clustered together, you can change the line spacing of the elements through a multiplier: shops.hologram.holo-line-spacing. The default value is 1 = 100% line spacing. This value can be changed to e.g. 0.5 = 50% line spacing, or 2 = 200% line spacing, etc.

Special elements

  • <buy>..</buy> ... HTML like tags, that are used for marking text as the buy price. When a Shop has disabled buy, everything between the tags (..) will be hidden.
  • <sell>..</sell> ... HTML like tags, that are used for marking text as the sell price. When a Shop has disabled sell, everything between the tags (..) will be hidden.
  • <separator>..</separator> ... HTML like tags, that are used for marking text as separators between buy and sell price. The contents of these tags (..) will only be shown if both buy and sell are enabled. If neither is enabled the disabled message of the Locale_XX.yml will be displayed.
  • [item] ... This element will be replaced with a floating item, representing the item for sale. Any further content in this line is ignored.
  • <emptyShopInfo/> ... HTML like tag that only shows up for the owner of a shop if his shop is empty. This line only shows up on non-server owned shops with buy enabled.
  • <empty/> ... This tag simply defines a empty line that has the same height as a text line, without rendering anything inside.
  • <custom{1,2,3,4}/> ... HTML like tag that will be replaced by user defined custom Hologram messages.
  • <itemData{number(1-maxInteger) || Rest}/> ... HTML like tag that will be replaced with data from an Item. This currently includes Shulkerbox contents and Enchantments.

Placeholders

  • %currency% ... currency used by the server, defined under shop.economy.currency.
  • %buy% ... buy price of the shop
  • %maxbuy% ... maximum amount a player can buy of this shop, calculated via stock of the shop, balance of the player, as well as available inventory space.
  • %sell% ... sell price of the shop
  • %maxsell% ... maximum amount a player can sell to this shop, calculated via space in the shop, available items in the players inventory, as well as balance of the owner.
  • %owner% ... name of the shops creator.

Hologram display modes

There are two main modes for Hologram display:

  • Distance based - Holograms are rendered at a certain distance and removed when leaving the range
  • Eyeline based - Holograms are rendered when players look directly at the shop and removed after a certain delay

By default, the distance based mode is used, but since it's more performance intensive, it can be turned off via shops.hologram.distance.toggled. Change requires Restart.

Distance based mode

  • shops.hologram.distance.range allows users to define a Range at which Holograms should render in. Be careful with this option as this can spawn in a lot of Holograms simultaniously, depending on shop layouts. This might lag out players and potentially the server.
  • shops.hologram.distance.show-items-first makes items render at the specified distance. Hologram texts will render only when looked at directly. This option is turned on by default.

Eyeline based mode

  • shops.hologram.hologram-disappearance-delay is the delay (in seconds) after which a looked at Shop will disappear. Defaults to 10 seconds.

Rotation

shops.hologram.allow-rotation by default this value is set to true. It allows users to rotate holograms around the chests. If set to false, players will not see the option to rotate holograms.

Container

In this section, the type of applicable shop containers can be defined. Possible use cases for this are:

  • Servers don't want their players to move shops around via Shulkerboxes.
  • Big shopping areas can cause lag due to the holograms and chest tile entities. Therefore it might be a good idea to enable just Barrels because they are full blocks and therefore a bit less laggy.

The configurations are:

  • shop.containers.chests
  • shop.containers.trapped-chests
  • shop.containers.barrels
  • shop.containers.shulkers

Number Format

The way numbers are formatted all over the plugin can be changed. Therefore, you can use this number formatter.

  • GUI: shop.display.number-format.gui
  • Chat: shop.display.number-format.chat
  • Hologram: shop.display.number-format.hologram

Shop Settings

Defaults

You can change the default settings, including...

  • if transaction messages should be sent shop.settings.defaults.transaction-message
  • if buying is disabled shop.settings.defaults.disable-buying
  • if selling is disabled shop.settings.defaults.disable-selling
  • the default rotation shop.settings.defaults.rotation
  • if Profits should be shared shop.settings.defaults.share-profit

Shop creation

If shop.settings.zero-price-equals-disabled is set to true (default), a newly created shop with buy/sell price = 0 will set this option to disabled.

shop.settings.buy-greater-than-sell set to true (default) will require shops to have a buy price greater than the sell price. That way, players won't accidentally create a shop that is a permanent loss.

Other

If shop.settings.add-shulkershop-lore is set to true (default), mined Shulkerbox shops will have a lore text, including details about the shop, like Item sold, Owner, etc (customizable via the translation files).

If shop.settings.custom-amount-transactions is set to true (default), players can buy any amount of items via the Sign GUI (as long as they can afford/carry this much or as long as the shop owner can afford/buy/sell this amount). If false, this option won't render in the GUI at all.

Hologram messages

  • shop.settings.hologram-messages.enabled enables users to create custom messages above their Shop enabled by default.
  • shop.settings.hologram-messages.show-always toggles if these messages should always be visible, regardless of shops.hologram.distance.show-items-first
  • shop.settings.hologram-messages.line-count-default sets the default amount of lines that can be used for Hologram messages. Default = 1 (1-4). This setting will be overridden if permissions.hologram-message-line-count is true.
  • shop.settings.hologram-messages.show-empty-shop-always toggles if should show up regardless of `shops.hologram.distance.show-items-first.

Shop commands

You can enable this feature if you want to execute commands on certain actions like buying or selling items. The commands defined here apply to all admin/player shops, however using the shopCommands.yml or the ingame editor available under /ecsadmin shop-commands (admin use only!), one can also add commands to individual shops. Since the length

Economy

  • Under economy.server-currency, you can define the currency that you are using for your server. Default = $
  • If you wish to use XP points instead of a Vault based economy, either turn this option on or don't add Vault/an Economy plugin, as then this option will be toggled to true automatically.

Commands

If your server is not using the /shop or /adminshop command for anything else, you can enable aliases for the /ecs and /ecsadmin commands!

  • /ecs works with /shop too if commands.alias.ecs-shop is set to true (default: false) Change requires Restart.
  • /ecsadmin works with /adminshop too if commands.alias.ecsadmin-adminshop is set to true (default: false) Change requires Restart.

The /checkprofits command has a constant alias of /cp, but you can set how many purcheses/sales should be shown per page. (Default: 4)

Permissions

  • If permissions.create-shops is set to true (default: false), players will require the permission ecs.shops.limit.X in order to create shops. X is the maximum amount of shops a player can create. If infinite at a certain rank, just set it to 999999 or any ridiculously high number.
  • hologram-message-limit limits how many shops can receive custom hologram messages. Permission: ecs.shops.hologram.messages.limit.X Default=false
  • hologram-message-line-count defines how many lines you can use for custom hologram messages. Permission: ecs.shops.hologram.messages.lines.X Default=false

Tasks

The option tasks.check-for-removed-shops will enable a timed scanner that looks for broken shops, that are still saved, but actually do no longer exist. This might occur, when another plugin removes a chest shop. If the option is causing too much lag, set it to false (default: true). Change requires Restart.

Database

There are currently 2 types of databases available.

  • SQLite
  • MySQL By default SQLite is enabled as it will very likely work for any server. However, if you are running a big server and have the capabilities to run MySQL, we'd advise you to change to this model.

Migrating Databases

We do not have a system in place to mirror data between different types of databases, however since shops are saved in the minecraft world itself, those won't be lost - whenever a player interacts with a chest that is not in the database, but indeed a shop, it will automatically be re-added. You will however loose data that is saved in the database only like /checkprofits data or custom hologram messages. The holograms of shops will also not display until a player interacts with the shop for the first time. If none of these is a problem for you, migrating should be as simple as changing the database.type and in case of MySQL, adding the required information.

Integration

This section allows you to disable some of our integrations, should they cause any troubles and are actually not important for you.

  • WorldGuard - This integration allows custom WorldGuard flags to manage shop creation and access in areas. These need to be loaded on load, so it might break on a /reload or when using Plugman to add/remove ECS. If you simply reboot your server every change (as is recommended practice anyway), this should not affect you at all.
  • We are looking into further integrations with popular claim plugins, feel free to contact us on discord if you have a suggestion for a popular integration!

Other

  • If other.notify-op-of-updates is true (default) Operators will receive a message when logging in if a new version of the plugin has been released.
  • If other.notify-op-of-overlapping-gui-items is true (default) Operators will be informed on login when items that usually should not overlap or overlapping. Items that may overlap are different types of rotations, toggle buttons, as well as the view-container/view-container-as-admin option. This may happen if GUIs have been customized and the automatic updater doesn't succeed.
  • other. notify-op-of-overflowing-gui-items (default = true) informs Operators if items are placed in a spot where they are outside the gui and therefore invisible. This may happen if GUIs have been customized and the automatic updater doesn't succeed.

Protection

Since v1.5.4, ECS now supports shop protection. This feature is still partially experimental and some edge cases may not be considered yet. If you run into any of those, please contact us on discord and we'll be happy to help out. The feature is on by default protection.prevent-shop-destruction.

Default configuration

# EzChestShop plugin configuration
# Before starting to config, please note that any usage of TABs in the config file may break the plugin so avoid using tabs and use space.
# If you need help/found a bug, please join our Discord: https://discord.gg/rSfsqgCqBZ
language: Locale_EN
shops:
  hologram:
    # holograms are all shown in the async way and they won't waste a single tick / nor they are buggy like some other plugins
    show-holograms: true
    # represents the holographic texts of chestshops. Use %item% to display the item's display name.
    # Use [item] for 1 Line to display the floating item. Use %buy% for buy price and %sell% for sell price.
    # %currency% is defined under economy.server-currency and %owner% represents the shops creator.
    # %maxbuy% & %maxsell% can be used to define the maximum amount a player can buy/sell to a shop at this time.
    # The HTML like <buy></buy> Syntax allows the plugin to remove parts of the message if buy/sell are disabled.
    holo-structure:
      - "<emptyShopInfo/>"
      - "<custom1/>"
      - "<custom2/>"
      - "<custom3/>"
      - "<custom4/>"
      - "<buy>&fBuy: &a%buy% %currency%</buy><separator> &f| </separator><sell>&fSell: &c%sell% %currency%</sell>"
      - "&d%item%"
      - "<itemdata1/>"
      - "<itemdata2/>"
      - "<itemdata3/>"
      - "<itemdata4/>"
      - "<itemdataRest/>"
      - "[item]"
    holo-structure-adminshop:
      - "<custom1/>"
      - "<custom2/>"
      - "<custom3/>"
      - "<custom4/>"
      - "<buy>&fBuy: &a%buy% %currency%</buy><separator> &f| </separator><sell>&fSell: &c%sell% %currency%</sell>"
      - "&d%item%"
      - "<itemdata1/>"
      - "<itemdata2/>"
      - "<itemdata3/>"
      - "<itemdata4/>"
      - "<itemdataRest/>"
      - "[item]"
    # Define a custom Line spacing multiplier. 1 is default.
    holo-line-spacing: 1
    # hologram will get removed after x seconds if plugin doesn't detect any movement toward chest shop (default: 10)
    hologram-disappearance-delay: 10
    # Allows players to rotate their Holograms to be displayed on different sides of the Block.
    allow-rotation: true
    # an alternative hologram display system, which is slower but provides easier visibility of nearby shops.
    distance:
      toggled: true
      # Defines the range at which shops will render holograms (default: 10.0)
      range: 10.0
      # Set if items should be rendered first and holograms only when looking at the shop directly.
      show-items-first: false
  # Define which containers are applicable for chest shops:
  container:
    chests: true
    trapped-chests: true
    barrels: true
    shulkers: false
  display:
    # define how the plugin should format displayed numbers, use: https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/text/DecimalFormat.html
    number-format:
      gui: "###,###.##"
      chat: "###,###.##"
      hologram: "###,###.##"
  settings:
    # Define the default settings when creating a shop:
    defaults:
      transaction-message: false
      disable-buying: false
      disable-selling: false
      rotation: "up"
      share-profit: true
    # If set to true, "/ecs create 12 0" will automatically disable selling(or buying if "/ecs create 0 12")
    zero-price-equals-disabled: true
    # If set to true, this setting will require players to use a buy price that is greater than the sell price.
    buy-greater-than-sell: true
    # If set to true Shulker shops will be given some Lore when mined (Set inside the language files)
    add-shulkershop-lore: true
    # Toggle if custom amount buying or selling should be enabled.
    custom-amount-transactions: true
    hologram-messages:
      enabled: true
      # When true, custom hologram messages will be displayed even if hologram.distance.show-items-first is enabled.
      show-always: false
      # Sets how many lines can be used for custom hologram messages. If permissions.hologram-message-line-count is true, this setting is overridden.
      line-count-default: 1
      # If true, this will always show players if a shop is empty.
      show-empty-shop-always: true
economy:
  # Used to replace %currency% for the language files and the 2nd hologram line.
  server-currency: $
commands:
  # Register easier to remember alias on server startup: /shop and /adminshop
  alias:
    ecs-shop: false
    ecsadmin-adminshop: false
  checkprofit-lines-per-page: 4
permissions:
  # If set to true, players require the permission "ecs.shops.limit.X" where X is the maximum amount of shops a player can create.
  create-shops: false
  # Limit the amount of hologram messages a player can create. Use "ecs.shops.hologram.messages.limit.X"
  hologram-message-limit: false
  # Specify how many lines a player can use for their hologram messages. Use "ecs.shops.hologram.messages.lines.X"
  hologram-message-line-count: false
tasks:
  # Normally, This option is for when server(basically other plugins) remove the chest shop, in this case, it could result in some issues
  # if this is causing so much lag, you can turn this off (requires restart)
  check-for-removed-shops: false
#databases section
database:
  #available types SQLite & MySQL  (MySQL is recommended for the best  & big servers)
  type: SQLite
  #MySQL database information in case of usage
  mysql:
    ip: 127.0.0.1
    port: 3306
    tables-prefix: ecs_
    database: TheDatabaseName
    username: TheUsername
    password: ThePassword
    max-pool: 10
    ssl: false
integration:
  worldguard: true
other:
  notify-op-of-updates: true
  # When certain items are overlapping/overflowing in the gui configuration, the plugin will notify ops to take actions.
  # If you don't temper with the guis, you should never receive a notification and gui updates will happen automatically.
  notify-op-of-overlapping-gui-items: true
protection:
  prevent-shop-destruction: true