fix: inventory closing
This commit is contained in:
parent
8bddd56124
commit
dd35f38dc2
2 changed files with 2 additions and 2 deletions
|
@ -42,13 +42,13 @@ public class LanguageCyclingItem {
|
||||||
return CycleItem.withStateChangeHandler((observer, integer) -> {
|
return CycleItem.withStateChangeHandler((observer, integer) -> {
|
||||||
nickoProfile.setLocale(Locale.values()[integer]);
|
nickoProfile.setLocale(Locale.values()[integer]);
|
||||||
observer.playSound(player, Sound.UI_BUTTON_CLICK, 1f, 0.707107f); // 0.707107 ~= C
|
observer.playSound(player, Sound.UI_BUTTON_CLICK, 1f, 0.707107f); // 0.707107 ~= C
|
||||||
|
player.getOpenInventory().close();
|
||||||
// TODO (Ineanto, 7/14/23): This checks a 2nd time for the profile.
|
// TODO (Ineanto, 7/14/23): This checks a 2nd time for the profile.
|
||||||
if (dataStore.updateCache(player.getUniqueId(), nickoProfile).isError()) {
|
if (dataStore.updateCache(player.getUniqueId(), nickoProfile).isError()) {
|
||||||
player.sendMessage(i18n.translate(I18NDict.Event.Settings.ERROR));
|
player.sendMessage(i18n.translate(I18NDict.Event.Settings.ERROR));
|
||||||
} else {
|
} else {
|
||||||
new SettingsGUI(player).open();
|
new SettingsGUI(player).open();
|
||||||
}
|
}
|
||||||
player.getOpenInventory().close();
|
|
||||||
}, localeOrdinal, providers);
|
}, localeOrdinal, providers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class I18NItemTranslationTest {
|
||||||
public void translateItemLore() {
|
public void translateItemLore() {
|
||||||
final I18N i18n = new I18N(Locale.FRENCH);
|
final I18N i18n = new I18N(Locale.FRENCH);
|
||||||
final ItemTranslation translation = i18n.translateItem(I18NDict.GUI.Settings.BUNGEECORD, "Test");
|
final ItemTranslation translation = i18n.translateItem(I18NDict.GUI.Settings.BUNGEECORD, "Test");
|
||||||
assertEquals("Test", translation.getLore().get(0));
|
assertEquals("§7§oParcourez les valeurs", translation.getLore().get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterAll
|
@AfterAll
|
||||||
|
|
Loading…
Reference in a new issue