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.ResourceLocation;
- import org.lwjgl.opengl.GL11;
- import org.lwjgl.opengl.GL12;
- import wop.items.EntityWandBolt;
- import wop.items.ModItems;
- 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;
- }
- public void doRender(Entity par1Entity, double p2, double p3, double p4, float par8, float par9)
- {
- GL11.glPushMatrix();
- GL11.glTranslatef((float)p2, (float)p3, (float)p4);
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glScalef(0.5F, 0.5F, 0.5F);
- bindEntityTexture(par1Entity);
- Tessellator tessellator = Tessellator.instance;
- 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);
- tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 1.0F, 0.0F);
- tessellator.addVertex((double)(0.0F - f5), (double)(0.0F - f6), 0.0D);
- tessellator.addVertex((double)(f4 - f5), (double)(0.0F - f6), 0.0D);
- tessellator.addVertex((double)(f4 - f5), (double)(f4 - f6), 0.0D);
- tessellator.addVertex((double)(0.0F - f5), (double)(f4 - f6), 0.0D);
- tessellator.draw();
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- GL11.glPopMatrix();
- }
- /**
- * 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.
- */
- // For Forge 804:
- // For Forge 871:
- }
Advertisement
Add Comment
Please, Sign In to add comment