From 6eb72a3aa25370bae5207109b85e06daa0f6a12f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 21 May 2022 13:23:43 +0200 Subject: [PATCH] Fix stuff --- SpigotCore_Main/src/de/steamwar/message/Message.java | 7 +------ SpigotCore_Main/src/de/steamwar/sql/SteamwarUser.java | 8 ++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/message/Message.java b/SpigotCore_Main/src/de/steamwar/message/Message.java index 9cb9283..6835e8b 100644 --- a/SpigotCore_Main/src/de/steamwar/message/Message.java +++ b/SpigotCore_Main/src/de/steamwar/message/Message.java @@ -75,12 +75,7 @@ public class Message { } private Locale getLocale(Player player){ - Locale locale = SteamwarUser.get(player).getLocale(); - if (locale == null) - locale = WorldOfColorWrapper.impl.getLocale(player); - if (locale == null) - locale = Locale.getDefault(); - return locale; + return SteamwarUser.get(player).getLocale(); } /* Send a message to one player */ diff --git a/SpigotCore_Main/src/de/steamwar/sql/SteamwarUser.java b/SpigotCore_Main/src/de/steamwar/sql/SteamwarUser.java index 9de9c2d..6020000 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SteamwarUser.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SteamwarUser.java @@ -20,6 +20,7 @@ package de.steamwar.sql; import de.steamwar.core.Core; +import de.steamwar.core.WorldOfColorWrapper; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -96,6 +97,13 @@ public class SteamwarUser { } public Locale getLocale() { + Locale locale = this.locale; + if (locale == null) { + locale = WorldOfColorWrapper.impl.getLocale(Bukkit.getPlayer(uuid)); + } + if (locale == null) { + locale = Locale.getDefault(); + } return locale; }