当前位置: 首页>>代码示例>>Java>>正文


Java RenderBlocks.getInstance方法代码示例

本文整理汇总了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();
 	}
 }
 
开发者ID:gigabit101,项目名称:PrimitiveCraft,代码行数:27,代码来源:ModelCampfire.java

示例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();
 	}
 }
 
开发者ID:gigabit101,项目名称:PrimitiveCraft,代码行数:27,代码来源:ModelJug.java

示例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();
 	}
 }
 
开发者ID:gigabit101,项目名称:PrimitiveCraft,代码行数:34,代码来源:ModelCampfire.java


注:本文中的net.minecraft.client.renderer.RenderBlocks.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。