Search in sources :

Example 6 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)

Example 7 with NetworkPlayerInfo

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

the class GCEntityOtherPlayerMP method getLocationCape.

@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)

Example 8 with NetworkPlayerInfo

use of net.minecraft.client.network.NetworkPlayerInfo in project ct.js by ChatTriggers.

the class TabList method getNames.

/**
 * Gets all names in tabs without formatting
 *
 * @return the unformatted names
 */
public static List<String> getNames() {
    List<String> names = new ArrayList<>();
    Ordering<NetworkPlayerInfo> tab = Ordering.from(new PlayerComparator());
    if (Player.getPlayer() == null)
        return names;
    NetHandlerPlayClient nethandlerplayclient = Player.getPlayer().sendQueue;
    List<NetworkPlayerInfo> list = tab.sortedCopy(nethandlerplayclient.getPlayerInfoMap());
    for (NetworkPlayerInfo player : list) {
        names.add(player.getGameProfile().getName());
    }
    return names;
}
Also used : NetworkPlayerInfo(net.minecraft.client.network.NetworkPlayerInfo) NetHandlerPlayClient(net.minecraft.client.network.NetHandlerPlayClient) ArrayList(java.util.ArrayList)

Example 9 with NetworkPlayerInfo

use of net.minecraft.client.network.NetworkPlayerInfo in project GregTech by GregTechCE.

the class ClientProxy method onPlayerRender.

@SubscribeEvent
public static void onPlayerRender(RenderPlayerEvent.Pre event) {
    AbstractClientPlayer clientPlayer = (AbstractClientPlayer) event.getEntityPlayer();
    if (capeHoldersUUIDs.contains(clientPlayer.getUniqueID()) && clientPlayer.hasPlayerInfo() && clientPlayer.getLocationCape() == null) {
        NetworkPlayerInfo playerInfo = ObfuscationReflectionHelper.getPrivateValue(AbstractClientPlayer.class, clientPlayer, 0);
        Map<Type, ResourceLocation> playerTextures = ObfuscationReflectionHelper.getPrivateValue(NetworkPlayerInfo.class, playerInfo, 1);
        playerTextures.put(Type.CAPE, GREGTECH_CAPE_TEXTURE);
    }
}
Also used : AbstractClientPlayer(net.minecraft.client.entity.AbstractClientPlayer) Type(com.mojang.authlib.minecraft.MinecraftProfileTexture.Type) NetworkPlayerInfo(net.minecraft.client.network.NetworkPlayerInfo) ResourceLocation(net.minecraft.util.ResourceLocation) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 10 with NetworkPlayerInfo

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

the class NameProtectMod method protect.

public String protect(String string) {
    if (!isActive() || WMinecraft.getPlayer() == null)
        return string;
    String me = Minecraft.getMinecraft().session.getUsername();
    if (string.contains(me))
        return string.replace(me, "�oMe�r");
    int i = 0;
    for (NetworkPlayerInfo info : WMinecraft.getConnection().getPlayerInfoMap()) {
        i++;
        String name = info.getPlayerNameForReal().replaceAll("�\\w", "");
        if (string.contains(name))
            return string.replace(name, "�oPlayer" + i + "�r");
    }
    for (EntityPlayer player : WMinecraft.getWorld().playerEntities) {
        i++;
        String name = player.getName();
        if (string.contains(name))
            return string.replace(name, "�oPlayer" + i + "�r");
    }
    return string;
}
Also used : NetworkPlayerInfo(net.minecraft.client.network.NetworkPlayerInfo) EntityPlayer(net.minecraft.entity.player.EntityPlayer)

Aggregations

NetworkPlayerInfo (net.minecraft.client.network.NetworkPlayerInfo)19 NetHandlerPlayClient (net.minecraft.client.network.NetHandlerPlayClient)5 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)4 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 ResourceLocation (net.minecraft.util.ResourceLocation)4 UUID (java.util.UUID)3 ArrayList (java.util.ArrayList)2 EntitySpaceshipBase (micdoodle8.mods.galacticraft.api.prefab.entity.EntitySpaceshipBase)2 Minecraft (net.minecraft.client.Minecraft)2 AbstractClientPlayer (net.minecraft.client.entity.AbstractClientPlayer)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 IMixinAbstractClientPlayer (cc.hyperium.mixins.client.entity.IMixinAbstractClientPlayer)1 IMixinGuiPlayerTabOverlay (cc.hyperium.mixins.client.gui.IMixinGuiPlayerTabOverlay)1 IMixinNetworkPlayerInfo (cc.hyperium.mixins.client.network.IMixinNetworkPlayerInfo)1 LevelheadPurchaseStates (cc.hyperium.mods.levelhead.purchases.LevelheadPurchaseStates)1 StaffUtils (cc.hyperium.utils.StaffUtils)1 GameProfile (com.mojang.authlib.GameProfile)1