mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 03:39:09 +00:00
Created Server-safe method to get EntityPlayer from GameProfile
This commit is contained in:
1 parent
c51e01987c
commit
fe8d55f38f
9 files changed
+34
-15
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user