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;
}
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;
}
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;
}
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);
}
}
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;
}
Aggregations