Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package wop;
- import javax.swing.Icon;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.entity.Render;
- import net.minecraft.client.renderer.texture.TextureMap;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.projectile.EntityPotion;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemPotion;
- import net.minecraft.potion.PotionHelper;
- import net.minecraft.util.IIcon;
- import net.minecraft.util.ResourceLocation;
- import org.lwjgl.opengl.GL11;
- import org.lwjgl.opengl.GL12;
- import wop.items.EntityWandBolt;
- import wop.lib.Constants;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class RenderWandBolt extends Render
- {
- private Item field_94151_a;
- private int field_94150_f;
- public RenderWandBolt(Item par1Item, int par2)
- {
- this.field_94151_a = par1Item;
- this.field_94150_f = par2;
- }
- public RenderWandBolt(Item par1Item)
- {
- this(par1Item, 0);
- }
- //ResourceLocations are typically static and final, but that is not an absolute requirement
- private static final ResourceLocation texture = new ResourceLocation(Constants.MODID,"textures/entity/magic_Pro.png");
- @Override
- protected ResourceLocation getEntityTexture(Entity entity) {
- //this method should return your texture, which may be different based
- //on certain characteristics of your custom entity; if that is the case,
- //you may want to make a second method that takes your class:
- return texture;
- }
- private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_)
- {
- float f = p_77026_2_.getMinU();
- float f1 = p_77026_2_.getMaxU();
- float f2 = p_77026_2_.getMinV();
- float f3 = p_77026_2_.getMaxV();
- float f4 = 1.0F;
- float f5 = 0.5F;
- float f6 = 0.25F;
- GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
- p_77026_1_.startDrawingQuads();
- p_77026_1_.setNormal(0.0F, 1.0F, 0.0F);
- p_77026_1_.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
- p_77026_1_.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
- p_77026_1_.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
- p_77026_1_.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
- p_77026_1_.draw();
- }
- /**
- * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
- * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
- * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(Entity par1Entity, double p2, double p3, double p4, float par8, float par9)
- {
- IIcon icon = this.field_94151_a.getIconFromDamage(this.field_94150_f);
- if(icon != null) {
- GL11.glPushMatrix();
- GL11.glTranslatef((float)p2, (float)p3, (float)p4);
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glScalef(0.5F, 0.5F, 0.5F);
- bindTexture(texture);
- Tessellator tessellator = Tessellator.instance;
- func_77026_a(tessellator, icon);
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- GL11.glPopMatrix();
- }
- }
- // For Forge 804:
- // For Forge 871:
- }
Advertisement
Add Comment
Please, Sign In to add comment