From c5e90083d307b8846cb9b96f566a15d8ca3678df Mon Sep 17 00:00:00 2001 From: Sven Date: Sun, 5 Apr 2026 19:28:50 +0200 Subject: [PATCH 1/3] Remove double spaces in some messages --- .../kotlin/net/trueog/diamondbankog/InventorySnapshotUtils.kt | 4 ++-- src/test/kotlin/net/trueog/diamondbankog/PayTest.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/net/trueog/diamondbankog/InventorySnapshotUtils.kt b/src/main/kotlin/net/trueog/diamondbankog/InventorySnapshotUtils.kt index d6965d7..ecac0ce 100644 --- a/src/main/kotlin/net/trueog/diamondbankog/InventorySnapshotUtils.kt +++ b/src/main/kotlin/net/trueog/diamondbankog/InventorySnapshotUtils.kt @@ -41,7 +41,7 @@ object InventorySnapshotUtils { CommonOperations.shardsToDiamondsFull( excessShards ) - } has been deposited into your bank account" + } has been deposited into your bank account" ) ) } @@ -77,7 +77,7 @@ object InventorySnapshotUtils { CommonOperations.shardsToDiamondsFull( excessShards + excessDiamondsInShards ) - } has been deposited into your bank account" + } has been deposited into your bank account" ) ) } diff --git a/src/test/kotlin/net/trueog/diamondbankog/PayTest.kt b/src/test/kotlin/net/trueog/diamondbankog/PayTest.kt index 3d78dbd..b6101a0 100644 --- a/src/test/kotlin/net/trueog/diamondbankog/PayTest.kt +++ b/src/test/kotlin/net/trueog/diamondbankog/PayTest.kt @@ -283,7 +283,7 @@ class PayTest { verify { otherPlayer.sendMessage( Component.text( - "DiamondBank-OG: Player has paid you $successDiamondText." + "DiamondBank-OG: Player has paid you $successDiamondText." ) ) } -- 2.47.3 From b16163ff81359db5f6e967a9652865f4ff34390d Mon Sep 17 00:00:00 2001 From: Sven Date: Sun, 5 Apr 2026 19:51:35 +0200 Subject: [PATCH 2/3] Remove unnecessary MiniMessage tags and more double spaces --- .../net/trueog/diamondbankog/commands/Deposit.kt | 2 +- .../kotlin/net/trueog/diamondbankog/commands/Pay.kt | 6 +++--- .../net/trueog/diamondbankog/commands/Withdraw.kt | 4 ++-- .../kotlin/net/trueog/diamondbankog/DepositTest.kt | 8 ++++---- src/test/kotlin/net/trueog/diamondbankog/PayTest.kt | 10 +++++----- .../kotlin/net/trueog/diamondbankog/WithdrawTest.kt | 10 +++++----- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/kotlin/net/trueog/diamondbankog/commands/Deposit.kt b/src/main/kotlin/net/trueog/diamondbankog/commands/Deposit.kt index 7d8700c..f4dc2cc 100644 --- a/src/main/kotlin/net/trueog/diamondbankog/commands/Deposit.kt +++ b/src/main/kotlin/net/trueog/diamondbankog/commands/Deposit.kt @@ -62,7 +62,7 @@ internal class Deposit( CommonOperations.diamondsToShards(amount).getOrElse { sender.sendMessage( mm.deserialize( - "${config.prefix}: Diamonds can only have one decimal digit. Issue /diamondbankhelp for more information." + "${config.prefix}: Diamonds can only have one decimal digit. Issue /diamondbankhelp for more information." ) ) return true diff --git a/src/main/kotlin/net/trueog/diamondbankog/commands/Pay.kt b/src/main/kotlin/net/trueog/diamondbankog/commands/Pay.kt index c2511e2..288a2b1 100644 --- a/src/main/kotlin/net/trueog/diamondbankog/commands/Pay.kt +++ b/src/main/kotlin/net/trueog/diamondbankog/commands/Pay.kt @@ -78,7 +78,7 @@ internal class Pay( CommonOperations.diamondsToShards(amount).getOrElse { sender.sendMessage( mm.deserialize( - "${config.prefix}: Diamonds can only have one decimal digit. Issue /diamondbankhelp for more information." + "${config.prefix}: Diamonds can only have one decimal digit. Issue /diamondbankhelp for more information." ) ) return true @@ -148,7 +148,7 @@ internal class Pay( receiver.uniqueId, luckPerms, ) - } ${receiver.name}." + }${receiver.name}." ) ) @@ -161,7 +161,7 @@ internal class Pay( sender.uniqueId, luckPerms, ) - } ${sender.name} has paid you ${ + }${sender.name} has paid you ${ CommonOperations.shardsToDiamondsFull( shards ) diff --git a/src/main/kotlin/net/trueog/diamondbankog/commands/Withdraw.kt b/src/main/kotlin/net/trueog/diamondbankog/commands/Withdraw.kt index b3b92c5..891a04f 100644 --- a/src/main/kotlin/net/trueog/diamondbankog/commands/Withdraw.kt +++ b/src/main/kotlin/net/trueog/diamondbankog/commands/Withdraw.kt @@ -65,7 +65,7 @@ internal class Withdraw( CommonOperations.diamondsToShards(amount).getOrElse { sender.sendMessage( mm.deserialize( - "${config.prefix}: Diamonds can only have one decimal digit. Issue /diamondbankhelp for more information." + "${config.prefix}: Diamonds can only have one decimal digit. Issue /diamondbankhelp for more information." ) ) return true @@ -106,7 +106,7 @@ internal class Withdraw( CommonOperations.shardsToDiamondsFull( shardsToWithdraw ) - } because your bank only contains ${ + } because your bank only contains ${ CommonOperations.shardsToDiamondsFull( bankShards ) diff --git a/src/test/kotlin/net/trueog/diamondbankog/DepositTest.kt b/src/test/kotlin/net/trueog/diamondbankog/DepositTest.kt index 84bddac..4b87365 100644 --- a/src/test/kotlin/net/trueog/diamondbankog/DepositTest.kt +++ b/src/test/kotlin/net/trueog/diamondbankog/DepositTest.kt @@ -358,9 +358,9 @@ class DepositTest { @ParameterizedTest(name = "{0}") @DisplayName("Deposit with invalid argument should fail") @CsvSource( - "Not a number, abc, Invalid argument", - "Negative, -1, You cannot deposit a negative or zero amount", - "Zero, 0, You cannot deposit a negative or zero amount", + "Not a number, abc, Invalid argument", + "Negative, -1, You cannot deposit a negative or zero amount", + "Zero, 0, You cannot deposit a negative or zero amount", "More than one decimal digit, 1.11, Diamonds can only have one decimal digit. Issue /diamondbankhelp for more information", ) fun depositInvalidArg(@Suppress("UNUSED_PARAMETER") name: String, argument: String, errorMessage: String) = @@ -372,7 +372,7 @@ class DepositTest { waitForCoroutines(scope) assertAll( - { verify { player.sendMessage(Component.text("DiamondBank-OG: $errorMessage.")) } }, + { verify { player.sendMessage(Component.text("DiamondBank-OG: $errorMessage.")) } }, { coVerify(exactly = 0) { balanceManager.addToBankShards(any(), any()) } }, { assertEquals(5, inventory.countDiamonds(), "Diamond count") }, { assertFalse(inventory.isLocked(), "Inventory locked") }, diff --git a/src/test/kotlin/net/trueog/diamondbankog/PayTest.kt b/src/test/kotlin/net/trueog/diamondbankog/PayTest.kt index b6101a0..d3210d9 100644 --- a/src/test/kotlin/net/trueog/diamondbankog/PayTest.kt +++ b/src/test/kotlin/net/trueog/diamondbankog/PayTest.kt @@ -274,7 +274,7 @@ class PayTest { verify { player.sendMessage( Component.text( - "DiamondBank-OG: Successfully paid $successDiamondText to OtherPlayer." + "DiamondBank-OG: Successfully paid $successDiamondText to OtherPlayer." ) ) } @@ -437,9 +437,9 @@ class PayTest { @ParameterizedTest(name = "{0}") @DisplayName("Pay with invalid argument should fail") @CsvSource( - "Not a number, abc, Invalid argument", - "Negative, -1, You cannot pay a negative or zero amount", - "Zero, 0, You cannot pay a negative or zero amount", + "Not a number, abc, Invalid argument", + "Negative, -1, You cannot pay a negative or zero amount", + "Zero, 0, You cannot pay a negative or zero amount", "More than one decimal digit, 1.11, Diamonds can only have one decimal digit. Issue /diamondbankhelp for more information", ) fun payInvalidArg(@Suppress("UNUSED_PARAMETER") name: String, argument: String, errorMessage: String) = runTest { @@ -450,7 +450,7 @@ class PayTest { waitForCoroutines(scope) assertAll( - { verify { player.sendMessage(Component.text("DiamondBank-OG: $errorMessage.")) } }, + { verify { player.sendMessage(Component.text("DiamondBank-OG: $errorMessage.")) } }, { coVerify(exactly = 0) { balanceManager.subtractFromBankShards(any(), any()) } }, { assertEquals(0, inventory.countTotal(), "Total count") }, { assertFalse(inventory.isLocked(), "Inventory locked") }, diff --git a/src/test/kotlin/net/trueog/diamondbankog/WithdrawTest.kt b/src/test/kotlin/net/trueog/diamondbankog/WithdrawTest.kt index 9ab4a75..b246801 100644 --- a/src/test/kotlin/net/trueog/diamondbankog/WithdrawTest.kt +++ b/src/test/kotlin/net/trueog/diamondbankog/WithdrawTest.kt @@ -225,9 +225,9 @@ class WithdrawTest { @ParameterizedTest(name = "{0}") @DisplayName("Withdraw with invalid argument should fail") @CsvSource( - "Not a number, abc, Invalid argument", - "Negative, -1, You cannot withdraw a negative or zero amount", - "Zero, 0, You cannot withdraw a negative or zero amount", + "Not a number, abc, Invalid argument", + "Negative, -1, You cannot withdraw a negative or zero amount", + "Zero, 0, You cannot withdraw a negative or zero amount", "More than one decimal digit, 1.11, Diamonds can only have one decimal digit. Issue /diamondbankhelp for more information", ) fun withdrawInvalidArg(@Suppress("UNUSED_PARAMETER") name: String, argument: String, errorMessage: String) = @@ -239,7 +239,7 @@ class WithdrawTest { waitForCoroutines(scope) assertAll( - { verify { player.sendMessage(Component.text("DiamondBank-OG: $errorMessage.")) } }, + { verify { player.sendMessage(Component.text("DiamondBank-OG: $errorMessage.")) } }, { coVerify(exactly = 0) { balanceManager.subtractFromBankShards(any(), any()) } }, { assertEquals(0, inventory.countTotal(), "Total count") }, { assertFalse(inventory.isLocked(), "Inventory locked") }, @@ -287,7 +287,7 @@ class WithdrawTest { verify { player.sendMessage( Component.text( - "DiamondBank-OG: Cannot withdraw 5.0 Diamonds because your bank only contains 2.0 Diamonds." + "DiamondBank-OG: Cannot withdraw 5.0 Diamonds because your bank only contains 2.0 Diamonds." ) ) } -- 2.47.3 From 025cbf610c7d9989ee529cd1ea3c14f85dd7bb0e Mon Sep 17 00:00:00 2001 From: Sven Date: Sun, 5 Apr 2026 20:58:38 +0200 Subject: [PATCH 3/3] Use handleError instead of manually setting economyDisabled in onPlayerJoin --- src/main/kotlin/net/trueog/diamondbankog/Events.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/net/trueog/diamondbankog/Events.kt b/src/main/kotlin/net/trueog/diamondbankog/Events.kt index 0536429..65204db 100644 --- a/src/main/kotlin/net/trueog/diamondbankog/Events.kt +++ b/src/main/kotlin/net/trueog/diamondbankog/Events.kt @@ -48,7 +48,7 @@ internal class Events : Listener { scope.launch { val hasEntry = balanceManager.hasEntry(event.player.uniqueId).getOrElse { - economyDisabled = true + handleError(it) return@launch } if (!hasEntry) { -- 2.47.3