From b4530237fb385a8a885e655ddf72b27da8d02a0d Mon Sep 17 00:00:00 2001 From: Smove Date: Sat, 1 Feb 2014 18:12:22 +1100 Subject: [PATCH] Implement Locale Getter for Players --- ...-Implement-Locale-Getter-for-Players.patch | 30 ++++++++++++++ .../0041-Disallow-Interaction-With-Self.patch | 6 +-- ...Remove-OS-X-Special-Chars-from-Signs.patch | 6 +-- ...-Implement-Locale-Getter-for-Players.patch | 39 +++++++++++++++++++ 4 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 Bukkit-Patches/0023-Implement-Locale-Getter-for-Players.patch create mode 100644 CraftBukkit-Patches/0106-Implement-Locale-Getter-for-Players.patch diff --git a/Bukkit-Patches/0023-Implement-Locale-Getter-for-Players.patch b/Bukkit-Patches/0023-Implement-Locale-Getter-for-Players.patch new file mode 100644 index 000000000..79d5b5a90 --- /dev/null +++ b/Bukkit-Patches/0023-Implement-Locale-Getter-for-Players.patch @@ -0,0 +1,30 @@ +From a75411c70903a67ed6353397dc4513551fb61d7a Mon Sep 17 00:00:00 2001 +From: Smove +Date: Sat, 1 Feb 2014 18:10:49 +1100 +Subject: [PATCH] Implement Locale Getter for Players + + +diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java +index adef230..8489bc9 100644 +--- a/src/main/java/org/bukkit/entity/Player.java ++++ b/src/main/java/org/bukkit/entity/Player.java +@@ -1067,6 +1067,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline + { + throw new UnsupportedOperationException( "Not supported yet." ); + } ++ ++ /** ++ * Gets player locale language. ++ * ++ * @return the player's client language settings ++ */ ++ public String getLocale() ++ { ++ throw new UnsupportedOperationException( "Not supported yet." ); ++ } + } + + Spigot spigot(); +-- +1.8.3.2 + diff --git a/CraftBukkit-Patches/0041-Disallow-Interaction-With-Self.patch b/CraftBukkit-Patches/0041-Disallow-Interaction-With-Self.patch index 7ee798227..7f6791f60 100644 --- a/CraftBukkit-Patches/0041-Disallow-Interaction-With-Self.patch +++ b/CraftBukkit-Patches/0041-Disallow-Interaction-With-Self.patch @@ -1,14 +1,14 @@ -From 45a1459ce02062300b758f2053a689b87f074ac0 Mon Sep 17 00:00:00 2001 +From d206e513d6dcf5b1cd4278d5fb2742915385bc41 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 28 Jun 2013 19:52:54 +1000 Subject: [PATCH] Disallow Interaction With Self diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 31be464..6e54ad1 100644 +index 08cf293..018127b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1047,6 +1047,13 @@ public class PlayerConnection implements PacketPlayInListener { +@@ -1037,6 +1037,13 @@ public class PlayerConnection implements PacketPlayInListener { if (this.player.dead) return; // CraftBukkit WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); Entity entity = packetplayinuseentity.a((World) worldserver); diff --git a/CraftBukkit-Patches/0067-Remove-OS-X-Special-Chars-from-Signs.patch b/CraftBukkit-Patches/0067-Remove-OS-X-Special-Chars-from-Signs.patch index 70eb5e4da..6ad2cc393 100644 --- a/CraftBukkit-Patches/0067-Remove-OS-X-Special-Chars-from-Signs.patch +++ b/CraftBukkit-Patches/0067-Remove-OS-X-Special-Chars-from-Signs.patch @@ -1,14 +1,14 @@ -From 5d7b5a54c8934babbd9e8250971df954ecea9c61 Mon Sep 17 00:00:00 2001 +From 48e13501d3e0d30e4bcc0a875894254e87f5029b Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 8 Dec 2013 16:52:42 +1100 Subject: [PATCH] Remove OS X Special Chars from Signs diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e88adfa..1903362 100644 +index 733b9d3..a462492 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1562,6 +1562,7 @@ public class PlayerConnection implements PacketPlayInListener { +@@ -1552,6 +1552,7 @@ public class PlayerConnection implements PacketPlayInListener { for (j = 0; j < 4; ++j) { boolean flag = true; diff --git a/CraftBukkit-Patches/0106-Implement-Locale-Getter-for-Players.patch b/CraftBukkit-Patches/0106-Implement-Locale-Getter-for-Players.patch new file mode 100644 index 000000000..19ae4de04 --- /dev/null +++ b/CraftBukkit-Patches/0106-Implement-Locale-Getter-for-Players.patch @@ -0,0 +1,39 @@ +From 6b6b2aa138326bf742a1a379b23ae083617ab565 Mon Sep 17 00:00:00 2001 +From: Smove +Date: Sat, 1 Feb 2014 18:12:16 +1100 +Subject: [PATCH] Implement Locale Getter for Players + + +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index a4c8843..ec73994 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -30,7 +30,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; + public class EntityPlayer extends EntityHuman implements ICrafting { + + private static final Logger bM = LogManager.getLogger(); +- private String locale = "en_US"; ++ public String locale = "en_US"; // Spigot + public PlayerConnection playerConnection; + public final MinecraftServer server; + public final PlayerInteractManager playerInteractManager; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 16b1fc9..1bb1a8f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -1294,6 +1294,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + server.getServer().getPlayerList().moveToWorld( getHandle(), 0, false ); + } + } ++ ++ @Override ++ public String getLocale() ++ { ++ return getHandle().locale; ++ } + }; + + public Player.Spigot spigot() +-- +1.8.3.2 +