Regitered items-Removed useless one
This commit is contained in:
parent
29228e18fe
commit
6197b7eca1
8 changed files with 36 additions and 96 deletions
|
|
@ -1,21 +1,17 @@
|
|||
package mysticworld.renderer;
|
||||
|
||||
import mysticworld.items.ItemHandler;
|
||||
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.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class RenderStaffPower extends Render {
|
||||
private int meta = 0;
|
||||
|
||||
public RenderStaffPower(int par1) {
|
||||
this.meta = par1;
|
||||
private final ResourceLocation location;
|
||||
public RenderStaffPower(String type) {
|
||||
location = new ResourceLocation("mysticworld","textures/items/Charge"+type+".png");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -26,14 +22,9 @@ public class RenderStaffPower extends Render {
|
|||
public void doRenderEntity(Entity entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
GL11.glPushMatrix();
|
||||
this.bindEntityTexture(entity);
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
IIcon icon = ItemHandler.staffPower.getIconFromDamage(this.meta);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
float f3 = icon.getMinU();
|
||||
float f4 = icon.getMaxU();
|
||||
float f5 = icon.getMinV();
|
||||
float f6 = icon.getMaxV();
|
||||
float f7 = 1.0F;
|
||||
float f8 = 0.5F;
|
||||
float f9 = 0.25F;
|
||||
|
|
@ -41,10 +32,10 @@ public class RenderStaffPower extends Render {
|
|||
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
tessellator.addVertexWithUV(0.0F - f8, 0.0F - f9, 0.0D, f3, f6);
|
||||
tessellator.addVertexWithUV(f7 - f8, 0.0F - f9, 0.0D, f4, f6);
|
||||
tessellator.addVertexWithUV(f7 - f8, 1.0F - f9, 0.0D, f4, f5);
|
||||
tessellator.addVertexWithUV(0.0F - f8, 1.0F - f9, 0.0D, f3, f5);
|
||||
tessellator.addVertexWithUV(0.0F - f8, 0.0F - f9, 0.0D, 0, 1);
|
||||
tessellator.addVertexWithUV(f7 - f8, 0.0F - f9, 0.0D, 1, 1);
|
||||
tessellator.addVertexWithUV(f7 - f8, 1.0F - f9, 0.0D, 1, 0);
|
||||
tessellator.addVertexWithUV(0.0F - f8, 1.0F - f9, 0.0D, 0, 0);
|
||||
tessellator.draw();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
|
|
@ -52,6 +43,6 @@ public class RenderStaffPower extends Render {
|
|||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity par1Entity) {
|
||||
return TextureMap.locationItemsTexture;
|
||||
return location;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue