If buys > sells then: - * - *
- * price = p + p * v1 * 0.01 * (b/(b+s)) + p * v2 * 0.01
- *
- *
- *
If sells > buys then: - * - *
- * price = p - p * v1 * 0.01 * (s/(b+s)) - p * v2 * 0.01
- *
- *
- *
Where: - * - *
p
is the previous price.
- *
- *
v1
is the max volatility.
- *
- *
v2
is the min volatility.
- *
- *
b
is the average buy value.
- *
- *
s
is the average sell value.
- *
- * @param p The previous price.
- * @param volatility The volatility.
- * @param b The average buy value.
- * @param s The average sell value.
- * @return The new price.
- */
- public static double calculateNewPrice(double p, double[] volatility, double b, double s) {
-
- double total = b + s;
-
- // Check if buys > sells and calculate the new price based on the formula.
- if (b > s) {
- return p + p * volatility[0] * 0.01 * (b / total) + p * 0.01 * volatility[1];
- } else if (b < s) {
- return p - p * volatility[0] * 0.01 * (s / total) - p * 0.01 * volatility[1];
- } else {
- return p;
- }
-
- }
-
-
+
}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 97b6784..915b726 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -1,139 +1,41 @@
-
-# ░█████╗░██╗░░░██╗████████╗░█████╗░░░░░░░████████╗██╗░░░██╗███╗░░██╗███████╗
-# ██╔══██╗██║░░░██║╚══██╔══╝██╔══██╗░░░░░░╚══██╔══╝██║░░░██║████╗░██║██╔════╝
-# ███████║██║░░░██║░░░██║░░░██║░░██║█████╗░░░██║░░░██║░░░██║██╔██╗██║█████╗░░
-# ██╔══██║██║░░░██║░░░██║░░░██║░░██║╚════╝░░░██║░░░██║░░░██║██║╚████║██╔══╝░░
-# ██║░░██║╚██████╔╝░░░██║░░░╚█████╔╝░░░░░░░░░██║░░░╚██████╔╝██║░╚███║███████╗
-# ╚═╝░░╚═╝░╚═════╝░░░░╚═╝░░░░╚════╝░░░░░░░░░░╚═╝░░░░╚═════╝░╚═╝░░╚══╝╚══════╝
-
-## -- Auto-Tune Config File -- ##
-
-## See the wiki for info on each setting: https://github.com/Unprotesting/Auto-Tune/wiki
-
-## -- General Settings -- ##
-
-## Enable/Disable integrated Web Server.
-## Info: Use /trade to view the web-server
-web-server-enabled: true
-
-## Port for integrated Web Server (If enabled)
-## Make sure to port-forward and disable firewalls for this port.
-port: 8123
-
-## Time Period in minutes
-## Info: When decreasing or increasing this adjust your volatility settings accordingly
-time-period: 30
-
-## GUI Shop Menu title
-menu-title: 'Shop'
-
-## GUI Shop Menu background
-## Info: Use 'NONE' for no background
-background: 'BLACK_STAINED_GLASS_PANE'
-
-## How often auto-sell updates in ticks
-## Info: Set this higher if few players use autosell
-## Info: Set it lower if many players use autosell
-auto-sell-update-period: 10
-
-## How often players are shown their auto-sell profits in ticks
-auto-sell-profit-update-period: 600
-
-## Global number format
-number-format: '###,###,###,###,##0.00'
-
-## Enable Enchantments
-enable-enchantments: true
-
-## -- Pricing Model Settings -- ##
-
-## Percentage difference in sell price to buy price
-sell-price-difference: 15.0
-
-## Maximum Volatility per Time Period for the Variable Volatility price calculation algorithm as a percentage of total price
-max-volatility: 0.5
-
-## Minimum Volatility per Time Period for the Fixed Volatility price calculation algorithm in economy units
-min-volatility: 0.05
-
-## -- Data Selection Settings -- ##
-
-## Info: When setting your data selection algorithm use a site such as https://www.desmos.com/calculator
-## Info: Data selection uses the equation y=m(x^z)+c, for example the default is y=0.075(x^(1.6))+0.55
-
-## 'm' in equation: y=m(x^z)+c
-data-selection-m: 0.05
-
-## 'z' in equation: y=m(x^z)+c
-data-selection-z: 1.75
-
-## 'c' in equation: y=m(x^z)+c
-data-selection-c: 0.55
-
-## -- Other Economy Settings --
-
-## Minimum players needed, to be online, for prices to update
-## Info: It is recommended to keep this above 0
-update-prices-threshold: 1
-
-## The symbol that appears before all currency
-currency-symbol: '$'
-
-## Enable sell price difference variation to ease out sell price variation
-sell-price-difference-variation-enabled: true
-
-## Starting percentage sell price difference for sell price variation
-sell-price-difference-variation-start: 30.0
-
-## Time in minutes until sell price reaches sell-price-difference set in pricing model settings (default 4 weeks)
-sell-price-variation-time-period: 43200
-
-## Time in minutes that the sell-price-difference updates
-sell-price-variation-update-period: 30
-
-## Interest rate per interest-rate-update-period
-## Info: This is the increase in the current debt payment per-time period
-interest-rate: 0.05
-
-## Time period in ticks between updates of the interest rate for users loans
-interest-rate-update-period: 1200
-
-## Disable the max-buy/max-sells for items
-## Info: Don't do this unless you know what your doing.
-## Info: If this is enabled, it is likely to lead to exploitation on servers with under 10 concurrent players
-disable-max-buys-sells: false
-
-## The lowest value in $ a player can go into debt
-## For example if a player has $3,000 and this is set to 1000 a player can take out a loan up to $2,000
-max-debt-value: 1000.0
-
-## The percentage value to decrease items sold with enchantments
-## Info: This value should be above 0 because it limits the exploit-ability of enchantments
-## Info: This doesn't affect the buy-price.
-enchantment-limiter: 10.0
-
-## The percentage value to decrease items sold with a loss in durability
-## Info: This is applied ON TOP of the durability algorithm to limit the exploit-ability of selling tools
-durability-limiter: 15.0
-
-## -- Other Settings --
-
-## Ignore AFK players in price calculations/online checks
-## Info: Turning this on will mean the price will only update when there's a player that is not AFK
-## Info: This only applies to essentials AFK and you must have essentials installed for this to work
-ignore-afk: true
-
-## Enable the Auto-Tune tutorial for players (the messages that are displayed to players periodically)
-## Keep this on to encourage purchasing turn it off if it is distracting
-tutorial: true
-
-## Time in seconds between messages
-tutorial-message-period: 360
-
-## Data storage location
-data-location: 'plugins/Auto-Tune/'
-
-## The level of the logger to use
-## Info: This is the level of logging that is outputted to the console
-## Info: Possible values are: SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST
-log-level: 'INFO'
+# The default rate that prices are updated. Every price update the max-buys and sells are also reset.
+# Increase this for low player counts, decrease for high player counts.
+time-period: 10
+
+# The default maximum change in a given time-period for an item.
+# Increase this for high player counts, decrease for low player counts.
+volatility: 0.25
+
+# The default percentage difference in the sell price from the buy price.
+# Increase this for low player counts, decrease for high player counts.
+sell-price-difference: 20
+
+# The minimum number of players required to be online to run price updates.
+# If your servers prices are all over the place this is a good option to increase.
+# It helps to limit price exploits for sensitive items.
+# If your servers prices aren't changing check there are enough players online.
+minimum-players: 2
+
+# The interest applied on loans each minute.
+# If inflation is to high you can increase this.
+# If inflation is to low you can decrease this.
+interest: 0.05
+
+# The rate that the tutorial messages are sent.
+# If they are getting annoying you can increase this value.
+tutorial-update: 300
+
+# The port of the web-server.
+port: 8989
+
+# The background for GUI's.
+background: "BLACK_STAINED_GLASS_PANE"
+
+# The log level, can be one of the following:
+# SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL.
+# The default log level is INFO.
+# This will log all messages with the level or above.
+log-level: "INFO"
+
+# The locale to use for formatting.
+locale: "en_US"
\ No newline at end of file
diff --git a/src/main/resources/enchantments.yml b/src/main/resources/enchantments.yml
deleted file mode 100644
index 2cb12df..0000000
--- a/src/main/resources/enchantments.yml
+++ /dev/null
@@ -1,175 +0,0 @@
-
-# ░█████╗░██╗░░░██╗████████╗░█████╗░░░░░░░████████╗██╗░░░██╗███╗░░██╗███████╗
-# ██╔══██╗██║░░░██║╚══██╔══╝██╔══██╗░░░░░░╚══██╔══╝██║░░░██║████╗░██║██╔════╝
-# ███████║██║░░░██║░░░██║░░░██║░░██║█████╗░░░██║░░░██║░░░██║██╔██╗██║█████╗░░
-# ██╔══██║██║░░░██║░░░██║░░░██║░░██║╚════╝░░░██║░░░██║░░░██║██║╚████║██╔══╝░░
-# ██║░░██║╚██████╔╝░░░██║░░░╚█████╔╝░░░░░░░░░██║░░░╚██████╔╝██║░╚███║███████╗
-# ╚═╝░░╚═╝░╚═════╝░░░░╚═╝░░░░╚════╝░░░░░░░░░░╚═╝░░░░╚═════╝░╚═╝░░╚══╝╚══════╝
-
-## -- Auto-Tune Enchantments File -- ##
-
-config:
- position: 22
- block: 'ENCHANTED_BOOK'
- background: 'GRAY_STAINED_GLASS_PANE'
- back-menu-button-enabled: true
- display-name: 'Enchantments Shop'
-
-enchantments:
- power:
- price: 300.00 ## <- An added price for buying/selling an item with this enchantment
- ratio: 0.15 ## <- Another added percentage of the item bought/sold with this enchantment
- ## Info: An item worth usually 100 will cost (100*0.3)+600=630
- ## Provides extra damage when shooting arrows from bows
- ## sell-price-difference: 10.0 <- Add a custom sell-price-difference
- ## locked: true <- Example of a locked item
- ## max-volatility: 1.0 <- Add a custom max-volatility
- ## min-volatility: 0.1 <- Add a custom min-volatility
- flame:
- price: 350.00
- ratio: 0.2
- ## Sets entities on fire when hit by arrows shot from a bow
- infinity:
- price: 750.00
- ratio: 0.3
- ## Provides infinite arrows when shooting a bow
- punch:
- price: 450.00
- ratio: 0.2
- ## Provides a knockback when an entity is hit by an arrow from a bow
- binding_curse:
- price: 40.00
- ratio: 0.05
- ## Item cannot be removed
- channeling:
- price: 300.00
- ratio: 0.5
- ## Strikes lightning when a mob is hit with a trident if conditions are stormy
- sharpness:
- price: 350.00
- ratio: 0.2
- ## Increases damage against all targets
- bane_of_arthropods:
- price: 350.00
- ratio: 0.4
- ## Increases damage against arthropod targets
- smite:
- price: 350.00
- ratio: 0.2
- ## Increases damage against undead targets
- depth_strider:
- price: 450.00
- ratio: 0.2
- ## Increases walking speed while in water
- efficiency:
- price: 450.00
- ratio: 0.2
- ## Increases the rate at which you mine/dig
- unbreaking:
- price: 450.00
- ratio: 0.15
- ## Decreases the rate at which a tool looses durability
- fire_aspect:
- price: 500.00
- ratio: 0.25
- ## When attacking a target, has a chance to set them on fire
- frost_walker:
- price: 550.00
- ratio: 0.25
- ## Freezes any still water adjacent to ice / frost which player is walking on
- impaling:
- price: 300.00
- ratio: 0.2
- ## Deals more damage to mobs that live in the ocean
- knockback:
- price: 500.00
- ratio: 0.2
- ## All damage to other targets will knock them back when hit
- fortune:
- price: 600.00
- ratio: 0.3
- ## Provides a chance of gaining extra loot when destroying blocks
- looting:
- price: 600.00
- ratio: 0.15
- ## Provides a chance of gaining extra loot when killing monsters
- loyalty:
- price: 550.00
- ratio: 0.2
- ## Causes a thrown trident to return to the player who threw it
- luck_of_the_sea:
- price: 350.00
- ratio: 0.15
- ## Decreases odds of catching worthless junk
- lure:
- price: 250.00
- ratio: 0.1
- ## Increases rate of fish biting your hook
- mending:
- price: 2000.00
- ratio: 0.3
- ## Allows mending the item using experience orbs
- multishot:
- price: 400.00
- ratio: 0.1
- ## Shoot multiple arrows from crossbows
- respiration:
- price: 300.00
- ratio: 0.1
- ## Decreases the rate of air loss whilst underwater
- piercing:
- price: 350.00
- ratio: 0.1
- ## Crossbow projectiles pierce entities
- protection:
- price: 450.00
- ratio: 0.15
- ## Provides protection against environmental damage
- blast_protection:
- price: 450.00
- ratio: 0.2
- ## Provides protection against explosive damage
- feather_falling:
- price: 450.00
- ratio: 0.15
- ## Provides protection against fall damage
- fire_protection:
- price: 450.00
- ratio: 0.2
- ## Provides protection against fire damage
- projectile_protection:
- price: 450.00
- ratio: 0.2
- ## Provides protection against projectile damage
- quick_charge:
- price: 400.00
- ratio: 0.2
- ## Charges crossbows quickly
- riptide:
- price: 500.00
- ratio: 0.2
- ## When it is rainy, launches the player in the direction their trident is thrown
- silk_touch:
- price: 650.00
- ratio: 0.3
- ## Allows blocks to drop themselves instead of fragments (for example, stone instead of cobblestone)
- soul_speed:
- price: 600.00
- ratio: 0.2
- ## Walk quicker on soul blocks
- sweeping:
- price: 500.00
- ratio: 0.2
- ## Increases damage against targets when using a sweep attack
- thorns:
- price: 600.00
- ratio: 0.3
- ## Damages the attacker
- vanishing_curse:
- price: 20.00
- ratio: 0.05
- ## Item disappears instead of dropping
- aqua_affinity:
- price: 350.00
- ratio: 0.15
- ## Increases the speed at which a player may mine underwater
\ No newline at end of file
diff --git a/src/main/resources/messages.yml b/src/main/resources/messages.yml
index 3212677..3f8a779 100644
--- a/src/main/resources/messages.yml
+++ b/src/main/resources/messages.yml
@@ -1,75 +1,66 @@
-
-# ░█████╗░██╗░░░██╗████████╗░█████╗░░░░░░░████████╗██╗░░░██╗███╗░░██╗███████╗
-# ██╔══██╗██║░░░██║╚══██╔══╝██╔══██╗░░░░░░╚══██╔══╝██║░░░██║████╗░██║██╔════╝
-# ███████║██║░░░██║░░░██║░░░██║░░██║█████╗░░░██║░░░██║░░░██║██╔██╗██║█████╗░░
-# ██╔══██║██║░░░██║░░░██║░░░██║░░██║╚════╝░░░██║░░░██║░░░██║██║╚████║██╔══╝░░
-# ██║░░██║╚██████╔╝░░░██║░░░╚█████╔╝░░░░░░░░░██║░░░╚██████╔╝██║░╚███║███████╗
-# ╚═╝░░╚═╝░╚═════╝░░░░╚═╝░░░░╚════╝░░░░░░░░░░╚═╝░░░░╚═════╝░╚═╝░░╚══╝╚══════╝
-
-## -- Auto-Tune Messages File -- ##
-
-## See the wiki for info on each setting: https://github.com/Unprotesting/Auto-Tune/wiki
-
-## Buying items
# Placeholders: