Skip to content

Commit 72f62c0

Browse files
committed
Added hasMultiWorldSupport to controllers
Introduced `hasMultiWorldSupport` method in `EconomyController` and `BankController`. This determines multi-world handling capabilities and clarifies parameter behavior for non-supported cases.
1 parent 8b54dcc commit 72f62c0

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/main/java/net/thenextlvl/service/api/economy/EconomyController.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,14 @@ default CompletableFuture<Boolean> deleteAccount(UUID uuid) {
314314
* @return a CompletableFuture that will complete when the account is deleted
315315
*/
316316
CompletableFuture<Boolean> deleteAccount(UUID uuid, @Nullable World world);
317+
318+
/**
319+
* Determines whether the controller supports handling of multiple worlds.
320+
*
321+
* @return {@code true} if multi-world economy is supported, otherwise {@code false}
322+
* @implSpec If multiple worlds are not supported,
323+
* implementations must ignore world-specific parameters and only handle cases where the world parameter is null.
324+
*/
325+
@Contract(pure = true)
326+
boolean hasMultiWorldSupport();
317327
}

src/main/java/net/thenextlvl/service/api/economy/bank/BankController.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,4 +321,14 @@ default Optional<Bank> getBank(UUID uuid) {
321321
* @return an Optional containing the Bank associated with the UUID and world, or empty if not found
322322
*/
323323
Optional<Bank> getBank(UUID uuid, @Nullable World world);
324+
325+
/**
326+
* Determines whether the controller supports handling of multiple worlds.
327+
*
328+
* @return {@code true} if multi-world banking is supported, otherwise {@code false}
329+
* @implSpec If multiple worlds are not supported,
330+
* implementations must ignore world-specific parameters and only handle cases where the world parameter is null.
331+
*/
332+
@Contract(pure = true)
333+
boolean hasMultiWorldSupport();
324334
}

0 commit comments

Comments
 (0)