Paper/CraftBukkit-Patches/0068-Implement-Locale-Getter-for-Players.patch

40 lines
1.6 KiB
Diff
Raw Normal View History

2016-03-02 22:28:13 +01:00
From 91de49dc685e28082f2060813a712900d00ef634 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
2016-03-02 22:28:13 +01:00
index 91b5e2e..7df4d87 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
2016-02-29 22:33:06 +01:00
@@ -25,7 +25,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class EntityPlayer extends EntityHuman implements ICrafting {
2016-02-29 22:33:06 +01:00
private static final Logger bQ = LogManager.getLogger();
- private String locale = "en_US";
2016-02-29 22:33:06 +01:00
+ public String locale = "en_US"; // Spigot private -> public
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
2016-03-02 22:28:13 +01:00
index 28fc6e6..8307458 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
2016-03-02 22:28:13 +01:00
@@ -1490,6 +1490,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().playerConnection.sendPacket( packet );
}
}
+
+ @Override
+ public String getLocale()
+ {
+ return getHandle().locale;
+ }
};
public Player.Spigot spigot()
--
2016-02-29 22:33:06 +01:00
2.5.0