initial commit
This commit is contained in:
parent
3c9ee26b06
commit
22186c33b9
1458 changed files with 282792 additions and 0 deletions
83
java/src/game/renderer/entity/RenderXpOrb.java
Executable file
83
java/src/game/renderer/entity/RenderXpOrb.java
Executable file
|
@ -0,0 +1,83 @@
|
|||
package game.renderer.entity;
|
||||
|
||||
import game.ExtMath;
|
||||
import game.WCF;
|
||||
import game.entity.item.EntityXp;
|
||||
import game.renderer.DefaultVertexFormats;
|
||||
import game.renderer.GlState;
|
||||
import game.renderer.RenderBuffer;
|
||||
import game.renderer.Tessellator;
|
||||
|
||||
|
||||
public class RenderXpOrb extends Render<EntityXp>
|
||||
{
|
||||
private static final String experienceOrbTextures = "textures/entity/experience_orb.png";
|
||||
|
||||
public RenderXpOrb(RenderManager renderManagerIn)
|
||||
{
|
||||
super(renderManagerIn);
|
||||
// this.shadowSize = 0.15F;
|
||||
// this.shadowOpaque = 0.75F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the desired {@code T} type Entity.
|
||||
*/
|
||||
public void doRender(EntityXp entity, double x, double y, double z, float partialTicks)
|
||||
{
|
||||
WCF.glPushMatrix();
|
||||
WCF.glTranslatef((float)x, (float)y, (float)z);
|
||||
this.bindEntityTexture(entity);
|
||||
int i = entity.getXpValue();
|
||||
float f = (float)(i % 4 * 16 + 0) / 64.0F;
|
||||
float f1 = (float)(i % 4 * 16 + 16) / 64.0F;
|
||||
float f2 = (float)(i / 4 * 16 + 0) / 64.0F;
|
||||
float f3 = (float)(i / 4 * 16 + 16) / 64.0F;
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 0.25F;
|
||||
int j = entity.getBrightnessForRender(partialTicks);
|
||||
int k = j % 65536;
|
||||
int l = j / 65536;
|
||||
WCF.glMultiTexCoord2f(WCF.GL_TEXTURE1, (float)k / 1.0F, (float)l / 1.0F);
|
||||
GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
float f8 = 255.0F;
|
||||
float f9 = ((float)entity.xpColor + partialTicks) / 2.0F;
|
||||
l = (int)((ExtMath.sin(f9 + 0.0F) + 1.0F) * 0.5F * 255.0F);
|
||||
int i1 = 255;
|
||||
int j1 = (int)((ExtMath.sin(f9 + 4.1887903F) + 1.0F) * 0.1F * 255.0F);
|
||||
WCF.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
WCF.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
float f7 = 0.3F;
|
||||
WCF.glScalef(0.3F, 0.3F, 0.3F);
|
||||
// Tessellator tessellator = Tessellator.getInstance();
|
||||
RenderBuffer worldrenderer = Tessellator.getBuffer();
|
||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
|
||||
worldrenderer.pos((double)(0.0F - f5), (double)(0.0F - f6), 0.0D).tex((double)f, (double)f3).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
|
||||
worldrenderer.pos((double)(f4 - f5), (double)(0.0F - f6), 0.0D).tex((double)f1, (double)f3).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
|
||||
worldrenderer.pos((double)(f4 - f5), (double)(1.0F - f6), 0.0D).tex((double)f1, (double)f2).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
|
||||
worldrenderer.pos((double)(0.0F - f5), (double)(1.0F - f6), 0.0D).tex((double)f, (double)f2).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
|
||||
Tessellator.draw();
|
||||
GlState.disableBlend();
|
||||
GlState.disableRescaleNormal();
|
||||
WCF.glPopMatrix();
|
||||
super.doRender(entity, x, y, z, partialTicks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected String getEntityTexture(EntityXp entity)
|
||||
{
|
||||
return experienceOrbTextures;
|
||||
}
|
||||
|
||||
// protected boolean canRenderName(EntityXp entity)
|
||||
// {
|
||||
// return entity.hasCustomName() || super.canRenderName(entity);
|
||||
// }
|
||||
|
||||
protected void renderLivingLabel(EntityXp entityIn, String str, double x, double y, double z, int maxDistance) {
|
||||
super.renderLivingLabel(entityIn, str, x, y - 0.5, z, maxDistance);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue