From 2eb51ba9a6703454edc5a06b6d031c1704e750ff Mon Sep 17 00:00:00 2001 From: lbenav8095 Date: Mon, 25 Dec 2023 13:18:38 -0600 Subject: [PATCH] Added 'Withdraw.*' and 'Deposit.*' BlobMessages Fixed ConfigDecorator in order to generate the default config.yml file in case of being the first time of loading a jar. --- .../bloblib/entities/ConfigDecorator.java | 8 ++++ src/main/resources/bloblib_lang.yml | 48 ++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/main/java/us/mytheria/bloblib/entities/ConfigDecorator.java b/src/main/java/us/mytheria/bloblib/entities/ConfigDecorator.java index 2a8e9b51..825caa2f 100644 --- a/src/main/java/us/mytheria/bloblib/entities/ConfigDecorator.java +++ b/src/main/java/us/mytheria/bloblib/entities/ConfigDecorator.java @@ -7,6 +7,7 @@ import us.mytheria.bloblib.utilities.ResourceUtil; import java.io.File; +import java.io.IOException; public class ConfigDecorator { private final JavaPlugin plugin; @@ -15,6 +16,13 @@ public class ConfigDecorator { public ConfigDecorator(JavaPlugin plugin) { this.plugin = plugin; File file = new File(plugin.getDataFolder(), "config.yml"); + if (!file.exists()) { + try { + file.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + } ResourceUtil.updateYml(file, plugin); plugin.reloadConfig(); this.listenersSection = ListenersSection.of(plugin); diff --git a/src/main/resources/bloblib_lang.yml b/src/main/resources/bloblib_lang.yml index 8e26cbbf..9b38c8c7 100644 --- a/src/main/resources/bloblib_lang.yml +++ b/src/main/resources/bloblib_lang.yml @@ -271,4 +271,50 @@ Economy: Number-Exception: Type: CHAT Message: '&cProvided amount is not a valid number' - BlobSound: System.Alert \ No newline at end of file + BlobSound: System.Alert +Withdraw: + Amount: + Type: TITLE + Title: '&f&lAMOUNT' + Subtitle: '&7Type amount to withdraw' + Amount-Timeout: + Type: TITLE + Title: '&c&lTIMEOUT' + Subtitle: '&7You took too long to input amount' + BlobSound: Builder.Timeout + Insufficient-Balance: + Type: TITLE + Title: '&c&lNO FUNDS' + Subtitle: '&7Not enough funds to withdraw' + BlobSound: System.Alert + Amount-Too-Small: + Type: TITLE + Title: '&c&lTOO SMALL' + Subtitle: '&7Amount is too small to withdraw' + BlobSound: System.Alert + Successful: + Type: CHAT + Message: 'You have withdrawn %display%' +Deposit: + Amount: + Type: TITLE + Title: '&f&lAMOUNT' + Subtitle: '&7Type amount to deposit' + Amount-Timeout: + Type: TITLE + Title: '&c&lTIMEOUT' + Subtitle: '&7You took too long to input amount' + BlobSound: Builder.Timeout + Insufficient-Balance: + Type: TITLE + Title: '&c&lNO FUNDS' + Subtitle: '&7Not enough funds to deposit' + BlobSound: System.Alert + Amount-Too-Small: + Type: TITLE + Title: '&c&lTOO SMALL' + Subtitle: '&7Amount is too small to deposit' + BlobSound: System.Alert + Successful: + Type: CHAT + Message: 'You have deposited %display%' \ No newline at end of file