From 5eb70defef0c4badd9fa6dae29d25688975b1853 Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Tue, 13 Jun 2023 21:49:36 +0200 Subject: [PATCH] 0.0.6 --- gradle.properties | 2 +- .../io/github/townyadvanced/townymenus/TownyMenus.java | 2 +- .../townymenus/menu/helper/GovernmentMenus.java | 4 ++-- src/main/resources/Changelog.txt | 8 +++++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index b8ed028..3f2abad 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ group = io.github.townyadvanced -version = 0.0.6-SNAPSHOT +version = 0.0.6 diff --git a/src/main/java/io/github/townyadvanced/townymenus/TownyMenus.java b/src/main/java/io/github/townyadvanced/townymenus/TownyMenus.java index 6bc14af..c07eda6 100644 --- a/src/main/java/io/github/townyadvanced/townymenus/TownyMenus.java +++ b/src/main/java/io/github/townyadvanced/townymenus/TownyMenus.java @@ -27,7 +27,7 @@ public class TownyMenus extends JavaPlugin { - private static final Version requiredTownyVersion = Version.fromString("0.99.0.6"); + private static final Version requiredTownyVersion = Version.fromString("0.99.0.8"); private static TownyMenus plugin; private final Object scheduler; diff --git a/src/main/java/io/github/townyadvanced/townymenus/menu/helper/GovernmentMenus.java b/src/main/java/io/github/townyadvanced/townymenus/menu/helper/GovernmentMenus.java index 9ebeacc..e9cc124 100644 --- a/src/main/java/io/github/townyadvanced/townymenus/menu/helper/GovernmentMenus.java +++ b/src/main/java/io/github/townyadvanced/townymenus/menu/helper/GovernmentMenus.java @@ -116,7 +116,7 @@ public static MenuInventory createDepositWithdrawMenu(final Player player, final private static UserInputAction depositOrWithdraw(final Player player, final Government government, boolean withdraw) { final Locale locale = Localization.localeOrDefault(player); - return ClickAction.userInput(of("government-menus-input").translate(locale) + (withdraw ? of("government-menus-withdraw").translate(locale) : of("government-menus-deposit").translate(locale)) + of("government-menus-amount").translate(locale), completion -> { + return ClickAction.userInput(of("government-menus-input").append(withdraw ? of("government-menus-input-withdraw") : of("government-menus-input-deposit")).append(of("government-menus-input-amount")).stripColors(true).translate(locale), completion -> { try { MathUtil.getIntOrThrow(completion.getText()); } catch (TownyException e) { @@ -132,7 +132,7 @@ private static UserInputAction depositOrWithdraw(final Player player, final Gove try { Method method = clazz.getDeclaredMethod(town ? "townTransaction" : "nationTransaction", Player.class, String[].class, boolean.class); method.setAccessible(true); - method.invoke(null, player, new String[]{"", completion.getText()}, withdraw); + method.invoke(null, player, new String[]{completion.getText()}, withdraw); MenuHistory.last(player); return AnvilResponse.nil(); diff --git a/src/main/resources/Changelog.txt b/src/main/resources/Changelog.txt index 8f7a307..78e6209 100644 --- a/src/main/resources/Changelog.txt +++ b/src/main/resources/Changelog.txt @@ -31,4 +31,10 @@ - Menu created items are now marked with a special entry so that they can be identified & removed when a menu is closed or an item is dropped. - Not aware of any exploits that would allow menu items to be taken, but better safe than sorry. - Added Folia support. - - The minimum required Towny version is now 0.99.0.6. \ No newline at end of file + - The minimum required Towny version is now 0.99.0.6. +0.0.6: + - Fixed an issue where town deposits were not working. + - The minimum Towny version has been raised to 0.99.0.8. + - Fully localized TownyMenus, courtesy of Litt1eBai with PR #18. + - Updated AnvilGUI to version 1.6.6-SNAPSHOT for 1.20 support. + - Fixed a small Folia compatability issue.