Cleaned up use of MailAddress

This commit is contained in:
James Mitchell committed 2014-08-18 22:37:05 -07:00
1 parent 54018d8d6e
commit 91713c8fb8
22 files changed
+123 -180

No files matched your search

@@ -11,11 +11,8 @@
package forestry.mail.proxy;
import forestry.api.mail.MailAddress;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.world.World;
import com.mojang.authlib.GameProfile;
import forestry.core.network.ForestryPacket;
import forestry.core.network.PacketIds;
import forestry.core.proxy.Proxies;
@@ -50,15 +47,7 @@ public class ClientProxyMail extends ProxyMail {
@Override
public void setPOBoxInfo(World world, MailAddress address, POBoxInfo info) {
if (!address.isPlayer())
throw new IllegalArgumentException("POBox address must be a player");
GameProfile playerProfile = (GameProfile)address.getIdentifier();
EntityClientPlayerMP player = Proxies.common.getClientInstance().thePlayer;
if (player == null || !player.getGameProfile().equals(playerProfile))
return;
GuiMailboxInfo.instance.setPOBoxInfo(info);
if (address.isClientPlayer(world))
GuiMailboxInfo.instance.setPOBoxInfo(info);
}
}