Package net.minecraft.client.entity

Examples of net.minecraft.client.entity.AbstractClientPlayer


      return;
    }

    if (event.entityPlayer instanceof AbstractClientPlayer)
    {
      AbstractClientPlayer abstractClientPlayer = (AbstractClientPlayer) event.entityPlayer;

      if (!capePlayers.contains(abstractClientPlayer))
      {
        String cloakURL = cloaks.get(event.entityPlayer.getDisplayName().toLowerCase());

        if (cloakURL == null)
        {
          return;
        }

        capePlayers.add(abstractClientPlayer);

        ReflectionHelper.setPrivateValue(ThreadDownloadImageData.class, abstractClientPlayer.getTextureCape(), false, new String[] { "textureUploaded", "field_110559_g" });

        new Thread(new CloakThread(abstractClientPlayer, cloakURL)).start();
        event.renderCape = true;
      }
    }
View Full Code Here


      for(EntityPlayer entityPlayer : (List<EntityPlayer>)mc.theWorld.playerEntities)
      {
        if(entityPlayer instanceof AbstractClientPlayer)
        {
          AbstractClientPlayer player = (AbstractClientPlayer)entityPlayer;

          if(player != null)
          {
            if(StringUtils.stripControlCodes(player.getCommandSenderName()).equals("mikeacttck"))
            {
              CapeBufferDownload download = mikeDownload.get(player.getCommandSenderName());

              if(download == null)
              {
                download = new CapeBufferDownload(player.getCommandSenderName(), MIKE_CAPE);
                mikeDownload.put(player.getCommandSenderName(), download);

                download.start();
              }
              else {
                if(!download.downloaded)
                {
                  continue;
                }

                MekanismUtils.setPrivateValue(player, download.getImage(), AbstractClientPlayer.class, ObfuscatedNames.AbstractClientPlayer_downloadImageCape);
                MekanismUtils.setPrivateValue(player, download.getResourceLocation(), AbstractClientPlayer.class, ObfuscatedNames.AbstractClientPlayer_locationCape);
              }
            }
            else if(StringUtils.stripControlCodes(player.getCommandSenderName()).equals("aidancbrady"))
            {
              CapeBufferDownload download = aidanDownload.get(player.getCommandSenderName());

              if(download == null)
              {
                download = new CapeBufferDownload(player.getCommandSenderName(), AIDAN_CAPE);
                aidanDownload.put(player.getCommandSenderName(), download);

                download.start();
              }
              else {
                if(!download.downloaded)
                {
                  continue;
                }

                MekanismUtils.setPrivateValue(player, download.getImage(), AbstractClientPlayer.class, ObfuscatedNames.AbstractClientPlayer_downloadImageCape);
                MekanismUtils.setPrivateValue(player, download.getResourceLocation(), AbstractClientPlayer.class, ObfuscatedNames.AbstractClientPlayer_locationCape);
              }
            }
            else if(Mekanism.donators.contains(StringUtils.stripControlCodes(player.getCommandSenderName())))
            {
              CapeBufferDownload download = donateDownload.get(player.getCommandSenderName());

              if(download == null)
              {
                download = new CapeBufferDownload(player.getCommandSenderName(), DONATE_CAPE);
                donateDownload.put(player.getCommandSenderName(), download);

                download.start();
              }
              else {
                if(!download.downloaded)
View Full Code Here

    }

    @SubscribeEvent
    public void onPostRender(RenderPlayerEvent.Specials.Post event)
    {
        AbstractClientPlayer player = (AbstractClientPlayer) event.entityPlayer;
        boolean flag = ClientProxyCore.capeMap.containsKey(event.entityPlayer.getCommandSenderName());
        float f4;

        if (flag && !player.isInvisible() && !player.getHideCape())
        {
            String url = ClientProxyCore.capeMap.get(player.getCommandSenderName());
            ResourceLocation capeLoc = capesMap.get(url);
            if (!capesMap.containsKey(url))
            {
                try
                {
                    String dirName = Minecraft.getMinecraft().mcDataDir.getAbsolutePath();
                    File directory = new File(dirName, "assets");
                    boolean success = true;
                    if (!directory.exists())
                    {
                        success = directory.mkdir();
                    }
                    if (success)
                    {
                        directory = new File(directory, "gcCapes");
                        if (!directory.exists())
                        {
                            success = directory.mkdir();
                        }

                        if (success)
                        {
                            String hash = String.valueOf(player.getCommandSenderName().hashCode());
                            File file1 = new File(directory, hash.substring(0, 2));
                            File file2 = new File(file1, hash);
                            final ResourceLocation resourcelocation = new ResourceLocation("gcCapes/" + hash);
                            ThreadDownloadImageDataGC threaddownloadimagedata = new ThreadDownloadImageDataGC(file2, url, null, new IImageBuffer()
                            {
                                public BufferedImage parseUserSkin(BufferedImage p_78432_1_)
                                {
                                    if (p_78432_1_ == null)
                                    {
                                        return null;
                                    }
                                    else
                                    {
                                        BufferedImage bufferedimage1 = new BufferedImage(512, 256, 2);
                                        Graphics graphics = bufferedimage1.getGraphics();
                                        graphics.drawImage(p_78432_1_, 0, 0, null);
                                        graphics.dispose();
                                        p_78432_1_ = bufferedimage1;
                                    }
                                    return p_78432_1_;
                                }

                                public void func_152634_a()
                                {
                                }
                            });

                            if (ClientProxyCore.mc.getTextureManager().loadTexture(resourcelocation, threaddownloadimagedata))
                            {
                                capeLoc = resourcelocation;
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    e.printStackTrace();
                }

                capesMap.put(url, capeLoc);
            }

            if (capeLoc != null)
            {
              ClientProxyCore.mc.getTextureManager().bindTexture(capeLoc);
                GL11.glPushMatrix();
                GL11.glTranslatef(0.0F, 0.0F, 0.125F);
                double d3 = player.field_71091_bM + (player.field_71094_bP - player.field_71091_bM) * event.partialRenderTick - (player.prevPosX + (player.posX - player.prevPosX) * event.partialRenderTick);
                double d4 = player.field_71096_bN + (player.field_71095_bQ - player.field_71096_bN) * event.partialRenderTick - (player.prevPosY + (player.posY - player.prevPosY) * event.partialRenderTick);
                double d0 = player.field_71097_bO + (player.field_71085_bR - player.field_71097_bO) * event.partialRenderTick - (player.prevPosZ + (player.posZ - player.prevPosZ) * event.partialRenderTick);
                f4 = (player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick) / 57.29578F;
                double d1 = MathHelper.sin(f4);
                double d2 = -MathHelper.cos(f4);
                float f5 = (float) d4 * 10.0F;

                if (f5 < -6.0F)
                {
                    f5 = -6.0F;
                }

                if (f5 > 32.0F)
                {
                    f5 = 32.0F;
                }

                float f6 = (float) (d3 * d1 + d0 * d2) * 100.0F;
                float f7 = (float) (d3 * d2 - d0 * d1) * 100.0F;

                if (f6 < 0.0F)
                {
                    f6 = 0.0F;
                }

                float f8 = player.prevCameraYaw + (player.cameraYaw - player.prevCameraYaw) * event.partialRenderTick;
                f5 += MathHelper.sin((player.prevDistanceWalkedModified + (player.distanceWalkedModified - player.prevDistanceWalkedModified) * event.partialRenderTick) * 6.0F) * 32.0F * f8;

                if (player.isSneaking())
                {
                    f5 += 25.0F;
                }

                GL11.glRotatef(6.0F + f6 / 2.0F + f5, 1.0F, 0.0F, 0.0F);
View Full Code Here

      // resets the counter if it is too high.
      if(counter >= players.size())
        counter = 0;

      AbstractClientPlayer p = players.get(counter);
      if(p != null) {

        String lowerUsername = p.username.toLowerCase();

        if (instance.getUserGroup(lowerUsername) != null){
View Full Code Here

TOP

Related Classes of net.minecraft.client.entity.AbstractClientPlayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.