From 18525814d8b3b469d6e077ce6bd5e435704f10e7 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 2 Nov 2022 22:38:21 +0100 Subject: [PATCH] Current state --- CommonCore | 2 +- .../src/de/steamwar/core/events/PlayerJoinedEvent.java | 10 ++++++++++ SpigotCore_Main/src/de/steamwar/sql/PersonalKit.java | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CommonCore b/CommonCore index 92bea62..bd626bb 160000 --- a/CommonCore +++ b/CommonCore @@ -1 +1 @@ -Subproject commit 92bea6255f6cae312674c7badffb7a8a44c4daee +Subproject commit bd626bb4e6366f1e5e7e64765a6e47fefe05b16a diff --git a/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java b/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java index aae2000..4d0f776 100644 --- a/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java +++ b/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java @@ -27,8 +27,11 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerLocaleChangeEvent; import org.bukkit.event.player.PlayerQuitEvent; +import java.util.Locale; + public class PlayerJoinedEvent implements Listener{ @@ -48,6 +51,13 @@ public class PlayerJoinedEvent implements Listener{ event.setJoinMessage("§a§l» §r" + player.getDisplayName()); } + + @EventHandler + private void onLocale(PlayerLocaleChangeEvent event) { + if(!Statement.productionDatabase()) { + SteamwarUser.get(event.getPlayer().getUniqueId()).setLocale(Locale.forLanguageTag(event.getLocale()), false); + } + } @EventHandler private void onQuit(PlayerQuitEvent event) { diff --git a/SpigotCore_Main/src/de/steamwar/sql/PersonalKit.java b/SpigotCore_Main/src/de/steamwar/sql/PersonalKit.java index 44fcff9..fcc5a09 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/PersonalKit.java +++ b/SpigotCore_Main/src/de/steamwar/sql/PersonalKit.java @@ -131,7 +131,7 @@ public class PersonalKit { } public static PersonalKit getKitInUse(int userID, String gamemode) { - return getKitInUse.select(userID, gamemode); + return getKitInUse.select(userID, gamemode, true); } private static String saveInvConfig(String name, ItemStack[] inv) {