From 9126a97964b98b16a9e923e4a3cecc66e4f22877 Mon Sep 17 00:00:00 2001 From: Isaac Moore Date: Tue, 2 Sep 2014 20:48:08 -0500 Subject: [PATCH] Add PlayerLocaleChangeEvent --- Bukkit/0029-Add-PlayerLocaleChangeEvent.patch | 61 +++++++++++++++++++ ...col.patch => 0030-Snapshot-protocol.patch} | 4 +- .../0083-Add-PlayerLocaleChangeEvent.patch | 43 +++++++++++++ ...orts.patch => 0084-Snapshot-imports.patch} | 4 +- ...col.patch => 0085-Snapshot-protocol.patch} | 10 +-- 5 files changed, 113 insertions(+), 9 deletions(-) create mode 100644 Bukkit/0029-Add-PlayerLocaleChangeEvent.patch rename Bukkit/{0029-Snapshot-protocol.patch => 0030-Snapshot-protocol.patch} (96%) create mode 100644 CraftBukkit/0083-Add-PlayerLocaleChangeEvent.patch rename CraftBukkit/{0083-Snapshot-imports.patch => 0084-Snapshot-imports.patch} (99%) rename CraftBukkit/{0084-Snapshot-protocol.patch => 0085-Snapshot-protocol.patch} (99%) diff --git a/Bukkit/0029-Add-PlayerLocaleChangeEvent.patch b/Bukkit/0029-Add-PlayerLocaleChangeEvent.patch new file mode 100644 index 00000000..284605b4 --- /dev/null +++ b/Bukkit/0029-Add-PlayerLocaleChangeEvent.patch @@ -0,0 +1,61 @@ +From 229ebfcfd563a023c7a1a7b08cdfe628d759cd79 Mon Sep 17 00:00:00 2001 +From: Isaac Moore +Date: Tue, 2 Sep 2014 20:35:37 -0500 +Subject: [PATCH] Add PlayerLocaleChangeEvent + + +diff --git a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java +new file mode 100644 +index 0000000..5e5452e +--- /dev/null ++++ b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java +@@ -0,0 +1,46 @@ ++package org.bukkit.event.player; ++ ++import org.bukkit.entity.Player; ++import org.bukkit.event.HandlerList; ++ ++/** ++ * Called when the locale of the player is changed. ++ */ ++public class PlayerLocaleChangeEvent extends PlayerEvent { ++ private static final HandlerList handlers = new HandlerList(); ++ private final String oldLocale; ++ private final String newLocale; ++ ++ public PlayerLocaleChangeEvent(final Player player, final String oldLocale, final String newLocale) { ++ super(player); ++ this.oldLocale = oldLocale; ++ this.newLocale = newLocale; ++ } ++ ++ /** ++ * Gets the locale the player switched from. ++ * ++ * @return player's old locale ++ */ ++ public String getOldLocale() { ++ return oldLocale; ++ } ++ ++ /** ++ * Gets the locale the player is changed to. ++ * ++ * @return player's new locale ++ */ ++ public String getNewLocale() { ++ return newLocale; ++ } ++ ++ @Override ++ public HandlerList getHandlers() { ++ return handlers; ++ } ++ ++ public static HandlerList getHandlerList() { ++ return handlers; ++ } ++} +-- +1.8.4.msysgit.0 + diff --git a/Bukkit/0029-Snapshot-protocol.patch b/Bukkit/0030-Snapshot-protocol.patch similarity index 96% rename from Bukkit/0029-Snapshot-protocol.patch rename to Bukkit/0030-Snapshot-protocol.patch index c864ef41..4acb8f23 100644 --- a/Bukkit/0029-Snapshot-protocol.patch +++ b/Bukkit/0030-Snapshot-protocol.patch @@ -1,4 +1,4 @@ -From 2efc57050fec1d420a0cbfca71bba0d75a7fb832 Mon Sep 17 00:00:00 2001 +From 9b521f1cdbc54d7104bb6fd36ce49159225acc6f Mon Sep 17 00:00:00 2001 From: mrapple Date: Mon, 1 Sep 2014 00:34:00 -0500 Subject: [PATCH] Snapshot protocol @@ -71,5 +71,5 @@ index c4cd0d7..fbe28f0 100644 + // XimeBukkit end +} -- -1.8.5.2 (Apple Git-48) +1.8.4.msysgit.0 diff --git a/CraftBukkit/0083-Add-PlayerLocaleChangeEvent.patch b/CraftBukkit/0083-Add-PlayerLocaleChangeEvent.patch new file mode 100644 index 00000000..a9254c30 --- /dev/null +++ b/CraftBukkit/0083-Add-PlayerLocaleChangeEvent.patch @@ -0,0 +1,43 @@ +From 4d555802705c7ad6c566951ea3b292180a288e58 Mon Sep 17 00:00:00 2001 +From: Isaac Moore +Date: Tue, 2 Sep 2014 20:36:42 -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 +index b312ec9..90dbfc9 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -999,7 +999,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + } + + public void a(PacketPlayInSettings packetplayinsettings) { ++ // SportBukkit start - add LocaleChangeEvent ++ String oldLocale = this.locale; + this.locale = packetplayinsettings.c(); ++ if (!this.locale.equals(oldLocale)) { ++ CraftEventFactory.callPlayerLocaleChangeEvent(this, oldLocale, this.locale); ++ } ++ // SportBukkit end + int i = 256 >> packetplayinsettings.d(); + + if (i > 3 && i < 20) { +diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +index 4478e08..0743c25 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -912,4 +912,11 @@ public class CraftEventFactory { + entityHuman.world.getServer().getPluginManager().callEvent(event); + return (Cancellable) event; + } ++ ++ 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; ++ } + } +-- +1.8.4.msysgit.0 + diff --git a/CraftBukkit/0083-Snapshot-imports.patch b/CraftBukkit/0084-Snapshot-imports.patch similarity index 99% rename from CraftBukkit/0083-Snapshot-imports.patch rename to CraftBukkit/0084-Snapshot-imports.patch index 1f0711ce..f390e814 100644 --- a/CraftBukkit/0083-Snapshot-imports.patch +++ b/CraftBukkit/0084-Snapshot-imports.patch @@ -1,4 +1,4 @@ -From 9fbed69e1d030823fd5dc31a27825a442b4f7401 Mon Sep 17 00:00:00 2001 +From 3c29a86cfab81aeb415467a2ee22c201e71902d2 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Mon, 1 Sep 2014 16:47:48 +1000 Subject: [PATCH] Snapshot imports @@ -2764,5 +2764,5 @@ index 0000000..29f0c99 + } +} -- -1.8.5.2 (Apple Git-48) +1.8.4.msysgit.0 diff --git a/CraftBukkit/0084-Snapshot-protocol.patch b/CraftBukkit/0085-Snapshot-protocol.patch similarity index 99% rename from CraftBukkit/0084-Snapshot-protocol.patch rename to CraftBukkit/0085-Snapshot-protocol.patch index 4dba929c..18a0e896 100644 --- a/CraftBukkit/0084-Snapshot-protocol.patch +++ b/CraftBukkit/0085-Snapshot-protocol.patch @@ -1,4 +1,4 @@ -From 2f25a46d2e088e66367c3637e6ffc4a3640ddba4 Mon Sep 17 00:00:00 2001 +From 6d9e4e4cb0bd6a49f3e89f0e4512e1175ad8e0e0 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Mon, 1 Sep 2014 16:47:48 +1000 Subject: [PATCH] Snapshot protocol @@ -416,7 +416,7 @@ index f1ccd3a..22c9eca 100644 } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index b312ec9..db982fc 100644 +index 90dbfc9..1ad9e59 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -26,6 +26,7 @@ import org.bukkit.craftbukkit.inventory.CraftItemStack; @@ -472,7 +472,7 @@ index b312ec9..db982fc 100644 try { packetdataserializer.writeInt(this.containerCounter); -@@ -1012,7 +1013,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1018,7 +1019,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.server.a(packetplayinsettings.g()); } @@ -490,7 +490,7 @@ index b312ec9..db982fc 100644 } public EnumChatVisibility getChatFlags() { -@@ -1021,6 +1031,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1027,6 +1037,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void setResourcePack(String s) { this.playerConnection.sendPacket(new PacketPlayOutCustomPayload("MC|RPack", s.getBytes(Charsets.UTF_8))); @@ -4140,5 +4140,5 @@ index 0000000..8dd484d @@ -0,0 +1 @@ +["0:0","1:0","1:1","1:2","1:3","1:4","1:5","1:6","2:0","3:0","3:1","3:2","4:0","5:0","5:1","5:2","5:3","5:4","5:5","6:0","6:1","6:2","6:3","6:4","6:5","6:8","6:9","6:10","6:11","6:12","6:13","7:0","8:0","8:1","8:2","8:3","8:4","8:5","8:6","8:7","8:8","8:9","8:10","8:11","8:12","8:13","8:14","8:15","9:0","9:1","9:2","9:3","9:4","9:5","9:6","9:7","9:8","9:9","9:10","9:11","9:12","9:13","9:14","9:15","10:0","10:1","10:2","10:3","10:4","10:5","10:6","10:7","10:8","10:9","10:10","10:11","10:12","10:13","10:14","10:15","11:0","11:1","11:2","11:3","11:4","11:5","11:6","11:7","11:8","11:9","11:10","11:11","11:12","11:13","11:14","11:15","12:0","12:1","13:0","14:0","15:0","16:0","17:0","17:1","17:2","17:3","17:4","17:5","17:6","17:7","17:8","17:9","17:10","17:11","17:12","17:13","17:14","17:15","18:0","18:1","18:2","18:3","18:4","18:5","18:6","18:7","18:8","18:9","18:10","18:11","18:12","18:13","18:14","18:15","19:0","19:1","20:0","21:0","22:0","23:0","23:1","23:2","23:3","23:4","23:5","23:8","23:9","23:10","23:11","23:12","23:13","24:0","24:1","24:2","25:0","26:0","26:1","26:2","26:3","26:8","26:9","26:10","26:11","26:12","26:13","26:14","26:15","27:0","27:1","27:2","27:3","27:4","27:5","27:8","27:9","27:10","27:11","27:12","27:13","28:0","28:1","28:2","28:3","28:4","28:5","28:8","28:9","28:10","28:11","28:12","28:13","29:0","29:1","29:2","29:3","29:4","29:5","29:8","29:9","29:10","29:11","29:12","29:13","30:0","31:0","31:1","31:2","32:0","33:0","33:1","33:2","33:3","33:4","33:5","33:8","33:9","33:10","33:11","33:12","33:13","34:0","34:1","34:2","34:3","34:4","34:5","34:8","34:9","34:10","34:11","34:12","34:13","35:0","35:1","35:2","35:3","35:4","35:5","35:6","35:7","35:8","35:9","35:10","35:11","35:12","35:13","35:14","35:15","36:0","36:1","36:2","36:3","36:4","36:5","36:8","36:9","36:10","36:11","36:12","36:13","37:0","38:0","38:1","38:2","38:3","38:4","38:5","38:6","38:7","38:8","39:0","40:0","41:0","42:0","43:0","43:1","43:2","43:3","43:4","43:5","43:6","43:7","43:8","43:9","43:10","43:11","43:12","43:13","43:14","43:15","44:0","44:1","44:2","44:3","44:4","44:5","44:6","44:7","44:8","44:9","44:10","44:11","44:12","44:13","44:14","44:15","45:0","46:0","46:1","47:0","48:0","49:0","50:1","50:2","50:3","50:4","50:5","51:0","51:1","51:2","51:3","51:4","51:5","51:6","51:7","51:8","51:9","51:10","51:11","51:12","51:13","51:14","51:15","52:0","53:0","53:1","53:2","53:3","53:4","53:5","53:6","53:7","54:2","54:3","54:4","54:5","55:0","55:1","55:2","55:3","55:4","55:5","55:6","55:7","55:8","55:9","55:10","55:11","55:12","55:13","55:14","55:15","56:0","57:0","58:0","59:0","59:1","59:2","59:3","59:4","59:5","59:6","59:7","60:0","60:1","60:2","60:3","60:4","60:5","60:6","60:7","61:2","61:3","61:4","61:5","62:2","62:3","62:4","62:5","63:0","63:1","63:2","63:3","63:4","63:5","63:6","63:7","63:8","63:9","63:10","63:11","63:12","63:13","63:14","63:15","64:0","64:1","64:2","64:3","64:4","64:5","64:6","64:7","64:8","64:9","64:10","64:11","65:2","65:3","65:4","65:5","66:0","66:1","66:2","66:3","66:4","66:5","66:6","66:7","66:8","66:9","67:0","67:1","67:2","67:3","67:4","67:5","67:6","67:7","68:2","68:3","68:4","68:5","69:0","69:1","69:2","69:3","69:4","69:5","69:6","69:7","69:8","69:9","69:10","69:11","69:12","69:13","69:14","69:15","70:0","70:1","71:0","71:1","71:2","71:3","71:4","71:5","71:6","71:7","71:8","71:9","71:10","71:11","72:0","72:1","73:0","74:0","75:1","75:2","75:3","75:4","75:5","76:1","76:2","76:3","76:4","76:5","77:0","77:1","77:2","77:3","77:4","77:5","77:8","77:9","77:10","77:11","77:12","77:13","78:0","78:1","78:2","78:3","78:4","78:5","78:6","78:7","79:0","80:0","81:0","81:1","81:2","81:3","81:4","81:5","81:6","81:7","81:8","81:9","81:10","81:11","81:12","81:13","81:14","81:15","82:0","83:0","83:1","83:2","83:3","83:4","83:5","83:6","83:7","83:8","83:9","83:10","83:11","83:12","83:13","83:14","83:15","84:0","84:1","85:0","86:0","86:1","86:2","86:3","87:0","88:0","89:0","90:1","90:2","91:0","91:1","91:2","91:3","92:0","92:1","92:2","92:3","92:4","92:5","92:6","93:0","93:1","93:2","93:3","93:4","93:5","93:6","93:7","93:8","93:9","93:10","93:11","93:12","93:13","93:14","93:15","94:0","94:1","94:2","94:3","94:4","94:5","94:6","94:7","94:8","94:9","94:10","94:11","94:12","94:13","94:14","94:15","95:0","95:1","95:2","95:3","95:4","95:5","95:6","95:7","95:8","95:9","95:10","95:11","95:12","95:13","95:14","95:15","96:0","96:1","96:2","96:3","96:4","96:5","96:6","96:7","96:8","96:9","96:10","96:11","96:12","96:13","96:14","96:15","97:0","97:1","97:2","97:3","97:4","97:5","98:0","98:1","98:2","98:3","99:0","99:1","99:2","99:3","99:4","99:5","99:6","99:7","99:8","99:9","99:10","99:14","99:15","100:0","100:1","100:2","100:3","100:4","100:5","100:6","100:7","100:8","100:9","100:10","100:14","100:15","101:0","102:0","103:0","104:0","104:1","104:2","104:3","104:4","104:5","104:6","104:7","105:0","105:1","105:2","105:3","105:4","105:5","105:6","105:7","106:0","106:1","106:2","106:3","106:4","106:5","106:6","106:7","106:8","106:9","106:10","106:11","106:12","106:13","106:14","106:15","107:0","107:1","107:2","107:3","107:4","107:5","107:6","107:7","107:8","107:9","107:10","107:11","107:12","107:13","107:14","107:15","108:0","108:1","108:2","108:3","108:4","108:5","108:6","108:7","109:0","109:1","109:2","109:3","109:4","109:5","109:6","109:7","110:0","111:0","112:0","113:0","114:0","114:1","114:2","114:3","114:4","114:5","114:6","114:7","115:0","115:1","115:2","115:3","116:0","117:0","117:1","117:2","117:3","117:4","117:5","117:6","117:7","118:0","118:1","118:2","118:3","119:0","120:0","120:1","120:2","120:3","120:4","120:5","120:6","120:7","121:0","122:0","123:0","124:0","125:0","125:1","125:2","125:3","125:4","125:5","126:0","126:1","126:2","126:3","126:4","126:5","126:8","126:9","126:10","126:11","126:12","126:13","127:0","127:1","127:2","127:3","127:4","127:5","127:6","127:7","127:8","127:9","127:10","127:11","128:0","128:1","128:2","128:3","128:4","128:5","128:6","128:7","129:0","130:2","130:3","130:4","130:5","131:0","131:1","131:2","131:3","131:4","131:5","131:6","131:7","131:8","131:9","131:10","131:11","131:12","131:13","131:14","131:15","132:0","132:1","132:2","132:3","132:4","132:5","132:6","132:7","132:8","132:9","132:10","132:11","132:12","132:13","132:14","132:15","133:0","134:0","134:1","134:2","134:3","134:4","134:5","134:6","134:7","135:0","135:1","135:2","135:3","135:4","135:5","135:6","135:7","136:0","136:1","136:2","136:3","136:4","136:5","136:6","136:7","137:0","137:1","138:0","139:0","139:1","140:0","140:1","140:2","140:3","140:4","140:5","140:6","140:7","140:8","140:9","140:10","140:11","140:12","140:13","140:14","140:15","141:0","141:1","141:2","141:3","141:4","141:5","141:6","141:7","142:0","142:1","142:2","142:3","142:4","142:5","142:6","142:7","143:0","143:1","143:2","143:3","143:4","143:5","143:8","143:9","143:10","143:11","143:12","143:13","144:0","144:1","144:2","144:3","144:4","144:5","144:8","144:9","144:10","144:11","144:12","144:13","145:0","145:1","145:2","145:3","145:4","145:5","145:6","145:7","145:8","145:9","145:10","145:11","146:2","146:3","146:4","146:5","147:0","147:1","147:2","147:3","147:4","147:5","147:6","147:7","147:8","147:9","147:10","147:11","147:12","147:13","147:14","147:15","148:0","148:1","148:2","148:3","148:4","148:5","148:6","148:7","148:8","148:9","148:10","148:11","148:12","148:13","148:14","148:15","149:0","149:1","149:2","149:3","149:4","149:5","149:6","149:7","149:8","149:9","149:10","149:11","149:12","149:13","149:14","149:15","150:0","150:1","150:2","150:3","150:4","150:5","150:6","150:7","150:8","150:9","150:10","150:11","150:12","150:13","150:14","150:15","151:0","151:1","151:2","151:3","151:4","151:5","151:6","151:7","151:8","151:9","151:10","151:11","151:12","151:13","151:14","151:15","152:0","153:0","154:0","154:2","154:3","154:4","154:5","154:8","154:10","154:11","154:12","154:13","155:0","155:1","155:2","155:3","155:4","156:0","156:1","156:2","156:3","156:4","156:5","156:6","156:7","157:0","157:1","157:2","157:3","157:4","157:5","157:8","157:9","157:10","157:11","157:12","157:13","158:0","158:1","158:2","158:3","158:4","158:5","158:8","158:9","158:10","158:11","158:12","158:13","159:0","159:1","159:2","159:3","159:4","159:5","159:6","159:7","159:8","159:9","159:10","159:11","159:12","159:13","159:14","159:15","160:0","160:1","160:2","160:3","160:4","160:5","160:6","160:7","160:8","160:9","160:10","160:11","160:12","160:13","160:14","160:15","161:0","161:1","161:4","161:5","161:8","161:9","161:12","161:13","162:0","162:1","162:4","162:5","162:8","162:9","162:12","162:13","163:0","163:1","163:2","163:3","163:4","163:5","163:6","163:7","164:0","164:1","164:2","164:3","164:4","164:5","164:6","164:7","165:0","166:0","167:0","167:1","167:2","167:3","167:4","167:5","167:6","167:7","167:8","167:9","167:10","167:11","167:12","167:13","167:14","167:15","168:0","168:1","168:2","169:0","170:0","170:4","170:8","171:0","171:1","171:2","171:3","171:4","171:5","171:6","171:7","171:8","171:9","171:10","171:11","171:12","171:13","171:14","171:15","172:0","173:0","174:0","175:0","175:1","175:2","175:3","175:4","175:5","175:8","176:0","176:1","176:2","176:3","176:4","176:5","176:6","176:7","176:8","176:9","176:10","176:11","176:12","176:13","176:14","176:15","177:2","177:3","177:4","177:5","178:0","178:1","178:2","178:3","178:4","178:5","178:6","178:7","178:8","178:9","178:10","178:11","178:12","178:13","178:14","178:15","179:0","179:1","179:2","180:0","180:1","180:2","180:3","180:4","180:5","180:6","180:7","181:0","181:8","182:0","182:8","183:0","183:1","183:2","183:3","183:4","183:5","183:6","183:7","183:8","183:9","183:10","183:11","183:12","183:13","183:14","183:15","184:0","184:1","184:2","184:3","184:4","184:5","184:6","184:7","184:8","184:9","184:10","184:11","184:12","184:13","184:14","184:15","185:0","185:1","185:2","185:3","185:4","185:5","185:6","185:7","185:8","185:9","185:10","185:11","185:12","185:13","185:14","185:15","186:0","186:1","186:2","186:3","186:4","186:5","186:6","186:7","186:8","186:9","186:10","186:11","186:12","186:13","186:14","186:15","187:0","187:1","187:2","187:3","187:4","187:5","187:6","187:7","187:8","187:9","187:10","187:11","187:12","187:13","187:14","187:15","188:0","189:0","190:0","191:0","192:0","193:0","193:1","193:2","193:3","193:4","193:5","193:6","193:7","193:8","193:9","193:10","193:11","194:0","194:1","194:2","194:3","194:4","194:5","194:6","194:7","194:8","194:9","194:10","194:11","195:0","195:1","195:2","195:3","195:4","195:5","195:6","195:7","195:8","195:9","195:10","195:11","196:0","196:1","196:2","196:3","196:4","196:5","196:6","196:7","196:8","196:9","196:10","196:11","197:0","197:1","197:2","197:3","197:4","197:5","197:6","197:7","197:8","197:9","197:10","197:11"] -- -1.8.5.2 (Apple Git-48) +1.8.4.msysgit.0