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


Java RenderBlocks.renderBlockAsItem方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.RenderBlocks.renderBlockAsItem方法的典型用法代码示例。如果您正苦于以下问题:Java RenderBlocks.renderBlockAsItem方法的具体用法?Java RenderBlocks.renderBlockAsItem怎么用?Java RenderBlocks.renderBlockAsItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.RenderBlocks的用法示例。


在下文中一共展示了RenderBlocks.renderBlockAsItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

示例4: renderInventoryItem

import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public void renderInventoryItem(RenderBlocks render, ItemStack item)
{
    int meta = item.getItemDamage();
    
    if(meta == 0)
        meta = ItemMobSpawner.idPig;

    String bossName = BossStatus.bossName;
    int bossTimeout = BossStatus.statusBarTime;
    try
    {
        World world = NEIClientUtils.mc().theWorld;
        ItemMobSpawner.loadSpawners(world);
        TextureUtils.bindAtlas(0);
        render.renderBlockAsItem(Blocks.mob_spawner, 0, 1F);
        GL11.glPushMatrix();
        
        Entity entity = ItemMobSpawner.getEntity(meta);
        entity.setWorld(world);
        float f1 = 0.4375F;
        if(entity.getShadowSize() > 1.5)
            f1 = 0.1F;
        GL11.glRotatef((float) (ClientUtils.getRenderTime()*10), 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-20F, 1.0F, 0.0F, 0.0F);
        GL11.glTranslatef(0.0F, -0.4F, 0.0F);
        GL11.glScalef(f1, f1, f1);
        entity.setLocationAndAngles(0, 0, 0, 0.0F, 0.0F);
        RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 0);
        GL11.glPopMatrix();

        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
    }
    catch(Exception e)
    {
        if(Tessellator.instance.isDrawing)
            Tessellator.instance.draw();
    }
    BossStatus.bossName = bossName;
    BossStatus.statusBarTime = bossTimeout;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:44,代码来源:SpawnerRenderer.java


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