本文整理匯總了Java中net.minecraft.entity.item.EntityXPOrb.getBrightnessForRender方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityXPOrb.getBrightnessForRender方法的具體用法?Java EntityXPOrb.getBrightnessForRender怎麽用?Java EntityXPOrb.getBrightnessForRender使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.entity.item.EntityXPOrb
的用法示例。
在下文中一共展示了EntityXPOrb.getBrightnessForRender方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doRender
import net.minecraft.entity.item.EntityXPOrb; //導入方法依賴的package包/類
/**
* 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 doe
*/
public void doRender(EntityXPOrb entity, double x, double y, double z, float entityYaw, float partialTicks)
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
this.bindEntityTexture(entity);
int i = entity.getTextureByXP();
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;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)k / 1.0F, (float)l / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float f8 = 255.0F;
float f9 = ((float)entity.xpColor + partialTicks) / 2.0F;
l = (int)((MathHelper.sin(f9 + 0.0F) + 1.0F) * 0.5F * 255.0F);
int i1 = 255;
int j1 = (int)((MathHelper.sin(f9 + 4.1887903F) + 1.0F) * 0.1F * 255.0F);
GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
float f7 = 0.3F;
GlStateManager.scale(0.3F, 0.3F, 0.3F);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
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();
GlStateManager.disableBlend();
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
示例2: doRender
import net.minecraft.entity.item.EntityXPOrb; //導入方法依賴的package包/類
/**
* 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 doe
*/
public void doRender(EntityXPOrb entity, double x, double y, double z, float entityYaw, float partialTicks)
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
this.bindEntityTexture(entity);
int i = entity.getTextureByXP();
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;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)k / 1.0F, (float)l / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float f7 = 255.0F;
float f8 = ((float)entity.xpColor + partialTicks) / 2.0F;
l = (int)((MathHelper.sin(f8 + 0.0F) + 1.0F) * 0.5F * 255.0F);
boolean flag = true;
int i1 = (int)((MathHelper.sin(f8 + 4.1887903F) + 1.0F) * 0.1F * 255.0F);
GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
float f9 = 0.3F;
GlStateManager.scale(0.3F, 0.3F, 0.3F);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
int j1 = l;
int k1 = 255;
int l1 = i1;
if (Config.isCustomColors())
{
int i2 = CustomColors.getXpOrbColor(f8);
if (i2 >= 0)
{
j1 = i2 >> 16 & 255;
k1 = i2 >> 8 & 255;
l1 = i2 >> 0 & 255;
}
}
worldrenderer.pos((double)(0.0F - f5), (double)(0.0F - f6), 0.0D).tex((double)f, (double)f3).color(j1, k1, l1, 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(j1, k1, l1, 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(j1, k1, l1, 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(j1, k1, l1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
tessellator.draw();
GlStateManager.disableBlend();
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
示例3: doRender
import net.minecraft.entity.item.EntityXPOrb; //導入方法依賴的package包/類
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityXPOrb entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if (!this.renderOutlines)
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
this.bindEntityTexture(entity);
RenderHelper.enableStandardItemLighting();
int i = entity.getTextureByXP();
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;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)k, (float)l);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float f7 = 255.0F;
float f8 = ((float)entity.xpColor + partialTicks) / 2.0F;
if (Config.isCustomColors())
{
f8 = CustomColors.getXpOrbTimer(f8);
}
l = (int)((MathHelper.sin(f8 + 0.0F) + 1.0F) * 0.5F * 255.0F);
int i1 = 255;
int j1 = (int)((MathHelper.sin(f8 + 4.1887903F) + 1.0F) * 0.1F * 255.0F);
GlStateManager.translate(0.0F, 0.1F, 0.0F);
GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * -this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
float f9 = 0.3F;
GlStateManager.scale(0.3F, 0.3F, 0.3F);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
int k1 = l;
int l1 = 255;
int i2 = j1;
if (Config.isCustomColors())
{
int j2 = CustomColors.getXpOrbColor(f8);
if (j2 >= 0)
{
k1 = j2 >> 16 & 255;
l1 = j2 >> 8 & 255;
i2 = j2 >> 0 & 255;
}
}
vertexbuffer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
vertexbuffer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
vertexbuffer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
vertexbuffer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
tessellator.draw();
GlStateManager.disableBlend();
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
}
示例4: doRender
import net.minecraft.entity.item.EntityXPOrb; //導入方法依賴的package包/類
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityXPOrb entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if (!this.renderOutlines)
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
this.bindEntityTexture(entity);
RenderHelper.enableStandardItemLighting();
int i = entity.getTextureByXP();
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;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)k, (float)l);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float f8 = 255.0F;
float f9 = ((float)entity.xpColor + partialTicks) / 2.0F;
l = (int)((MathHelper.sin(f9 + 0.0F) + 1.0F) * 0.5F * 255.0F);
int i1 = 255;
int j1 = (int)((MathHelper.sin(f9 + 4.1887903F) + 1.0F) * 0.1F * 255.0F);
GlStateManager.translate(0.0F, 0.1F, 0.0F);
GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * -this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
float f7 = 0.3F;
GlStateManager.scale(0.3F, 0.3F, 0.3F);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
vertexbuffer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
vertexbuffer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
vertexbuffer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
vertexbuffer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
tessellator.draw();
GlStateManager.disableBlend();
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
}