use of net.minecraft.client.entity.AbstractClientPlayer in project Galacticraft by micdoodle8.
the class PlayerUtil method makeOtherPlayerProfile.
@SideOnly(Side.CLIENT)
public static GameProfile makeOtherPlayerProfile(String strName, String strUUID) {
GameProfile profile = null;
for (Object e : FMLClientHandler.instance().getWorldClient().getLoadedEntityList()) {
if (e instanceof AbstractClientPlayer) {
GameProfile gp2 = ((AbstractClientPlayer) e).getGameProfile();
if (gp2.getName().equals(strName)) {
profile = gp2;
break;
}
}
}
if (profile == null) {
UUID uuid = strUUID.isEmpty() ? UUID.randomUUID() : UUID.fromString(strUUID);
profile = new GameProfile(uuid, strName);
}
PlayerUtil.knownSkins.put(strName, profile);
return profile;
}
use of net.minecraft.client.entity.AbstractClientPlayer in project EnderIO by SleepyTrousers.
the class UpgradeRenderManager method replaceCapeLayer.
private static void replaceCapeLayer(@Nonnull RenderPlayer renderLivingBase) {
try {
List<LayerRenderer<AbstractClientPlayer>> value = ReflectionHelper.getPrivateValue(RenderLivingBase.class, renderLivingBase, "layerRenderers", "field_177097_h");
if (value != null) {
LayerRenderer<AbstractClientPlayer> capeLayer = null;
for (LayerRenderer<AbstractClientPlayer> layerRenderer : value) {
if (layerRenderer instanceof LayerCape && !(layerRenderer instanceof CapeFilterLayer)) {
capeLayer = layerRenderer;
break;
}
}
if (capeLayer != null) {
renderLivingBase.addLayer(new CapeFilterLayer(capeLayer));
value.remove(capeLayer);
}
}
} catch (UnableToAccessFieldException e) {
Log.warn("Unable to access RenderLivingBase.layerRenderers, reason: " + e);
}
}
use of net.minecraft.client.entity.AbstractClientPlayer in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class RenderEventHandler method renderPlayer.
// mmdanggg2: renderPlayerEvent seems to be getting depreciated so this will
// do for now.
@SubscribeEvent
public void renderPlayer(RenderLivingEvent.Pre event) {
if (event.getEntity() instanceof AbstractClientPlayer) {
AbstractClientPlayer player = (AbstractClientPlayer) event.getEntity();
UserManager manager = UserManager.getInstance();
User user = manager.getUser(player.getUniqueID().toString());
if (user == null)
return;
ICape cape = user.capes.get(0);
if (cape == null)
return;
boolean flag = cape.isTextureLoaded(player);
if (!flag)
cape.loadTexture(player);
}
}
use of net.minecraft.client.entity.AbstractClientPlayer in project takumicraft by TNTModders.
the class TakumiClientEvents method renderPlayer.
@SubscribeEvent
public void renderPlayer(Pre event) {
if (TakumiUtils.isApril(Minecraft.getMinecraft().world) && (event.getRenderer() instanceof RenderPlayer && !(event.getRenderer() instanceof RenderPlayerSP)) && event.getEntity() instanceof AbstractClientPlayer) {
event.setCanceled(true);
RenderPlayerSP sp = new RenderPlayerSP(event.getRenderer().getRenderManager());
sp.doRender(((AbstractClientPlayer) event.getEntity()), event.getX(), event.getY(), event.getZ(), ((AbstractClientPlayer) event.getEntity()).rotationYaw, event.getPartialRenderTick());
}
if (event.getEntity().isPotionActive(TakumiPotionCore.INVERSION)) {
GlStateManager.popMatrix();
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.translate(0, -1.9, 0);
}
if (event.getEntity().isPotionActive(TakumiPotionCore.CREEPERED)) {
GlStateManager.popMatrix();
float f = this.getCreeperFlashIntensity(event.getEntity(), event.getPartialRenderTick());
if (f > 0) {
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
f = MathHelper.clamp(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
float f2 = (1.0F + f * 0.4F) * f1;
float f3 = (1.0F + f * 0.1F) / f1;
GlStateManager.scale(f2, f3, f2);
}
}
}
use of net.minecraft.client.entity.AbstractClientPlayer in project Armourers-Workshop by RiskyKen.
the class SkinModelRenderer method getPlayerExtraColours.
public byte[] getPlayerExtraColours(Entity entity) {
if (!(entity instanceof AbstractClientPlayer)) {
return null;
}
AbstractClientPlayer player = (AbstractClientPlayer) entity;
EntityEquipmentData equipmentData = playerEquipmentMap.get(new PlayerPointer(player));
return null;
}
Aggregations