Skip to content

Commit 8fd56e2

Browse files
committed
Send message to players if they changed their locale
1 parent 7f3a38e commit 8fd56e2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/org/maxgamer/quickshop/chat/QuickChatType.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package org.maxgamer.quickshop.chat;
2121

2222
import org.jetbrains.annotations.NotNull;
23+
import org.maxgamer.quickshop.QuickShop;
2324
import org.maxgamer.quickshop.chat.platform.minedown.BungeeQuickChat;
2425

2526
public enum QuickChatType {
@@ -54,14 +55,14 @@ public static QuickChat createById(int id) {
5455
// if (type == QuickChatType.ADVENTURE) {
5556
// return new AdventureQuickChat();
5657
// }
57-
return new BungeeQuickChat();
58+
return new BungeeQuickChat(QuickShop.getInstance());
5859
}
5960

6061
public static QuickChat createByType(QuickChatType type) {
6162
// if (type == QuickChatType.ADVENTURE) {
6263
// return new AdventureQuickChat();
6364
// }
64-
return new BungeeQuickChat();
65+
return new BungeeQuickChat(QuickShop.getInstance());
6566
}
6667

6768
public int toID() {

src/main/java/org/maxgamer/quickshop/listener/PlayerListener.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,11 @@ public void onDyeing(PlayerInteractEvent e) {
383383
Util.debugLog("Disallow " + e.getPlayer().getName() + " dye the shop sign.");
384384
}
385385

386+
@EventHandler(priority = EventPriority.MONITOR,ignoreCancelled = true)
387+
public void onLocaleChanges(PlayerLocaleChangeEvent event){
388+
MsgUtil.sendDirectMessage(event.getPlayer(),plugin.text().of(event.getPlayer(),"client-language-changed").forLocale(event.getLocale()));
389+
}
390+
386391
/**
387392
* Callback for reloading
388393
*

0 commit comments

Comments
 (0)