Advertisement
Guest User

Render

a guest
Jul 28th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.86 KB | None | 0 0
  1. package io.github.hsyyid.gta.entities.render;
  2.  
  3. import io.github.hsyyid.gta.Main;
  4. import io.github.hsyyid.gta.entities.EntityZentorno;
  5. import net.minecraft.client.renderer.GlStateManager;
  6. import net.minecraft.client.renderer.entity.Render;
  7. import net.minecraft.client.renderer.entity.RenderManager;
  8. import net.minecraft.entity.Entity;
  9. import net.minecraft.entity.player.EntityPlayer;
  10. import net.minecraft.util.ResourceLocation;
  11. import net.minecraftforge.fml.relauncher.Side;
  12. import net.minecraftforge.fml.relauncher.SideOnly;
  13.  
  14. import com.arisux.xlib.api.wavefrontapi.Part;
  15. import com.arisux.xlib.api.wavefrontapi.WavefrontAPI;
  16. import com.arisux.xlib.api.wavefrontapi.WavefrontModel;
  17. import com.arisux.xlib.client.render.XLibRenderer;
  18.  
  19. @SideOnly(Side.CLIENT)
  20. public class RenderZentornoEntity extends Render
  21. {
  22.     public WavefrontModel model = WavefrontAPI.instance().loadModel(Main.class, "gta", "m577apc", "/assets/gta/models/entity/m577apc");
  23.  
  24.     public RenderZentornoEntity(RenderManager renderManager)
  25.     {
  26.         super(renderManager);
  27.     }
  28.  
  29.     protected ResourceLocation getEntityTexture(EntityZentorno entityZentrono)
  30.     {
  31.         return null;
  32.     }
  33.  
  34.     protected ResourceLocation getEntityTexture(Entity entity)
  35.     {
  36.         return null;
  37.     }
  38.  
  39.     public void doRender(Entity zentornoIn, double posX, double posY, double posZ, float yaw, float partialTicks)
  40.     {
  41.         XLibRenderer.pushMatrix();
  42.         {
  43.             XLibRenderer.translate(posX, posY, posZ);
  44.             double curVelocity = Math.sqrt(zentornoIn.motionX * zentornoIn.motionX + zentornoIn.motionZ * zentornoIn.motionZ);
  45.             float tireRotation = curVelocity > 0.1 ? -(zentornoIn.worldObj.getWorldTime() % 360 * 8) - partialTicks : 0;
  46.             for(Part p : model.nameToPartHash.values())
  47.             {
  48.                 if(p != null)
  49.                 {
  50.                     XLibRenderer.pushMatrix();
  51.                     {
  52.                         p.draw();
  53.                     }
  54.                     XLibRenderer.popMatrix();
  55.                 }
  56.             }
  57.         }
  58.         XLibRenderer.popMatrix();
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement