PaperSpigot-Parent/CraftBukkit-Patches/0081-Implement-Locale-Getter-for-Players.patch

40 lines
1.5 KiB
Diff
Raw Normal View History

2014-11-28 02:17:45 +01:00
From 513e8be75d433d8efcb799148b4ced24e5a933fc Mon Sep 17 00:00:00 2001
From: Smove <jan@lavasurvival.net>
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
2014-11-28 02:17:45 +01:00
index 5578300..67230f6 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
2014-11-28 02:17:45 +01:00
@@ -27,7 +27,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class EntityPlayer extends EntityHuman implements ICrafting {
2014-11-28 02:17:45 +01:00
private static final Logger bF = 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
2014-11-28 02:17:45 +01:00
index a00d630..9d609c2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
2014-11-28 02:17:45 +01:00
@@ -1399,6 +1399,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().playerConnection.sendPacket( packet );
}
}
+
+ @Override
+ public String getLocale()
+ {
+ return getHandle().locale;
+ }
};
public Player.Spigot spigot()
--
2014-11-28 02:17:45 +01:00
2.1.0