Skip to content

Commit 8401579

Browse files
committed
📝 Fix currency
1 parent 4424df0 commit 8401579

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

changelog.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,28 @@
4242

4343
# Unreleased
4444

45+
## New Features
46+
47+
- **Pagination Management System**: Introduced `PaginationManager` with `PaginationButton`, `PaginationNextButton`, and `PaginationPreviousButton` classes, allowing a single button to handle pagination. Includes max page tracking and optimized page size handling.
48+
- **Pagination Placeholders**: Added pagination-related placeholders to `MenuPlaceholders` for enhanced inventory navigation.
49+
- **Reset Pagination Action**: New `ResetPaginationAction` and loader to reset pagination state for button paginations.
50+
- **Skip Close Actions on Inventory Switch**: Added `skip-close-actions-on-switch` configuration option to prevent close actions from firing when switching between inventories, fixing issues with back/inventory actions triggering on close.
51+
- **PacketManager Interface**: Introduced `PacketManager` API interface and refactored title name handling in packet events for cleaner architecture.
52+
- **ClickAction Enum**: Added `ClickAction` enum to streamline action handling in `InventoryLoader`.
53+
54+
## Bug Fixes
55+
56+
- Fixed `CustomModelDataComponent` data handling (removed Optional) and added Paper-specific implementation (`PaperCustomModelDataComponent`) for proper Paper compatibility.
57+
- Fixed head cache issue in `ZMenuItemStack`.
58+
- Fixed unnecessary `toLowerCase` conversion on dialog names in `CommandDialogOpen`.
59+
- Fixed item button click handling by removing redundant null check for clickable buttons.
60+
61+
## Internal Changes
62+
63+
- Added javadocs.
64+
- API fixes.
65+
- Removed unused class.
66+
4567
# 1.1.1.2
4668

4769
## Bug Fixes

src/main/java/fr/maxlego08/menu/requirement/actions/CurrencyDepositAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ public CurrencyDepositAction(String amount, Currencies currencies, String econom
2626

2727
@Override
2828
protected void execute(@NonNull Player player, Button button, @NonNull InventoryEngine inventory, @NonNull Placeholders placeholders) {
29-
this.currencies.deposit(player, new BigDecimal(papi(placeholders.parse(this.amount), player)), this.economyName == null ? "default" : this.economyName, papi(placeholders.parse(this.reason), player));
29+
this.currencies.deposit(player.getUniqueId(), new BigDecimal(papi(placeholders.parse(this.amount), player)), this.economyName == null ? "default" : this.economyName, papi(placeholders.parse(this.reason), player));
3030
}
3131
}

src/main/java/fr/maxlego08/menu/requirement/actions/CurrencyWithdrawAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ public CurrencyWithdrawAction(String amount, Currencies currencies, String econo
2626

2727
@Override
2828
protected void execute(@NonNull Player player, Button button, @NonNull InventoryEngine inventory, @NonNull Placeholders placeholders) {
29-
this.currencies.withdraw(player, new BigDecimal(papi(placeholders.parse(this.amount), player)), this.economyName == null ? "default" : this.economyName, papi(placeholders.parse(this.reason), player));
29+
this.currencies.withdraw(player.getUniqueId(), new BigDecimal(papi(placeholders.parse(this.amount), player)), this.economyName == null ? "default" : this.economyName, papi(placeholders.parse(this.reason), player));
3030
}
3131
}

src/main/java/fr/maxlego08/menu/requirement/permissible/ZCurrencyPermissible.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public Currencies getCurrency() {
3939
public boolean hasPermission(@NonNull Player player, Button button, @NonNull InventoryEngine inventory, @NonNull Placeholders placeholders) {
4040
String result = inventory.getPlugin().parse(player, placeholders.parse(this.amount));
4141
BigDecimal bigDecimal = new BigDecimal(result);
42-
BigDecimal amount = this.currencies.getBalance(player, this.economyName == null ? "default" : this.economyName);
42+
BigDecimal amount = this.currencies.getBalance(player.getUniqueId(), this.economyName == null ? "default" : this.economyName);
4343
return amount.compareTo(bigDecimal) >= 0;
4444
}
4545

0 commit comments

Comments
 (0)