Search in sources :

Example 1 with NetworkPlayerInfo

use of net.minecraft.client.network.NetworkPlayerInfo in project BetterQuesting by Funwayguy.

the class GuiPartyInvite method refreshGui.

@Override
public void refreshGui() {
    this.party = PartyManager.INSTANCE.getValue(partyID);
    NetHandlerPlayClient nethandlerplayclient = mc.player.connection;
    playerList.clear();
    playerList.addAll(NameCache.INSTANCE.getAllNames());
    for (NetworkPlayerInfo info : nethandlerplayclient.getPlayerInfoMap()) {
        if (!playerList.contains(info.getGameProfile().getName())) {
            playerList.add(info.getGameProfile().getName());
        }
    }
    RefreshColumns();
}
Also used : NetworkPlayerInfo(net.minecraft.client.network.NetworkPlayerInfo) NetHandlerPlayClient(net.minecraft.client.network.NetHandlerPlayClient)

Example 2 with NetworkPlayerInfo

use of net.minecraft.client.network.NetworkPlayerInfo in project BetterQuesting by Funwayguy.

the class GuiPartyInvite method initGui.

@Override
public void initGui() {
    super.initGui();
    maxRows = (sizeY - 92) / 20;
    NetHandlerPlayClient nethandlerplayclient = mc.player.connection;
    playerList.clear();
    playerList.addAll(NameCache.INSTANCE.getAllNames());
    for (NetworkPlayerInfo info : nethandlerplayclient.getPlayerInfoMap()) {
        if (!playerList.contains(info.getGameProfile().getName())) {
            playerList.add(info.getGameProfile().getName());
        }
    }
    this.txtManual = new GuiBigTextField(this.fontRenderer, guiLeft + sizeX / 2 - 149, guiTop + 33, 198, 18);
    this.txtManual.setWatermark("Username");
    this.btnManual = new GuiButtonThemed(this.buttonList.size(), guiLeft + sizeX / 2 + 50, guiTop + 32, 100, 20, I18n.format("betterquesting.btn.party_invite"), true);
    this.buttonList.add(btnManual);
    for (int i = 0; i < maxRows * 3; i++) {
        GuiButtonThemed btn = new GuiButtonThemed(this.buttonList.size(), guiLeft + sizeX / 2 - 150 + ((i % 3) * 100), guiTop + 68 + (i / 3 * 20), 100, 20, "Username", true);
        this.buttonList.add(btn);
    }
    RefreshColumns();
}
Also used : NetworkPlayerInfo(net.minecraft.client.network.NetworkPlayerInfo) NetHandlerPlayClient(net.minecraft.client.network.NetHandlerPlayClient) GuiBigTextField(betterquesting.api.client.gui.controls.GuiBigTextField) GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed)

Example 3 with NetworkPlayerInfo

use of net.minecraft.client.network.NetworkPlayerInfo in project Wurst-MC-1.12 by Wurst-Imperium.

the class AddAltCmd method call.

@Override
public void call(String[] args) throws CmdException {
    if (args.length != 1)
        throw new CmdSyntaxError();
    if (args[0].equals("all")) {
        int alts = 0;
        for (NetworkPlayerInfo info : WMinecraft.getConnection().getPlayerInfoMap()) {
            String name = StringUtils.stripControlCodes(info.getPlayerNameForReal());
            if (name.equals(WMinecraft.getPlayer().getName()) || name.equals("Alexander01998") || GuiAltList.alts.contains(new Alt(name, null, null)))
                continue;
            GuiAltList.alts.add(new Alt(name, null, null));
            alts++;
        }
        if (alts == 1)
            ChatUtils.message("Added 1 alt.");
        else
            ChatUtils.message("Added " + alts + " alts.");
        GuiAltList.sortAlts();
        ConfigFiles.ALTS.save();
    } else if (!args[0].equals("Alexander01998")) {
        GuiAltList.alts.add(new Alt(args[0], null, null));
        GuiAltList.sortAlts();
        ConfigFiles.ALTS.save();
        ChatUtils.message("Added 1 alt.");
    }
}
Also used : NetworkPlayerInfo(net.minecraft.client.network.NetworkPlayerInfo) Alt(net.wurstclient.altmanager.Alt)

Example 4 with NetworkPlayerInfo

use of net.minecraft.client.network.NetworkPlayerInfo in project Kingdom-Keys-Re-Coded by Wehavecookies56.

the class StaticCape method loadTexture.

@Override
public void loadTexture(AbstractClientPlayer player) {
    ResourceLocation location = getLocation();
    // Wehavecookies56: Added obfuscated field names for reflection and fixed for 1.9
    try {
        Field playerInfoF = ReflectionHelper.findField(AbstractClientPlayer.class, "playerInfo", "field_175157_a");
        playerInfoF.setAccessible(true);
        NetworkPlayerInfo nci = (NetworkPlayerInfo) playerInfoF.get(player);
        Field playerTexturesF = ReflectionHelper.findField(NetworkPlayerInfo.class, "playerTextures", "field_187107_a");
        playerTexturesF.setAccessible(true);
        ((Map) playerTexturesF.get(nci)).put(Type.CAPE, location);
        playerInfoF.setAccessible(false);
        playerTexturesF.setAccessible(false);
    } catch (Exception e) {
        e.printStackTrace();
        DevCapes.getInstance();
        DevCapes.logger.error("Setting cape ResourceLocation failed!");
    }
    Minecraft.getMinecraft().renderEngine.loadTexture(location, getTexture());
}
Also used : Field(java.lang.reflect.Field) NetworkPlayerInfo(net.minecraft.client.network.NetworkPlayerInfo) ResourceLocation(net.minecraft.util.ResourceLocation) Map(java.util.Map)

Example 5 with NetworkPlayerInfo

use of net.minecraft.client.network.NetworkPlayerInfo in project Galacticraft by micdoodle8.

the class GCEntityClientPlayerMP method getLocationCape.

// 
// @Override
// @SideOnly(Side.CLIENT)
// public void setVelocity(double xx, double yy, double zz)
// {
// if (this.worldObj.provider instanceof WorldProviderOrbit)
// {
// ((WorldProviderOrbit)this.worldObj.provider).setVelocityClient(this, xx, yy, zz);
// }
// super.setVelocity(xx, yy, zz);
// }
// 
/*@Override
    public void setInPortal()
    {
    	if (!(this.worldObj.provider instanceof IGalacticraftWorldProvider))
    	{
    		super.setInPortal();
    	}
    } TODO Fix disable of portal */
@Override
public ResourceLocation getLocationCape() {
    if (this.ridingEntity instanceof EntitySpaceshipBase) {
        // Don't draw any cape if riding a rocket (the cape renders outside the rocket model!)
        return null;
    }
    ResourceLocation vanillaCape = super.getLocationCape();
    if (!this.checkedCape) {
        NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo();
        this.galacticraftCape = ClientProxyCore.capeMap.get(networkplayerinfo.getGameProfile().getName());
        this.checkedCape = true;
    }
    if ((ConfigManagerCore.overrideCapes || vanillaCape == null) && galacticraftCape != null) {
        return galacticraftCape;
    }
    return vanillaCape;
}
Also used : EntitySpaceshipBase(micdoodle8.mods.galacticraft.api.prefab.entity.EntitySpaceshipBase) NetworkPlayerInfo(net.minecraft.client.network.NetworkPlayerInfo) ResourceLocation(net.minecraft.util.ResourceLocation)

Aggregations

NetworkPlayerInfo (net.minecraft.client.network.NetworkPlayerInfo)13 NetHandlerPlayClient (net.minecraft.client.network.NetHandlerPlayClient)4 EntityPlayer (net.minecraft.entity.player.EntityPlayer)3 ResourceLocation (net.minecraft.util.ResourceLocation)3 ArrayList (java.util.ArrayList)2 UUID (java.util.UUID)2 EntitySpaceshipBase (micdoodle8.mods.galacticraft.api.prefab.entity.EntitySpaceshipBase)2 Minecraft (net.minecraft.client.Minecraft)2 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)2 World (net.minecraft.world.World)2 Text (org.spongepowered.api.text.Text)2 GuiBigTextField (betterquesting.api.client.gui.controls.GuiBigTextField)1 GuiButtonThemed (betterquesting.api.client.gui.controls.GuiButtonThemed)1 Field (java.lang.reflect.Field)1 Collection (java.util.Collection)1 Map (java.util.Map)1 Alt (net.wurstclient.altmanager.Alt)1