Created Server-safe method to get EntityPlayer from GameProfile

This commit is contained in:
mezz committed 2014-09-18 22:41:48 -07:00
1 parent c51e01987c
commit fe8d55f38f
9 files changed
+34 -15

No files matched your search

+1 -8
View File
@@ -143,18 +143,11 @@ public class MailAddress implements INBTTagable, IMailAddress {
return address;
}
public EntityPlayer getPlayer(World world) {
if (!this.isPlayer())
return null;
return world.getPlayerEntityByName(this.gameProfile.getName());
}
public boolean isClientPlayer(World world) {
if (!this.isPlayer())
return false;
EntityPlayer addressPlayer = this.getPlayer(world);
EntityPlayer addressPlayer = Proxies.common.getPlayer(world, gameProfile);
EntityPlayer clientPlayer = Proxies.common.getPlayer();
return addressPlayer != null && clientPlayer != null && clientPlayer.equals(addressPlayer);