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


Java RenderBlocks.setOverrideBlockTexture方法代码示例

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


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

import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public static void renderBlockByCompleteness(Block block, Fluid fluid, int meta, RenderBlocks renderer, double complete, int x, int y, int z) {

		renderer.setRenderBounds(0.01, 0.01, 0.01, 0.99, complete * 0.99, 0.99);
		renderer.setOverrideBlockTexture(fluid.getIcon());
		renderer.renderStandardBlock(block, x, y, z);
		renderer.clearOverrideBlockTexture();
	}
 
开发者ID:grand-mine-inc,项目名称:Steam-and-Steel,代码行数:8,代码来源:Utils.java

示例4: renderInventoryBlock

import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
    renderInventoryBlock(renderer, block, 0);

    renderer.setOverrideBlockTexture(BlockPIM.iIcon1);
    setTopPartBounds(renderer, false);
    renderInventoryBlockNoBounds(renderer, block, 0);
    renderer.clearOverrideBlockTexture();
}
 
开发者ID:Avaja,项目名称:OpenTechnology,代码行数:10,代码来源:BlockPIMRender.java

示例5: renderWorldBlock

import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    renderer.setRenderBoundsFromBlock(block);
    renderer.renderStandardBlock(block, x, y, z);

    final boolean isBreaking = renderer.hasOverrideBlockTexture();
    if (!isBreaking) renderer.setOverrideBlockTexture(BlockPIM.iIcon1);

    final boolean hasPlayer = hasPlayer(world, x, y, z);
    setTopPartBounds(renderer, hasPlayer);
    renderer.renderStandardBlock(block, x, y, z);

    if (!isBreaking) renderer.clearOverrideBlockTexture();
    return true;
}
 
开发者ID:Avaja,项目名称:OpenTechnology,代码行数:16,代码来源:BlockPIMRender.java

示例6: renderWorldBlock

import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	TELatexExtractor te = (TELatexExtractor) world.getTileEntity(x, y, z);
	Block latexBlock = ModBlocks.latex;
	float p = 0.0625f;
	
	renderer.renderAllFaces = true;
	GL11.glPushMatrix();

	if (te.getLatexAmount() > 0 && te.isBowlInstalled()) {
		FluidStack fs = new FluidStack(ModFluids.LATEX, te.getLatexAmount());

		int color = fs.getFluid().getColor(fs);
		float f = (color >> 16 & 255) / 255.0F;
		float f1 = (color >> 8 & 255) / 255.0F;
		float f2 = (color & 255) / 255.0F;
		float h = 4*p * (fs.amount / 200f);
		
		IIcon still = fs.getFluid().getStillIcon();
		
		setRotatedRenderBounds(renderer, te.rotation, MIN_X+5*p, MIN_Y+p, MIN_Z+7*p, MAX_X-5*p, MIN_Y+p+h, MAX_Z-3*p);
		renderer.setOverrideBlockTexture(still);
		renderer.renderStandardBlockWithColorMultiplier(latexBlock, x, y, z, f, f1, f2);
		renderer.clearOverrideBlockTexture();
		
	}
	
	rotate(renderer, 0);
	renderer.renderAllFaces = false;
	GL11.glPopMatrix();
	
	return true;
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:34,代码来源:RenderLatexExtractor.java

示例7: 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

示例8: renderWorldBlock

import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	
	int meta = world.getBlockMetadata(x, y, z);
	
       renderer.renderStandardBlock(block, x, y, z);
       
       if (block instanceof BlockReinforced && meta < 5 && meta > 0) {
       	
       	BlockReinforced reinforced = (BlockReinforced)block;
       	
       	GL11.glPushMatrix();
       	
       	renderer.setOverrideBlockTexture(reinforced.broken_overlay[meta - 1]);
       	
       	renderer.renderStandardBlock(reinforced, x, y, z);
       	
       	renderer.clearOverrideBlockTexture();
       	
       	GL11.glPopMatrix();
       }       
       
       return true;
}
 
开发者ID:TeamMonumental,项目名称:FissionWarfare,代码行数:25,代码来源:RenderReinforcedBlock.java

示例9: renderWorldBlock

import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	TileEntity te = world.getTileEntity(x, y, z);
	if (te == null || !(te instanceof TEWireDrawBench))
		return false;
	
	TEWireDrawBench tewd = (TEWireDrawBench) world.getTileEntity(x, y, z);
	if (tewd == null || !tewd.isHeadBlock)
		return false;
	
	tewd = tewd.getMainTileEntity();
	
	renderer.renderAllFaces = true;
	GL11.glPushMatrix();
	
	if (tewd.recipe != null) {
		
		Item wire = tewd.recipe.getInItem().getItem();
		String metal = ((IDrawable) wire).getWireMetalName();
		IIcon ico = WireDrawBenchManager.getInstance().getWireIcon(metal);
		
		byte progr = tewd.progress;
		float offZ;
		float offY = 0F;
		
		if (progr > 99 || tewd.isFinished()) {
			offZ = 8F * P;
			offY = 1F * P;
		}
		else {
			offZ = 7F * P * (progr / 99f);
		}
		
		setRotatedRenderBounds(renderer, tewd.rotation, MIN_X, MIN_Y - offY, MIN_Z - offZ, MAX_X, MAX_Y - offY, MAX_Z - offZ);
		renderer.setOverrideBlockTexture(ico);
		//rotate(renderer, tewd.rotation);
		//renderer.renderStandardBlockWithColorMultiplier(Blocks.iron_block, x, y, z, 255, 255, 255);
		renderer.renderStandardBlock(Blocks.iron_block, x, y, z);
		renderer.clearOverrideBlockTexture();
	}
	
	rotate(renderer, 0);
	renderer.renderAllFaces = false;
	GL11.glPopMatrix();
	
	return true;
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:48,代码来源:RenderWireDrawBench.java

示例10: renderWorldBlock

import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
		RenderBlocks renderer) {
	
	renderer.setOverrideBlockTexture(((OverlayBlockBase)block).getBaseIcon(world,x,y,z));
	
	renderer.setRenderBounds(0, 0, 0, 1, 1, 1);//レンダ―の開始位置と終了位置
	renderer.renderStandardBlock(block, x, y, z);//スタンダードな直方体を上の指定に合わせて描写

	renderer.setOverrideBlockTexture(null);//変更したら使い終わったらもとに戻そうね


	renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
	renderer.renderStandardBlock(block, x, y, z);
	
	return true;
}
 
开发者ID:Team-Antimatter-Mod,项目名称:AntiMatterMod,代码行数:18,代码来源:OverlayBlockRender.java


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