2015-09-13 06:29:23 +02:00
|
|
|
From 59957f2d97df8ed4bfbf3656779fbbe1414a11f1 Mon Sep 17 00:00:00 2001
|
2015-04-28 04:43:59 +02:00
|
|
|
From: Isaac Moore <rmsy@me.com>
|
|
|
|
Date: Mon, 27 Apr 2015 21:41:39 -0500
|
|
|
|
Subject: [PATCH] Add PlayerLocaleChangeEvent
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2015-09-13 02:57:39 +02:00
|
|
|
index 3810f86..be50b55 100644
|
2015-04-28 04:43:59 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2015-05-30 08:11:16 +02:00
|
|
|
@@ -995,7 +995,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
2015-04-28 04:43:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void a(PacketPlayInSettings packetplayinsettings) {
|
|
|
|
+ // PaperSpigot start - Add PlayerLocaleChangeEvent
|
|
|
|
+ String oldLocale = this.locale;
|
|
|
|
this.locale = packetplayinsettings.a();
|
|
|
|
+ if (!this.locale.equals(oldLocale)) {
|
|
|
|
+ CraftEventFactory.callPlayerLocaleChangeEvent(this, oldLocale, this.locale);
|
|
|
|
+ }
|
|
|
|
+ // PaperSpigot end
|
|
|
|
this.bR = packetplayinsettings.c();
|
|
|
|
this.bS = packetplayinsettings.d();
|
|
|
|
this.getDataWatcher().watch(10, Byte.valueOf((byte) packetplayinsettings.e()));
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
2015-09-13 02:57:39 +02:00
|
|
|
index d1bd480..2dd8508 100644
|
2015-04-28 04:43:59 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
2015-07-14 17:59:57 +02:00
|
|
|
@@ -963,4 +963,13 @@ public class CraftEventFactory {
|
2015-04-28 04:43:59 +02:00
|
|
|
entityHuman.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
return (Cancellable) event;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // PaperSpigot start - Add PlayerLocaleChangeEvent
|
|
|
|
+ public static PlayerLocaleChangeEvent callPlayerLocaleChangeEvent(EntityHuman who, String oldLocale, String newLocale) {
|
|
|
|
+ Player player = (Player) who.getBukkitEntity();
|
|
|
|
+ PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(player, oldLocale, newLocale);
|
|
|
|
+ Bukkit.getPluginManager().callEvent(event);
|
|
|
|
+ return event;
|
|
|
|
+ }
|
|
|
|
+ // PaperSpigot end
|
|
|
|
}
|
|
|
|
--
|
2015-09-13 06:29:23 +02:00
|
|
|
2.5.2
|
2015-04-28 04:43:59 +02:00
|
|
|
|