diff options
Diffstat (limited to 'patches/unapplied/server/0045-Implement-PlayerLocaleChangeEvent.patch')
-rw-r--r-- | patches/unapplied/server/0045-Implement-PlayerLocaleChangeEvent.patch | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/patches/unapplied/server/0045-Implement-PlayerLocaleChangeEvent.patch b/patches/unapplied/server/0045-Implement-PlayerLocaleChangeEvent.patch deleted file mode 100644 index 6879989dba..0000000000 --- a/patches/unapplied/server/0045-Implement-PlayerLocaleChangeEvent.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Isaac Moore <[email protected]> -Date: Tue, 19 Apr 2016 14:09:31 -0500 -Subject: [PATCH] Implement PlayerLocaleChangeEvent - - -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 1136a3fe673680fcaca9b9768543ffada040153f..f157646156a659d0b87b1f72fd0d1d06d66bc543 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayer.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1853,7 +1853,7 @@ public class ServerPlayer extends Player { - } - } - -- public String locale = "en_us"; // CraftBukkit - add, lowercase -+ public String locale = null; // CraftBukkit - add, lowercase // Paper - default to null - public java.util.Locale adventure$locale = java.util.Locale.US; // Paper - public void updateOptions(ServerboundClientInformationPacket packet) { - // CraftBukkit start -@@ -1861,9 +1861,10 @@ public class ServerPlayer extends Player { - PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); - this.server.server.getPluginManager().callEvent(event); - } -- if (!this.locale.equals(packet.language)) { -+ if (this.locale == null || !this.locale.equals(packet.language)) { // Paper - check for null - PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(this.getBukkitEntity(), packet.language); - this.server.server.getPluginManager().callEvent(event); -+ this.server.server.getPluginManager().callEvent(new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), this.locale, packet.language)); // Paper - } - this.locale = packet.language; - // Paper start -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1486d48e3c710ec733cd7cc6c07fb6e11d1e1d93..f5b05eb97f059cfb4d6d22d0a180c5fd8a203f66 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2229,8 +2229,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - - @Override - public String getLocale() { -- return this.getHandle().locale; -- -+ // Paper start - Locale change event -+ final String locale = this.getHandle().locale; -+ return locale != null ? locale : "en_us"; -+ // Paper end - } - - // Paper start |