本文整理汇总了Java中net.minecraft.client.renderer.RenderBlocks.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java RenderBlocks.getInstance方法的具体用法?Java RenderBlocks.getInstance怎么用?Java RenderBlocks.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.RenderBlocks
的用法示例。
在下文中一共展示了RenderBlocks.getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderFluid
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public void renderFluid(float f5)
{
if(hasFluid && hasJug)
{
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
float scale = 0.5F;
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(0f, 2.0F, 0f);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
RenderBlocks renderBlocks = RenderBlocks.getInstance();
renderBlocks.setOverrideBlockTexture(fluidstack.getFluid().getStillIcon());
renderBlocks.renderBlockAsItem(Blocks.stone, 0, 1.0f);
renderBlocks.clearOverrideBlockTexture();
GL11.glPopAttrib();
GL11.glPopMatrix();
}
}
示例2: renderFluid
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public void renderFluid(float f5)
{
if(hasFluid)
{
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
float scale = 0.5F;
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(0f, 2.0F, 0f);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
RenderBlocks renderBlocks = RenderBlocks.getInstance();
renderBlocks.setOverrideBlockTexture(fluidstack.getFluid().getStillIcon());
renderBlocks.renderBlockAsItem(Blocks.stone, 0, 1.0f);
renderBlocks.clearOverrideBlockTexture();
GL11.glPopAttrib();
GL11.glPopMatrix();
}
}
示例3: renderFire
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public void renderFire(float f5)
{
if(isActive)
{
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glRotatef(180, 0, 0, 5);
if(!hasJug)
{
GL11.glTranslatef(0f, -0.8F, 0f);
}
else
{
GL11.glTranslatef(0f, -1.2F, 0f);
}
if(hasJug)
{
GL11.glScalef(1F, 0.5F, 1F);
}
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
RenderBlocks renderBlocks = RenderBlocks.getInstance();
renderBlocks.setOverrideBlockTexture(Blocks.fire.getFireIcon(1));
renderBlocks.renderBlockAsItem(Blocks.torch, 1, 2.0f);
renderBlocks.clearOverrideBlockTexture();
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}