Package net.minecraft.client.renderer.entity

Examples of net.minecraft.client.renderer.entity.Render


        GL11.glScalef(f1, f1, f1);
        EntityItem eItem = (EntityItem) objects[1];
        if (entity != null) {
          entity.worldObj = (Minecraft.getMinecraft() != null) ? Minecraft.getMinecraft().theWorld : null;
          if (entity.worldObj != null) {
            Render renderer = RenderManager.instance.getEntityRenderObject(entity);
            entity.setWorld(eItem.worldObj);
            entity.copyLocationAndAnglesFrom(eItem);
            if (renderer != null && renderer.getFontRendererFromRenderManager() != null) {
              GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
              //if (renderWithLighting) RenderUtils.enableLightmap();
              renderer.doRender(entity, 0, 0, 0, 0, 0);
              GL11.glPopAttrib();
            }

          }
          entity.worldObj = null;
        }
        GL11.glPopMatrix();
      case EQUIPPED:
        break;
      case EQUIPPED_FIRST_PERSON:
        break;
      case INVENTORY:
        GL11.glPushMatrix();
        GL11.glTranslated(0.5, 0.2 + verticalOffset, 0.5);
        GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
        GL11.glTranslatef(0.0F, -0.4F, 0.0F);
        GL11.glScalef(f1, f1, f1);
        if (entity != null) {
          entity.worldObj = (Minecraft.getMinecraft() != null) ? Minecraft.getMinecraft().theWorld : null;
          if (entity.worldObj != null) {
            Render renderer = RenderManager.instance.getEntityRenderObject(entity);
            if (renderer != null && renderer.getFontRendererFromRenderManager() != null) {
              GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
              //if (renderWithLighting) RenderUtils.enableLightmap();
              renderer.doRender(entity, 0, 0, 0, 0, 0);
              GL11.glPopAttrib();
            }

          }
          entity.worldObj = null;
View Full Code Here


    @Override
    public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7)
    {
        final Class<?> entityClass = EntityClientPlayerMP.class;
        final Render render = RenderManager.instance.getEntityClassRenderObject(entityClass);
        final ModelBiped modelBipedMain = ((RenderPlayer) render).modelBipedMain;

        this.usingParachute = false;
        boolean wearingMask = false;
        boolean wearingGear = false;
View Full Code Here

    private void init()
    {
        float var1 = 0.0F;

        final Class<?> entityClass = EntityClientPlayerMP.class;
        final Render render = RenderManager.instance.getEntityClassRenderObject(entityClass);
        final ModelBiped modelBipedMain = ((RenderPlayer) render).modelBipedMain;
       
        if (this.modelPlayer.equals(modelBipedMain))
        {
            this.oxygenMask = createModelRenderer(this.modelPlayer, 0, 0, 0);
View Full Code Here

        var9.addVertexWithUV(var1 + 0, var2 + 0, 0.0, (var3 + 0) * var7, (var4 + 0) * var8);
        var9.draw();

        GL11.glColor3f(1.0F, 1.0F, 1.0F);

        Render spaceshipRender = (Render) RenderManager.instance.entityRenderMap.get(OverlayRocket.minecraft.thePlayer.ridingEntity.getClass());

        final int y1 = height / 2 + 60 - (int) Math.floor(Overlay.getPlayerPositionY(OverlayRocket.minecraft.thePlayer) / 10.5F);
        var1 = 2.5F;
        var2 = y1;
        var3 = 8;
        var3b = 40;
        var4 = 8;
        var5 = 8;
        var6 = 8;
        var7 = 1.0F / 64.0F;
        var8 = 1.0F / 32.0F;

        GL11.glPushMatrix();
        final int i = OverlayRocket.minecraft.thePlayer.ridingEntity.getBrightnessForRender(1);
        final int j = i % 65536;
        final int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glEnable(GL11.GL_COLOR_MATERIAL);
        GL11.glTranslatef(var1 + 4, var2 + 6, 50F);
        GL11.glScalef(5F, 5F, 5F);
        GL11.glRotatef(180F, 1, 0, 0);
        GL11.glRotatef(90F, 0, 1, 0);

        try
        {
            spaceshipRender.doRender(OverlayRocket.minecraft.thePlayer.ridingEntity.getClass().getConstructor(World.class).newInstance(OverlayRocket.minecraft.thePlayer.worldObj), 0, 0, 0, 0, 0);
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
View Full Code Here

      String str0 = "No link";
      String str1 = "";
      String str2 = "";
      String str3 = "";
      String str4 = "";
      Render renderEntity = null;
      Entity entity = null;
      float Xmargin = 0;
     
      if (telemeter != null && telemeter.clientData.length >= 3)
      {
          if (telemeter.clientClass != null)
          {
            if (telemeter.clientClass == screen.telemetryLastClass && (telemeter.clientClass != EntityPlayerMP.class || telemeter.clientName.equals(screen.telemetryLastName)))
            {
              //Used cached data from last time if possible
              entity = screen.telemetryLastEntity;
              renderEntity = screen.telemetryLastRender;
              strName = screen.telemetryLastName;
            }
            else
            {             
              //Create an entity to render, based on class, and get its name
              entity = null;
             
              if (telemeter.clientClass == EntityPlayerMP.class)
              {
                strName = telemeter.clientName;
                entity = new EntityOtherPlayerMP(screen.driver.getWorldObj(), telemeter.clientGameProfile);
                renderEntity = (Render) RenderManager.instance.entityRenderMap.get(EntityPlayer.class);
              }
              else
              {
                try {
                  entity = (Entity) telemeter.clientClass.getConstructor(World.class).newInstance(screen.driver.getWorldObj());
                } catch (Exception ex) { }
                if (entity != null) strName = entity.getCommandSenderName();
                renderEntity = (Render) RenderManager.instance.entityRenderMap.get(telemeter.clientClass);
              }             
            }
          }
         
          if (entity instanceof EntityLivingBase)
          {
            //Living entity:
            //  data0 = time to show red damage
            //  data1 = health in half-hearts
            //  data2 = pulse
            //  data3 = hunger
            //  data4 = oxygen
            str0 = telemeter.clientData[0] > 0 ? "ouch!!!!" : "";
          if (telemeter.clientData[1] >= 0)
            {
              str1 = "Health: " + telemeter.clientData[1] + "%";
            }
          else
            str1 = "";
          str2 = "" + telemeter.clientData[2] + " bpm";
          if (telemeter.clientData[3] > -1)
            {
              str3 = "Food: "  + telemeter.clientData[3] + "%";
            }
          if (telemeter.clientData[4] > -1)
            {
              int oxygen = telemeter.clientData[4];
              oxygen = (oxygen % 4096) + (oxygen / 4096);
              if (oxygen == 180 || oxygen == 90)
                str4 = "Oxygen: OK";
              else
                str4 = "Oxygen: " + this.makeOxygenString(oxygen+ GCCoreUtil.translate("gui.seconds");
            }
          }
          else if (entity instanceof EntitySpaceshipBase)
          {
            //Spaceships:
            //  data0 = launch countdown
            //  data1 = height
            //  data2 = speed
            //  data3 = fuel remaining
            //  data4 = pitch angle
            int countdown = telemeter.clientData[0];
            str0 = "";
            str1 = (countdown == 400) ? "On launchpad" : ((countdown > 0) ? "Countdown: " + countdown / 20 : "Launched");
            str2 = "Height: " + telemeter.clientData[1];
            str3 = "Speed: " + this.makeSpeedString(telemeter.clientData[2]);
            str4 = "Fuel: " + telemeter.clientData[3] + "%";
          }
          else
          //Generic - could be boats or minecarts etc - just show the speed
          //TODO  can add more here, e.g. position data?
          if (telemeter.clientData[2] >= 0)
          {
            str2 = "Speed: " + makeSpeedString(telemeter.clientData[2]);
          }
      }
      else
      {
        //Default - draw a simple time display just to show the Display Screen is working
      World w1 = screen.driver.getWorldObj();
        int time1 = w1 != null ? (int) ((w1.getWorldTime() + 6000L) % 24000L) : 0;
        str2 = makeTimeString(time1 * 360);
        }
     
      int textWidthPixels = 155;
      int textHeightPixels = 60//1 lines
      if (str3.isEmpty()) textHeightPixels -= 10;
      if (str4.isEmpty()) textHeightPixels -= 10;

      //First pass - approximate border size
      float borders = frameA * 2 + 0.05F * Math.min(sizeX, sizeY);
      float scaleXTest = (sizeX - borders) / textWidthPixels;
      float scaleYTest = (sizeY - borders) / textHeightPixels;
      float scale = sizeX;
      if (scaleYTest < scaleXTest)
        scale = sizeY;
      //Second pass - the border size may be more accurate now
      borders = frameA * 2 + 0.05F * scale;
      scaleXTest = (sizeX - borders) / textWidthPixels;
      scaleYTest = (sizeY - borders) / textHeightPixels;
      scale = sizeX;
      float scaleText = scaleXTest;
      if (scaleYTest < scaleXTest)
      {
        scale = sizeY;
        scaleText = scaleYTest;
      }

      //Centre the text in the display
      float border = frameA + 0.025F * scale;
    if (entity != null && renderEntity != null) Xmargin = (sizeX - borders) / 2;
      float Xoffset = (sizeX - borders - textWidthPixels * scaleText) / 2 + Xmargin;
      float Yoffset = (sizeY - borders - textHeightPixels * scaleText) / 2 + scaleText;
      GL11.glTranslatef(border + Xoffset, border + Yoffset, 0.0F);
        GL11.glScalef(scaleText, scaleText, 1.0F);

        //Actually draw the text
        int whiteColour = GCCoreUtil.to32BitColor(255, 240, 216, 255);
        drawText(strName, whiteColour);
        drawText(str0, whiteColour);
        drawText(str1, whiteColour);
        drawText(str2, whiteColour);
        drawText(str3, whiteColour);
        drawText(str4, whiteColour);

        //If there is an entity to render, draw it on the left of the text
        if (renderEntity != null && entity != null )
        {
          GL11.glTranslatef(-Xmargin / 2 / scaleText, textHeightPixels / 2 + (-Yoffset + (sizeY - borders) / 2) / scaleText, -0.0005F);
          float scalefactor = 38F / (float) Math.pow(Math.max(entity.height, entity.width), 0.65);
          GL11.glScalef(scalefactor, scalefactor, 0.0015F);
          GL11.glRotatef(180F, 0, 0, 1);
          GL11.glRotatef(180F, 0, 1, 0);
          if (entity instanceof EntitySpaceshipBase)
          {
              GL11.glRotatef(telemeter.clientData[4], -1, 0, 0);
              GL11.glTranslatef(0, entity.height / 4, 0);
          }
          RenderPlayerGC.flagThermalOverride = true;
          renderEntity.doRender(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
            RenderPlayerGC.flagThermalOverride = false;
        }

        //TODO  Cross-dimensional tracking (i.e. old entity setDead, new entity created)
        //TODO  Deal with text off screen (including where localizations longer than English)
View Full Code Here

        GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(1.0F, 1.0F, 1.0F);
        GL11.glTranslatef(5.6F, 0.0F, 0.0F);
        Render render = RenderManager.instance.getEntityRenderObject(mc.thePlayer);
        RenderPlayer renderplayer = (RenderPlayer) render;
        renderplayer.renderFirstPersonArm(mc.thePlayer);
        GL11.glPopMatrix();
    }
View Full Code Here

      List entityRenderers = (List)ObfuscationReflectionHelper.getPrivateValue(RenderingRegistry.class, RenderingRegistry.instance(), "entityRenderers");
     
      for(Object obj : entityRenderers)
      {
        Field[] fields = obj.getClass().getDeclaredFields();
        Render render = null;
        Class clzz = null;
        for(Field f : fields)
        {
          f.setAccessible(true);
          if(f.getType() == Render.class)
          {
            render = (Render)f.get(obj);
          }
          else if(f.getType() == Class.class)
          {
            clzz = (Class)f.get(obj);
          }
        }
        if(render instanceof RendererLivingEntity && clzz != null)
        {
          renders.put(clzz, (RendererLivingEntity)render);
        }
      }
    }
    catch(Exception e)
    {
    }
     
    for(int i = compatibleEntities.size() - 1; i >= 0; i--)
    {
      if(renders.containsKey(compatibleEntities.get(i)))
      {
        continue;
      }
      Render rend = EntityHelper.getEntityClassRenderObject(compatibleEntities.get(i));
      if(rend != null && rend.getClass() == RenderEntity.class)
      {
        rend = renders.get(compatibleEntities.get(i));
      }
      if(!(rend instanceof RendererLivingEntity))
      {
View Full Code Here

            {
                float prevShadowSize = Morph.proxy.tickHandlerClient.playerRenderShadowSize;

                if(info.prevState != null && info.prevState.entInstance != null)
                {
                    Render render = RenderManager.instance.getEntityRenderObject(info.prevState.entInstance);
                    if(render != null)
                    {
                        prevShadowSize = render.shadowSize;
                    }
                }

                Render render = RenderManager.instance.getEntityRenderObject(info.nextState.entInstance);
                if(render == event.renderer)
                {
                    shadowSize = Morph.proxy.tickHandlerClient.playerRenderShadowSize;
                }
                else if(render != null)
View Full Code Here

        e.printStackTrace();
      }
      if(info == null)
      {
        Morph.console("Cannot find ModelInfo for " + clz.getName() + ". Attempting to generate one.", true);
        Render rend = RenderManager.instance.getEntityClassRenderObject(clz);
        ModelBase base = ModelHelper.getPossibleModel(rend);
        info = new ModelInfo(clz, rend, base);
        ModelList.addModelInfo(clz, info);
      }
    }
View Full Code Here

        setRenderHead(event.entity, true);
    }

    private void setRenderHead(EntityLivingBase entity, boolean setRender){
        if(entity.getEquipmentInSlot(4) != null && entity.getEquipmentInSlot(4).getItem() == Itemss.pneumaticHelmet && (Config.useHelmetModel || DateEventHandler.isIronManEvent())) {
            Render renderer = RenderManager.instance.getEntityRenderObject(entity);
            if(renderer instanceof RenderBiped) {
                ((RenderBiped)renderer).modelBipedMain.bipedHead.showModel = setRender;
            }
        }
    }
View Full Code Here

TOP

Related Classes of net.minecraft.client.renderer.entity.Render

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.