本文整理匯總了Java中net.minecraft.client.renderer.WorldRenderer類的典型用法代碼示例。如果您正苦於以下問題:Java WorldRenderer類的具體用法?Java WorldRenderer怎麽用?Java WorldRenderer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
WorldRenderer類屬於net.minecraft.client.renderer包,在下文中一共展示了WorldRenderer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: func_148224_c
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
private void func_148224_c(int p_148224_1_, int p_148224_2_, int p_148224_3_, int p_148224_4_)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(Gui.statIcons);
float f = 0.0078125F;
float f1 = 0.0078125F;
int i = 18;
int j = 18;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex();
worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex();
worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex();
worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex();
tessellator.draw();
}
示例2: renderParticle
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
/**
* Renders the particle
*/
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
float f = ((float)this.age + partialTicks) / (float)this.maxAge;
f = f * f;
double d0 = this.field_174840_a.posX;
double d1 = this.field_174840_a.posY;
double d2 = this.field_174840_a.posZ;
double d3 = this.field_174843_ax.lastTickPosX + (this.field_174843_ax.posX - this.field_174843_ax.lastTickPosX) * (double)partialTicks;
double d4 = this.field_174843_ax.lastTickPosY + (this.field_174843_ax.posY - this.field_174843_ax.lastTickPosY) * (double)partialTicks + (double)this.field_174841_aA;
double d5 = this.field_174843_ax.lastTickPosZ + (this.field_174843_ax.posZ - this.field_174843_ax.lastTickPosZ) * (double)partialTicks;
double d6 = d0 + (d3 - d0) * (double)f;
double d7 = d1 + (d4 - d1) * (double)f;
double d8 = d2 + (d5 - d2) * (double)f;
int i = this.getBrightnessForRender(partialTicks);
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
d6 = d6 - interpPosX;
d7 = d7 - interpPosY;
d8 = d8 - interpPosZ;
this.field_174842_aB.renderEntityWithPosYaw(this.field_174840_a, (double)((float)d6), (double)((float)d7), (double)((float)d8), this.field_174840_a.rotationYaw, partialTicks);
}
示例3: renderQuads
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
private void renderQuads(WorldRenderer renderer, List<BakedQuad> quads, int color, ItemStack stack)
{
boolean flag = color == -1 && stack != null;
int i = 0;
for (int j = quads.size(); i < j; ++i)
{
BakedQuad bakedquad = (BakedQuad)quads.get(i);
int k = color;
if (flag && bakedquad.hasTintIndex())
{
k = stack.getItem().getColorFromItemStack(stack, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable)
{
k = TextureUtil.anaglyphColor(k);
}
k = k | -16777216;
}
this.renderQuad(renderer, bakedquad, k);
}
}
示例4: endAddVertex
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
public static void endAddVertex(WorldRenderer wrr)
{
SVertexBuilder svertexbuilder = wrr.sVertexBuilder;
if (svertexbuilder.vertexSize == 14)
{
if (wrr.drawMode == 7 && wrr.vertexCount % 4 == 0)
{
svertexbuilder.calcNormal(wrr, wrr.func_181664_j() - 4 * svertexbuilder.vertexSize);
}
long i = svertexbuilder.entityData[svertexbuilder.entityDataIndex];
int j = wrr.func_181664_j() - 14 + 12;
wrr.rawIntBuffer.put(j, (int)i);
wrr.rawIntBuffer.put(j + 1, (int)(i >> 32));
}
}
示例5: func_148171_c
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
private void func_148171_c(int p_148171_1_, int p_148171_2_, int p_148171_3_, int p_148171_4_)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(Gui.statIcons);
float f = 0.0078125F;
float f1 = 0.0078125F;
int i = 18;
int j = 18;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)).endVertex();
worldrenderer.pos((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)).endVertex();
worldrenderer.pos((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)).endVertex();
worldrenderer.pos((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)).endVertex();
tessellator.draw();
}
示例6: renderParticle
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
/**
* Renders the particle
*/
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
float f = this.particleIcon.getMinU();
float f1 = this.particleIcon.getMaxU();
float f2 = this.particleIcon.getMinV();
float f3 = this.particleIcon.getMaxV();
float f4 = 0.5F;
float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX);
float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY);
float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ);
int i = this.getBrightnessForRender(partialTicks);
int j = i >> 16 & 65535;
int k = i & 65535;
worldRendererIn.pos((double)(f5 - p_180434_4_ * 0.5F - p_180434_7_ * 0.5F), (double)(f6 - p_180434_5_ * 0.5F), (double)(f7 - p_180434_6_ * 0.5F - p_180434_8_ * 0.5F)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos((double)(f5 - p_180434_4_ * 0.5F + p_180434_7_ * 0.5F), (double)(f6 + p_180434_5_ * 0.5F), (double)(f7 - p_180434_6_ * 0.5F + p_180434_8_ * 0.5F)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos((double)(f5 + p_180434_4_ * 0.5F + p_180434_7_ * 0.5F), (double)(f6 + p_180434_5_ * 0.5F), (double)(f7 + p_180434_6_ * 0.5F + p_180434_8_ * 0.5F)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos((double)(f5 + p_180434_4_ * 0.5F - p_180434_7_ * 0.5F), (double)(f6 - p_180434_5_ * 0.5F), (double)(f7 + p_180434_6_ * 0.5F - p_180434_8_ * 0.5F)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
}
示例7: renderLitParticles
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
public void renderLitParticles(Entity entityIn, float p_78872_2_)
{
float f = 0.017453292F;
float f1 = MathHelper.cos(entityIn.rotationYaw * 0.017453292F);
float f2 = MathHelper.sin(entityIn.rotationYaw * 0.017453292F);
float f3 = -f2 * MathHelper.sin(entityIn.rotationPitch * 0.017453292F);
float f4 = f1 * MathHelper.sin(entityIn.rotationPitch * 0.017453292F);
float f5 = MathHelper.cos(entityIn.rotationPitch * 0.017453292F);
for (int i = 0; i < 2; ++i)
{
List list = this.fxLayers[3][i];
if (!list.isEmpty())
{
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
for (int j = 0; j < list.size(); ++j)
{
EntityFX entityfx = (EntityFX)list.get(j);
entityfx.renderParticle(worldrenderer, entityIn, p_78872_2_, f1, f5, f2, f3, f4);
}
}
}
}
示例8: drawBackground
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
/**
* Draws the background (i is always 0 as of 1.2.2)
*/
public void drawBackground(int tint)
{
GlStateManager.disableLighting();
GlStateManager.disableFog();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
this.mc.getTextureManager().bindTexture(optionsBackground);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float f = 32.0F;
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(0.0D, (double)this.height, 0.0D).tex(0.0D, (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex();
worldrenderer.pos((double)this.width, (double)this.height, 0.0D).tex((double)((float)this.width / 32.0F), (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex();
worldrenderer.pos((double)this.width, 0.0D, 0.0D).tex((double)((float)this.width / 32.0F), (double)tint).color(64, 64, 64, 255).endVertex();
worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)tint).color(64, 64, 64, 255).endVertex();
tessellator.draw();
}
示例9: render
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
private void render(int p_152436_1_, int p_152436_2_, int p_152436_3_, int p_152436_4_)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 0.65F + 0.35000002F * this.field_152443_c);
this.mc.getTextureManager().bindTexture(locationStreamIndicator);
float f = 150.0F;
float f1 = 0.0F;
float f2 = (float)p_152436_3_ * 0.015625F;
float f3 = 1.0F;
float f4 = (float)(p_152436_3_ + 16) * 0.015625F;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((double)(p_152436_1_ - 16 - p_152436_4_), (double)(p_152436_2_ + 16), (double)f).tex((double)f1, (double)f4).endVertex();
worldrenderer.pos((double)(p_152436_1_ - p_152436_4_), (double)(p_152436_2_ + 16), (double)f).tex((double)f3, (double)f4).endVertex();
worldrenderer.pos((double)(p_152436_1_ - p_152436_4_), (double)(p_152436_2_ + 0), (double)f).tex((double)f3, (double)f2).endVertex();
worldrenderer.pos((double)(p_152436_1_ - 16 - p_152436_4_), (double)(p_152436_2_ + 0), (double)f).tex((double)f1, (double)f2).endVertex();
tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例10: renderPumpkinOverlay
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
private void renderPumpkinOverlay(ScaledResolution p_180476_1_)
{
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableAlpha();
this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(0.0D, (double)p_180476_1_.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
worldrenderer.pos((double)p_180476_1_.getScaledWidth(), (double)p_180476_1_.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex();
worldrenderer.pos((double)p_180476_1_.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例11: compileDisplayList
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
/**
* Compiles a GL display list for this model
*/
private void compileDisplayList(float scale)
{
if (this.displayList == 0)
{
this.savedScale = scale;
this.displayList = GLAllocation.generateDisplayLists(1);
}
GL11.glNewList(this.displayList, GL11.GL_COMPILE);
WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer();
for (int i = 0; i < this.cubeList.size(); ++i)
{
((ModelBox)this.cubeList.get(i)).render(worldrenderer, scale);
}
for (int j = 0; j < this.spriteList.size(); ++j)
{
ModelSprite modelsprite = (ModelSprite)this.spriteList.get(j);
modelsprite.render(Tessellator.getInstance(), scale);
}
GL11.glEndList();
this.compiled = true;
}
示例12: renderTime
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
private static long renderTime(int p_renderTime_0_, long p_renderTime_1_, int p_renderTime_3_, int p_renderTime_4_, int p_renderTime_5_, float p_renderTime_6_, WorldRenderer p_renderTime_7_)
{
long i = p_renderTime_1_ / 200000L;
if (i < 3L)
{
return 0L;
}
else
{
p_renderTime_7_.pos((double)((float)p_renderTime_0_ + 0.5F), (double)(p_renderTime_6_ - (float)i + 0.5F), 0.0D).color(p_renderTime_3_, p_renderTime_4_, p_renderTime_5_, 255).endVertex();
p_renderTime_7_.pos((double)((float)p_renderTime_0_ + 0.5F), (double)(p_renderTime_6_ + 0.5F), 0.0D).color(p_renderTime_3_, p_renderTime_4_, p_renderTime_5_, 255).endVertex();
return i;
}
}
示例13: renderParticle
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
/**
* Renders the particle
*/
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
int i = (int)(((float)this.field_70581_a + partialTicks) * 15.0F / (float)this.field_70584_aq);
if (i <= 15)
{
this.theRenderEngine.bindTexture(EXPLOSION_TEXTURE);
float f = (float)(i % 4) / 4.0F;
float f1 = f + 0.24975F;
float f2 = (float)(i / 4) / 4.0F;
float f3 = f2 + 0.24975F;
float f4 = 2.0F * this.field_70582_as;
float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX);
float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY);
float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
RenderHelper.disableStandardItemLighting();
worldRendererIn.begin(7, field_181549_az);
worldRendererIn.pos((double)(f5 - p_180434_4_ * f4 - p_180434_7_ * f4), (double)(f6 - p_180434_5_ * f4), (double)(f7 - p_180434_6_ * f4 - p_180434_8_ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
worldRendererIn.pos((double)(f5 - p_180434_4_ * f4 + p_180434_7_ * f4), (double)(f6 + p_180434_5_ * f4), (double)(f7 - p_180434_6_ * f4 + p_180434_8_ * f4)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
worldRendererIn.pos((double)(f5 + p_180434_4_ * f4 + p_180434_7_ * f4), (double)(f6 + p_180434_5_ * f4), (double)(f7 + p_180434_6_ * f4 + p_180434_8_ * f4)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
worldRendererIn.pos((double)(f5 + p_180434_4_ * f4 - p_180434_7_ * f4), (double)(f6 - p_180434_5_ * f4), (double)(f7 + p_180434_6_ * f4 - p_180434_8_ * f4)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
Tessellator.getInstance().draw();
GlStateManager.enableLighting();
}
}
示例14: uploadDisplayList
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
private void uploadDisplayList(WorldRenderer p_178510_1_, int p_178510_2_, RenderChunk chunkRenderer)
{
GL11.glNewList(p_178510_2_, GL11.GL_COMPILE);
GlStateManager.pushMatrix();
chunkRenderer.multModelviewMatrix();
this.worldVertexUploader.func_181679_a(p_178510_1_);
GlStateManager.popMatrix();
GL11.glEndList();
}
示例15: drawModalRectWithCustomSizedTexture
import net.minecraft.client.renderer.WorldRenderer; //導入依賴的package包/類
/**
* Draws a textured rectangle at z = 0. Args: x, y, u, v, width, height, textureWidth, textureHeight
*/
public static void drawModalRectWithCustomSizedTexture(int x, int y, float u, float v, int width, int height, float textureWidth, float textureHeight)
{
float f = 1.0F / textureWidth;
float f1 = 1.0F / textureHeight;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((double)x, (double)(y + height), 0.0D).tex((double)(u * f), (double)((v + (float)height) * f1)).endVertex();
worldrenderer.pos((double)(x + width), (double)(y + height), 0.0D).tex((double)((u + (float)width) * f), (double)((v + (float)height) * f1)).endVertex();
worldrenderer.pos((double)(x + width), (double)y, 0.0D).tex((double)((u + (float)width) * f), (double)(v * f1)).endVertex();
worldrenderer.pos((double)x, (double)y, 0.0D).tex((double)(u * f), (double)(v * f1)).endVertex();
tessellator.draw();
}