Guest User

Untitled

a guest
May 3rd, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.51 KB | None | 0 0
  1. package org.freeforums.geforce.SnipingMod.entitys;
  2.  
  3. import net.minecraft.client.renderer.RenderBlocks;
  4. import net.minecraft.client.renderer.entity.Render;
  5. import net.minecraft.client.renderer.texture.TextureMap;
  6. import net.minecraft.entity.Entity;
  7. import net.minecraft.util.ResourceLocation;
  8.  
  9. import org.freeforums.geforce.SnipingMod.mod_SnipingMod;
  10. import org.lwjgl.opengl.GL11;
  11.  
  12. import cpw.mods.fml.relauncher.Side;
  13. import cpw.mods.fml.relauncher.SideOnly;
  14.  
  15. @SideOnly(Side.CLIENT)
  16. public class RenderSniperBullet extends Render
  17. {
  18.     private final RenderBlocks sandRenderBlocks = new RenderBlocks();
  19.  
  20.     public RenderSniperBullet()
  21.     {
  22.         this.shadowSize = 0.5F;
  23.     }
  24.  
  25.     /**
  26.      * The actual render method that is used in doRender
  27.      */
  28.     public void doRenderFallingSand(EntitySniperBullet par1EntityFallingSand, double par2, double par4, double par6, float par8, float par9)
  29.     {                    
  30.             GL11.glPushMatrix();
  31.             GL11.glTranslatef((float)par2, (float)par4, (float)par6);
  32.             this.bindEntityTexture(par1EntityFallingSand);
  33.             GL11.glDisable(GL11.GL_LIGHTING);
  34.  
  35.             this.sandRenderBlocks.renderBlockAsItem(mod_SnipingMod.sniperBulletBlock, 0, par1EntityFallingSand.getBrightness(par9));
  36.            
  37.            
  38.  
  39.             GL11.glEnable(GL11.GL_LIGHTING);
  40.             GL11.glPopMatrix();
  41.        
  42.     }
  43.  
  44.     protected ResourceLocation getFallingSandTextures(EntitySniperBullet par1EntityFallingSand)
  45.     {
  46.         return TextureMap.locationBlocksTexture;
  47.     }
  48.  
  49.     /**
  50.      * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
  51.      */
  52.     protected ResourceLocation getEntityTexture(Entity par1Entity)
  53.     {
  54.         return this.getFallingSandTextures((EntitySniperBullet)par1Entity);
  55.     }
  56.  
  57.     /**
  58.      * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
  59.      * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
  60.      * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
  61.      * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
  62.      */
  63.     public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
  64.     {
  65.         this.doRenderFallingSand((EntitySniperBullet)par1Entity, par2, par4, par6, par8, par9);
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment