PlayerMenuObject .java

net.minecraft.client.gui.spectator.PlayerMenuObject (class, 48 lines): members: resourceLocation, getSpectatorName, func_178662_A_, func_178661_a, profile.

net.minecraft.client.gui.spectatorclass48 linesclient1.6 KB

Implements

API Surface (4)

void func_178661_a(SpectatorMenu menu)
IChatComponent getSpectatorName()
void func_178663_a(float p_178663_1_, int alpha)
boolean func_178662_A_()

Fields & Constants (2)

profile
resourceLocation

Full Source

PlayerMenuObject.java48 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.gui.spectator;
2
3
import com.mojang.authlib.GameProfile;
4
import net.minecraft.client.Minecraft;
5
import net.minecraft.client.entity.AbstractClientPlayer;
6
import net.minecraft.client.gui.Gui;
7
import net.minecraft.client.renderer.GlStateManager;
8
import net.minecraft.network.play.client.C18PacketSpectate;
9
import net.minecraft.util.ChatComponentText;
10
import net.minecraft.util.IChatComponent;
11
import net.minecraft.util.ResourceLocation;
12
13
public class PlayerMenuObject implements ISpectatorMenuObject
14
{
15
    private final GameProfile profile;
16
    private final ResourceLocation resourceLocation;
17
18
    public PlayerMenuObject(GameProfile profileIn)
19
    {
20
        this.profile = profileIn;
21
        this.resourceLocation = AbstractClientPlayer.getLocationSkin(profileIn.getName());
22
        AbstractClientPlayer.getDownloadImageSkin(this.resourceLocation, profileIn.getName());
23
    }
24
25
    public void func_178661_a(SpectatorMenu menu)
26
    {
27
        Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C18PacketSpectate(this.profile.getId()));
28
    }
29
30
    public IChatComponent getSpectatorName()
31
    {
32
        return new ChatComponentText(this.profile.getName());
33
    }
34
35
    public void func_178663_a(float p_178663_1_, int alpha)
36
    {
37
        Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
38
        GlStateManager.color(1.0F, 1.0F, 1.0F, (float)alpha / 255.0F);
39
        Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
40
        Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
41
    }
42
43
    public boolean func_178662_A_()
44
    {
45
        return true;
46
    }
47
}
48

Deobfuscated MCP 1.8.9 source of PlayerMenuObject from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/gui/spectator/PlayerMenuObject.java), stored verbatim.