本文整理汇总了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);
}
}