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