mirror of
https://github.com/Artillex-Studios/AxMinions.git
synced 2025-01-05 18:37:44 +01:00
Minimum charge
This commit is contained in:
parent
7dcbb3ae64
commit
2d6b05090e
@ -48,6 +48,8 @@ class Config(file: File, stream: InputStream) {
|
||||
@JvmStatic
|
||||
fun CHARGE_PRICE() = AxMinionsAPI.INSTANCE.getConfig().get("charge.price", 10000.0)
|
||||
@JvmStatic
|
||||
fun MINIMUM_CHARGE() = AxMinionsAPI.INSTANCE.getConfig().get("charge.minimum-charge", 30)
|
||||
@JvmStatic
|
||||
fun TIMER_FORMAT() = AxMinionsAPI.INSTANCE.getConfig().get("timer-format", 1)
|
||||
@JvmStatic
|
||||
fun GUI_SIZE() = AxMinionsAPI.INSTANCE.getConfig().get<Int>("gui.size")
|
||||
|
@ -60,6 +60,8 @@ class Messages(file: File, stream: InputStream) {
|
||||
@JvmStatic
|
||||
fun CHARGE_FAIL() = AxMinionsAPI.INSTANCE.getMessages().get<String>("charge.not-enough-money")
|
||||
@JvmStatic
|
||||
fun CHARGE_NOT_ENOUGH_TIME_PASSED() = AxMinionsAPI.INSTANCE.getMessages().get<String>("charge.not-enough-time-passed")
|
||||
@JvmStatic
|
||||
fun WRONG_TOOL() = AxMinionsAPI.INSTANCE.getMessages().get<String>("tools.wrong-tool")
|
||||
@JvmStatic
|
||||
fun ERROR_INVENTORY_FULL() = AxMinionsAPI.INSTANCE.getMessages().get<String>("errors.inventory-full")
|
||||
|
@ -183,8 +183,8 @@ class MinionInventoryListener : Listener {
|
||||
|
||||
val chargeSeconds = (minion.getCharge() - System.currentTimeMillis()) / 1000
|
||||
|
||||
if ((Config.MAX_CHARGE() * 60) - chargeSeconds < 10) {
|
||||
println("Not enough time has passed!")
|
||||
if ((Config.MAX_CHARGE() * 60) - chargeSeconds < Config.MINIMUM_CHARGE()) {
|
||||
player.sendMessage(StringUtils.formatToString(Messages.PREFIX() + Messages.CHARGE_NOT_ENOUGH_TIME_PASSED()))
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,7 @@ charge:
|
||||
amount: 1800 # in seconds
|
||||
max-charge: 1440 # in minutes
|
||||
price: 10000
|
||||
minimum-charge: 30 # in seconds
|
||||
|
||||
# 1 - HH:MM:SS, for example 01:25:35
|
||||
# 2 - short format, for example 20m
|
||||
@ -125,4 +126,4 @@ gui:
|
||||
debug: false
|
||||
|
||||
# Do not change!
|
||||
config-version: 7
|
||||
config-version: 8
|
||||
|
@ -68,9 +68,10 @@ directions:
|
||||
charge:
|
||||
charge: "<green>You have added <white>30 minutes</white> of charge to your minion!"
|
||||
not-enough-money: "<red>You don't have enough money to charge this minion!"
|
||||
not-enough-time-passed: "<red>Your minion is nearly fully charged! Wait a bit before charging it again!"
|
||||
|
||||
tools:
|
||||
wrong-tool: "<red>You can't place this item as the tool if this minion!"
|
||||
|
||||
# Do not change!
|
||||
config-version: 3
|
||||
config-version: 4
|
Loading…
Reference in New Issue
Block a user